Biztalk 2013 WCF-webhttp (WCF web publishing wizard) not exposing schemas - biztalk

Wonder if you guys can help. I have used the BizTalk WCF Service Publishing wizard to expose an Orchestration via WCF-WebHttp, and I can see the service and I am able to send requests to it via SOAPUi etc, however, I cannot see any of the schemas when I try and add the service reference to a .NET application. I've ensured that the schemas are in the same project, and that the actual DLL is GAC'd before deploying the service.
I've looked at the wsdl but I cannot see anything related to the schemas.
<wsdl:types>
<xs:schema elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/Message" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.microsoft.com/Message">
<xs:complexType name="MessageBody">
<xs:sequence>
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##any" />
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="ITwoWayAsync_BizTalkSubmit_InputMessage">
<wsdl:part name="message" type="q1:MessageBody" xmlns:q1="http://schemas.microsoft.com/Message" />
</wsdl:message>
<wsdl:message name="ITwoWayAsync_BizTalkSubmit_OutputMessage">
<wsdl:part name="BizTalkSubmitResult" type="q2:MessageBody" xmlns:q2="http://schemas.microsoft.com/Message" />
</wsdl:message>
<wsdl:portType name="ITwoWayAsync">
<wsdl:operation name="BizTalkSubmit">
<wsdl:input wsaw:Action="BizTalkSubmit" message="tns:ITwoWayAsync_BizTalkSubmit_InputMessage" />
<wsdl:output wsaw:Action="http://www.microsoft.com/biztalk/2006/r2/wcf-adapter/ITwoWayAsync/BizTalkSubmitResponse" message="tns:ITwoWayAsync_BizTalkSubmit_OutputMessage" />
</wsdl:operation>
</wsdl:portType>
<wsdl:service name="BizTalkServiceInstance" />
</wsdl:definitions>
When I try and add a service reference to the service, it successfully adds the reference, but for the method called BizTalkSubmit, it only takes a parameter of System.ServiceModel.Channels.Message.
Any ideas greatly appreciated.
Regards
Jazzyuk

I would recommend that you publish using WCF-WSHttp first, then changing to WCF-WebHttp afterwards. This will enable you to choose a schema to publish:

Related

How to invoke a REST service from BPEL in Oracle SOA, with Basic Authentication?

I am working with the Oracle Fusion Middleware 12.1.3, and I am developing a BPEL process which has to invoke a remote REST service that needs a Basic Authentication.
I created an External reference to the Rest Service, and in my composite.xml, it looks like this :
....
<component name="MyCompositeBASProcess" version="2.0">
<implementation.bpel src="BPEL/MyCompositeBASProcess.bpel"/>
<componentType>
<service name="mycompositebasprocess_client" ui:wsdlLocation="WSDLs/MyCompositeBASProcess.wsdl">
<interface.wsdl interface="http://xmlns.oracle.com/myPartitionSOA/MyCompositeBAS/MyCompositeBASProcess#wsdl.interface(MyCompositeBASProcess)"
callbackInterface="http://xmlns.oracle.com/myPartitionSOA/MyCompositeBAS/MyCompositeBASProcess#wsdl.interface(MyCompositeBASProcessCallback)"/>
</service>
<reference name="CMProxyRS" ui:wsdlLocation="WSDLs/CMProxyRS.wsdl">
<interface.wsdl interface="http://xmlns.oracle.com/myPartitionSOA/MyCompositeBAS/CMProxyRS#wsdl.interface(CMProxyRS_ptt)"/>
</reference>
</componentType>
<property name="bpel.config.oneWayDeliveryPolicy" type="xs:string" many="false">async.persist</property>
</component>
<reference name="CMProxyRS" ui:wsdlLocation="WSDLs/CMProxyRS.wsdl">
<interface.wsdl interface="http://xmlns.oracle.com/myPartitionSOA/MyCompositeBAS/CMProxyRS#wsdl.interface(CMProxyRS_ptt)"/>
<binding.rest config="Adapters/CMProxyRS.wadl" location="http://server_WITHOUT_basic-auth/cmproxy/resources/v2/" />
</reference>
....
With this code I invoke a REST service which is not secured by a BASIC_Auth, and it works fine.
Now, when I switch to a remote environment which needs a basic authentication, I did not manage to succeed.
I found some examples to invoke SOAP services with basic auth, but nothing really interesting for REST services. But, in the Oracle Fusion stack 12.1.3, REST services are "adapted" to SOAP services before being used, so I thought that I could use the examples I found.
So, I updated my composite.xml to add the user/password and the policy :
....
<reference name="CMProxyRS" ui:wsdlLocation="WSDLs/CMProxyRS.wsdl">
<interface.wsdl interface="http://xmlns.oracle.com/myPartitionSOA/MyCompositeBAS/CMProxyRS#wsdl.interface(CMProxyRS_ptt)"/>
<binding.rest config="Adapters/CMProxyRS.wadl" location="http://server_WITH_basic-auth/cmproxy/resources/v2/">
<wsp:PolicyReference URI="oracle/wss_username_token_client_policy" orawsp:category="security" orawsp:status="enabled"/>
<!-- <property name="oracle.webservices.auth.username">weblogic</property> -->
<!-- <property name="oracle.webservices.auth.password">password</property> -->
<property name="oracle.webservices.preemptiveBasicAuth">true</property>
<property name="javax.xml.ws.security.auth.username" many="false" override="may">weblogic</property>
<property name="javax.xml.ws.security.auth.password" many="false" override="may">password</property>
</binding.rest>
</reference>
....
As you can see, I tried with the javax.xml.ws.security.auth. properties and with the oracle.webservices.auth. properties. But both failed : on the remote, I do not get any Basic Authentication in the requests.
I also updated my CMProxyRS.wadl to add the Authorization key in the HTTP Header. For example :
<resources>
<resource path="/documents">
<method name="GET" soa:wsdlOperation="searchDocument">
<request>
<param name="Authorization" style="header" soa:expression="$msg.request/tns:Authorization" default="" type="xsd:string"/>
<param name="queryText" style="query" soa:expression="$msg.request/tns:queryText" default="" type="xsd:string"/>
<param name="fields" style="query" soa:expression="$msg.request/tns:fields" default="id,name,originalName,originalFormat,originalExtension,alternateFormat,alternateExtension,revision" type="xsd:string"/>
<param name="waitForIndexing" style="query" soa:expression="$msg.request/tns:waitForIndexing" default="false" type="xsd:boolean"/>
</request>
<response status="200">
....
And this Authorization was "replicated" in the WSDL.CMProxyRS.wsdl :
<element name="searchDocument_params">
<complexType>
<sequence>
<element name="Authorization" type="string"/>
<element name="queryText" type="string"/>
<element name="fields" type="string"/>
<element name="waitForIndexing" type="boolean"/>
</sequence>
</complexType>
</element>
This did not help. In fact, I am really not sure that what I added in my composite.xml (the properties username, password, preemptiveBasicAuth) is used by the SOA Engine to build the REST request.
(I would like to specify that it is not a user/password issue : when I test this REST query with the same user/password from Postman, it work fine.)
How can I manage to invoke a REST service with basic Authentication from a soa-composite ?
You can send custom HTTP headers in BPEL.
Take a look at this post. You need to add oracle.webservices.http.headers on the reference service and then you can populate variables and send them on your REST invoke acticity in BPEL.
You can try OWSM oracle/http_jwt_token_client_policy to pass the required headers in the request.
I had the same issue initially trying to invoke WADL from Oracle SOA 12c.
It started working after applying the following OWSM security policy:
oracle/http_jwt_token_client_policy

"Type expected" On Declaration Of Web Service

I am writing an app in VS2013 (VB) to replace our site's text editor, TXTextControl from v16 to their new HTML5 editor v22. I did not write the original code, but I have a tight release deadline so I'm trying to duplicate the original project as closely as possible, from the original code. We already have a web service written in VS2010 (VB) to fill merge codes with data from our database. I have deleted and re-added the web service multiple times, tried both a Service Reference and a Web Reference, deleted the reference and cleaned the project, etc. I still am getting a "Type Expected" area when I try to dimension an object of the web service class. Here is that code (subbing 'asdf' for my actual domain):
Dim document As com.asdf.cms.service.FileManager.FileManager = New com.asdf.cms.service.FileManager.FileManager()
I have a project setting, web service type, application scope, named BrowserControlApp_com_asdf_cms_service_FileManager_FileManager, which has a value of http://ws.staging.asdf.com/Services/FileManager/.
The following is in my web.config file:
<applicationSettings>
<BrowserControlApp.My.MySettings>
<setting name="BrowserControlApp_com_asdf_cms_service_FileManager_FileManager"
serializeAs="String">
<value>http://ws.staging.asdf.com/Services/FileManager/</value>
</setting>
</BrowserControlApp.My.MySettings>
</applicationSettings>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="FileManagerSoap" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://ws.staging.asdf.com/Services/FileManager/FileManager.asmx"
binding="basicHttpBinding" bindingConfiguration="FileManagerSoap"
contract="com.asdf.cms.service.FileManager.FileManager.FileManagerSoap"
name="FileManagerSoap" />
</client>
</system.serviceModel>
One strange thing I noticed is that the wsdl file contains two completely different locations for the service - one of which, while visually similar to the actual service URL is not even a valid URL for
the service as seen in the following snippet:
<wsdl:operation name="LoadEnvelope">
<soap12:operation soapAction="http://asdf.com/cms/services/filemanager/LoadEnvelope" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="FileManager">
<wsdl:port name="FileManagerSoap" binding="tns:FileManagerSoap">
<soap:address location="http://ws.staging.asdf.com/Services/FileManager/FileManager.asmx" />
</wsdl:port>
<wsdl:port name="FileManagerSoap12" binding="tns:FileManagerSoap12">
<soap12:address location="http://ws.staging.asdf.com/Services/FileManager/FileManager.asmx" />
</wsdl:port>
I believe I've provided all the pertinent information. Can anyone see why my service type is not resolving? Thanks in advance, and any help is appreciated!
Thanks,
Mike

The element 'system.webServer' has invalid child element 'httpPlatform'

I am working through Shawn Wildermuth's course here and get the following warning about web.config when I build
Severity Code Description Project File
Line
Warning The element 'system.webServer' has invalid child element 'httpPlatform'.
List of possible elements expected: 'asp, caching, cgi, defaultDocument,
directoryBrowse, globalModules, handlers, httpCompression, webSocket,
httpErrors, httpLogging, httpProtocol, httpRedirect, httpTracing,
isapiFilters, modules, applicationInitialization, odbcLogging, security,
serverRuntime, serverSideInclude, staticContent, tracing, urlCompression,
validation, management, rewrite'.
TheWorld E:\EShared\Pluralsight\aspdotnet-5-ef7-bootstrap-angular-web-app\1-aspdotnet-5-ef7-bootstrap-angular-web-app-m1-exercise-files\VS2015\src\TheWorld\wwwroot\web.config 8
Web.config is
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/>
</handlers>
<httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" stdoutLogEnabled="false" startupTimeLimit="3600"/>
</system.webServer>
</configuration>
The program runs ok. Should I be doing anything about the warning?
Up until the time the current is written (Jan-2016) this is a known issue that MS did not fix. It will probably be fixed in a later version/update.
The problem is that the httpPlatform element is missing from:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Xml\Schemas\1033\DotNetConfig.xsd
You can manualy modify the xsd with an editor having Administrator right and add this under the system.webServer:
<xs:element name="httpPlatform" vs:help="configuration/system.webServer/httpPlatform">
<xs:complexType>
<xs:attribute name="arguments" type="xs:string" use="optional" vs:help="configuration/system.webServer/httpPlatform/arguments" />
<xs:attribute name="processPath" type="xs:string" use="required" vs:help="configuration/system.webServer/httpPlatform/processPath" />
<xs:attribute name="startupTimeLimit" use="required" vs:help="configuration/system.webServer/httpPlatform/startupTimeLimit">
<xs:simpleType>
<xs:restriction base="xs:int">
<xs:minInclusive value="1" />
<xs:maxInclusive value="99999" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="stdoutLogEnabled" type="small_boolean_Type" use="required" vs:help="configuration/system.webServer/httpPlatform/stdoutLogEnabled" />
<xs:attribute name="stdoutLogFile" type="xs:string" vs:help="configuration/system.webServer/httpPlatform/stdoutLogFile" />
<xs:anyAttribute namespace="http://schemas.microsoft.com/XML-Document-Transform" processContents="strict" />
</xs:complexType>
</xs:element>
This solved the problem for me.
UPDATE: you can find a similar post here. I got the original idea there, but modified the schema a bit.
UPDATE2: a hint to find the spot to add the element is to locate
<xs:element name="handlers" vs:help="configuration/system.webServer/handlers">
and place it just above it.
First, that course is rather old now (RC2 is coming), so you would have to give it up, and wait to see if a newer course is coming.
[Updated: For RC2 and above, a new module is required instead of HttpPlatformHandler, https://github.com/aspnet/Announcements/issues/164]

WCF SOAP Fault incorrect type

First of all, here is my setup:
.Net 4.0 ASP.Net application
WCF service, with basicHttpBinding (soap 1.1)
The reference class was generated using svcutil, with the options /useSerializerForFaults; the WSDL defines all operations, and provides links to the types.xsd and the types_fault.xsd files. FYI, the WSD and XSD files are common for many applications so I cannot modify them (unless of course there some major validation errors)
My issue stands when I send a SOAP Fault to the client : I am unable to access the correct type in the code, for the fault detail, so the client is not able to process this fault.
Here is an extract of the WSDL for your understanding:
<wsdl:message name="CreateScheduledWorkRequest">
<wsdl:part name="parameters" element="root:CreateScheduledWork"/>
</wsdl:message>
<wsdl:message name="CreateScheduledWorkResponse">
<wsdl:part name="parameters" element="root:CreateScheduledWorkResponse"/>
</wsdl:message>
<wsdl:message name="CreateScheduledWorkFault">
<wsdl:part name="parameters" element="root:CreateScheduledWorkFault"/>
</wsdl:message>
<wsdl:portType name="ManageScheduledWorkScheduledWorkManagement">
<wsdl:operation name="CreateScheduledWork">
<wsdl:input name="CreateScheduledWorkRequest" message="intf:CreateScheduledWorkRequest"/>
<wsdl:output name="CreateScheduledWorkResponse" message="intf:CreateScheduledWorkResponse"/>
<wsdl:fault name="CreateScheduledWorkFault" message="intf:CreateScheduledWorkFault"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ManageScheduledWorkScheduledWorkManagementBinding" type="intf:ManageScheduledWorkScheduledWorkManagement">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="CreateScheduledWork">
<wsdlsoap:operation soapAction="http://www.orange.com/MACHX/Interfaces/ManageScheduledWork/ScheduledWorkManagement/v1/CreateScheduledWork"/>
<wsdl:input name="CreateScheduledWorkRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="CreateScheduledWorkResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="CreateScheduledWorkFault">
<wsdlsoap:fault name="CreateScheduledWorkFault" use="literal"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
So for example, when I send a Response back (no errors occurred), I can use the CreateScheduledWorkResponse element, and fill it correctly; but when a FaultException occurs, I'm only able to send back a CreateScheduledWorkFaultMessage (and not a CreateScheduledWorkFault). And the client cannot handle this tag...
In other words, the CreateScheduledWorkFault type is not available in the code.
--> I suspect that there is something wrong when generating the code from the WSDL and XSD using svcutil, as I am not able to access the desired type in the code.
I use svcutil this way:
svcutil /useSerializerForFaults CSW.wsdl CSW.xsd CSW_Fault.xsd
Thanks for your help, and don't hesitate if you need more details.
Boris
My solution was to modify directly the type in the generated class... it's bad, but in my situation it was the only choice I had (normally I should never regenerate it as the WSDL will never change).
Now I have another issue, but it's more namespace related, so I will open a new question for that.

Invalid RESTful WSDL v2.0 from .Net 4.0 Framework

I created a couple of WCF services. One very robust one that can accept both SOAP and RESTful requests, and provide XML and JSON responses.
--EDIT: FYI: Enabling an SOAP endpoint to accept a RESTful request requires the use of [WebGet..., and as such, all input parameters must be of type string.
The other, a simple RESTful connector. The WSDL for the first service validates, however for the second, very simple RESTful connector - invalid.
I was using WSDL2Java to to complete the connection process, but fails, due to an invalid WSDL.
Am I mistaken in thinking that WSDL v2.0 is being generated?
Here is the WSDL from the service:
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions name="RESTService" targetNamespace="http://antennasoftware.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:tns="http://antennasoftware.com" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<wsdl:types>
<xsd:schema targetNamespace="http://antennasoftware.com/Imports">
<xsd:import schemaLocation="http://localhost/VRPCWebServices/RestService.svcxsd=xsd0" namespace="http://antennasoftware.com"/>
<xsd:import schemaLocation="http://localhost/VRPCWebServices/RestService.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="IRESTService_GetXMLData_InputMessage">
<wsdl:part name="parameters" element="tns:GetXMLData"/>
</wsdl:message>
<wsdl:message name="IRESTService_GetXMLData_OutputMessage">
<wsdl:part name="parameters" element="tns:GetXMLDataResponse"/>
</wsdl:message>
<wsdl:message name="IRESTService_GetJSONData_InputMessage">
<wsdl:part name="parameters" element="tns:GetJSONData"/>
</wsdl:message>
<wsdl:message name="IRESTService_GetJSONData_OutputMessage">
<wsdl:part name="parameters" element="tns:GetJSONDataResponse"/>
</wsdl:message>
<wsdl:portType name="IRESTService">
<wsdl:operation name="GetXMLData">
<wsdl:input wsaw:Action="http://antennasoftware.com/IRESTService/GetXMLData" message="tns:IRESTService_GetXMLData_InputMessage"/>
<wsdl:output wsaw:Action="http://antennasoftware.com/IRESTService/GetXMLDataResponse" message="tns:IRESTService_GetXMLData_OutputMessage"/>
</wsdl:operation>
<wsdl:operation name="GetJSONData">
<wsdl:input wsaw:Action="http://antennasoftware.com/IRESTService/GetJSONData" message="tns:IRESTService_GetJSONData_InputMessage"/>
<wsdl:output wsaw:Action="http://antennasoftware.com/IRESTService/GetJSONDataResponse" message="tns:IRESTService_GetJSONData_OutputMessage"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:service name="RESTService"/>
</wsdl:definitions>
.NET does not support WSDL v2. This is WSDL 1.0.
According to XMLSpy:
attribute 'element' in message part 'parameters' (message
'IRESTService_GetXMLData_InputMessage') refers to element
'tns:GetXMLData' which is not defined within the WSDL file!

Resources