First experience with SOAP action.

Hi,

I am working on a link between 2 financial systems. I now have to send to from system A to system B with a SOAP call.
I made a sample xml and tested it with SOAP UI and it works fine:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Afas.Profit.Services">
   <soapenv:Header/>
   <soapenv:Body>
    <ns0:Execute xmlns:ns0="urn:Afas.Profit.Services">
	<ns0:environmentId>Environment_B</ns0:environmentId>
	<ns0:userId>ConnectorUsers</ns0:userId>
	<ns0:password>TEST</ns0:password>
	<ns0:connectorType>KnSubject</ns0:connectorType>
	<ns0:connectorVersion>1</ns0:connectorVersion>
	<ns0:dataXml>
	<![CDATA[<KnSubject><Element SbId="3"><Fields Action="insert"><StId>36</StId><Ds>Check</Ds><SbTx>Requestdate: 2015-01-29T00:00:00 Result: true  Consultatienummer: 123</SbTx></Fields><Objects><KnSubjectLink><Element SbId="3"><Fields Action="insert"><ToBC>true</ToBC><BcId>001859</BcId></Fields></Element></KnSubjectLink></Objects></Element></KnSubject>]]></ns0:dataXml>
    </ns0:Execute>
   </soapenv:Body>
</soapenv:Envelope>

But I cant get it to work with BizTalk. I keep receiving the following error:

System.ServiceModel.FaultException: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>Server did not recognize the value of HTTP Header SOAPAction: &lt;BtsActionMapping xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
  &lt;Operation Name="Execute" Action="urn:Afas.Profit.Services/Execute" /&gt;
&lt;/BtsActionMapping&gt;.</faultstring><detail /></soap:Fault></soap:Body></soap:Envelope>
   at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.RequestCallback(IAsyncResult result)

The SOAP action header is imported from the imported binding and looks like:

<BtsActionMapping xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Operation Name="Execute" Action="urn:Afas.Profit.Services/Execute" />
</BtsActionMapping>
What can I do to make this work?

February 3rd, 2015 2:49pm

Hi,

Use WCF-BasicHttp adapter instead of soap

Check in the transport property of the adapter that you have provided the soap action in the SOAP action header section of configuration.

Check if the Execute Operation name matches with your orchestration action name (if you are using ocrh to call service)

Thanks...

I hope this helps.


Free Windows Admin Tool Kit Click here and download it now
February 3rd, 2015 3:24pm

Hi Ronald

try using the action as

"urn:Afas.Profit.Services/Execute"

instead of

<BtsActionMapping xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 
<Operation Name="Execute" Action="urn:Afas.Profit.Services/Execute" />
</BtsActionMapping>

on your send port

February 3rd, 2015 3:26pm

Hi Ronald,

This exact issue happens when you have created a new orchestration not the one which was created as part of the consume WCF service wizard. Because in the orchestration created by the WCF wizards, it also creates the web port which would assign the value for BTS.Operation context property which in your case would have been Execute, This value would have mapped to <Operation Name="Execute" Action="urn:Afas.Profit.Services/Execute" /> property in the send port.

In your case, just try the following value in the SOAP Action header property in the send port configuration.

urn:Afas.Profit.Services/Execute


This is called Single Action Format, where you dont need mapping of BTS.Operation to its corresponding value. For more info, read my blog which details about this process.

http://www.fortuvis.com/blog/biztalk-and-wcf-soap-action/

Regards,

M.R.Ashwin Prabhu


Free Windows Admin Tool Kit Click here and download it now
February 3rd, 2015 6:59pm

Use fiddler to catch the payload. Compare the payload with SOAP UI xml payload. 
February 3rd, 2015 8:34pm

I found out that the error was in the orchestration operation. It was renamed to Operation_1 instead of Execute. When i changed this everything worked like it should.
  • Proposed as answer by Rachit Sikroria Thursday, February 05, 2015 9:22 AM
Free Windows Admin Tool Kit Click here and download it now
February 5th, 2015 12:01pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics