Receive soap exception while calling SAP webservice(HTTPS) in BizTalk 2010 using WSBasicHTTPBinding

biztalkbiztalk-2010

I am calling a SAP webservice(HTTPS) in BizTalk 2010. I have generated schema using consume wcf service wizard. When I call the webservice by passing the requested schema instance, I receive following fault message:

<SOAP:Fault xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
      <faultcode>SOAP:Server</faultcode>
      <faultstring>Server Error</faultstring>
      <detail>
        <s:SystemError xmlns:s="http://sap.com/xi/WebService/xi2.0">
          <context>XIAdapter</context>
          <code>ADAPTER.JAVA_EXCEPTION</code>
          <text><![CDATA[ com.sap.aii.af.service.cpa.CPAException: com.sap.aii.af.service.cpa.impl.exception.CPALookupException: Couldn't retrieve inbound binding for the given P/S/A values: FP=;TP=;FS=null;TS=null;AN=null;ANS=null;    at com.sap.aii.af.service.cpa.impl.lookup.CommonLookup.checkForError(CommonLookup.java:53)  at com.sap.aii.af.service.cpa.InboundRuntimeLookup.getBinding(InboundRuntimeLookup.java:411)    at com.sap.aii.af.service.cpa.impl.lookup.AbstractLookupManager.getBinding(AbstractLookupManager.java:714)  at com.sap.aii.adapter.soap.web.MessageServlet.doPost(MessageServlet.java:427)  at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)     ….. ……
          ]]></text>
        </s:SystemError>
      </detail>
    </SOAP:Fault>

I have tried calling webservice using SOAPUI tool and I receive a proper response. I traced the request going out from BizTalk sendPort (calling webservice overHTTP-soap using wcfBasicHTTP binding) using fiddler, the request looks fine and works in SOAPUI. I have no clue about why I receive this particular soap fault in BizTalk.
Any help is appreciated
Thanks.

BizTalk Fiddler Dump (HTTP header order rearranged)

POST localhost:8888 HTTP/1.1 
Accept-Encoding: gzip, deflate 
Content-Type: text/xml; charset=utf-8 
SOAPAction: "sap.com/xi/WebService/soap1.1"; 
Content-Length: 2296 
Host: localhost:8888 
Expect: 100-continue 
Connection: Keep-Alive 

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<ns0:z xmlns:ns0="urn:sap-com:document:sap:rfc:functions"> 
........ 
</ns0:z>
</s:Body>
</s:Envelope>

SOAPUI Fiddler Dump

POST localhost:8888 HTTP/1.1 
Accept-Encoding: gzip,deflate 
Content-Type: text/xml;charset=UTF-8 
SOAPAction: "sap.com/xi/WebService/soap1.1"; 
Content-Length: 2417 
Host: localhost:8888 
Proxy-Connection: Keep-Alive 
User-Agent: Apache-HttpClient/4.1.1 (java 1.5) 

<SOAP-ENV:Envelope xmlns:SOAP-ENV="schemas.xmlsoap.org/soap/envelope/"; 
xmlns:ns0="urn:sap-com:document:sap:rfc:functions">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<ns0:z xmlns:ns0="urn:sap-com:document:sap:rfc:functions">
 ....
</ns0:z>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Best Answer

I can't see anything glaringly obvious, possibly other than the shoutcase of utf-8 in the charset Content Type header.

And I've assumed the soap body payloads (........) are identical - you might check whether the Soap Action is specified in the message as well as the header - I'm not sure if SAP web service is SOAP 1.1 or 1.2 WCF Soap Actions in HTTP header or SOAP header?

One possible thing to try is to use the XmlTransmit send pipeline on your send port and experiment with Preserve BOM (i.e. Add / Remove the UTF BOM on the payload) and also try the target charset set to shoutcase UTF-8.

As a last resort, instead of using WebServices, try the Consume Adapter Service for SAP - see here and here

Related Topic