cancel
Showing results for 
Search instead for 
Did you mean: 

SAP to Salesforce SOAP fault

Former Member
0 Kudos

Hi Experts,

I am building a PoC for SAP to Salesforce (Proxy to SOAP) scenario.

I have referred the case study/ blog by Unnamalai Arunachalam and Prasanna Vittal for the development. I am getting a strange error back from SF, see below.

<sf:UnexpectedErrorFault xsi:type="sf:UnexpectedErrorFault" xmlns:sf="urn:fault.enterprise.soap.sforce.com" xmlns:xsi="xsi">

   <sf:exceptionCode>UNKNOWN_EXCEPTION</sf:exceptionCode>

   <sf:exceptionMessage>Failed to read POST: POST requires content-length</sf:exceptionMessage>

</sf:UnexpectedErrorFault>

This looks like an error coming directly from SF because of the namespace prefix 'sf'. That means, it cannot be an issue with proxy settings. It also means that the message is able to reach SF host.

If I use my login request to test on SOAP UI, it works perfectly fine.

I am aware that the communication with SF requires a sessionId and have used a Java Mapping to do a SOAP Lookup.

I tried to simplify by creating another scenario just to get the SessionId. Even then I get this same error.


Any ideas?

Regards,

Sudheer

Accepted Solutions (0)

Answers (2)

Answers (2)

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

<sf:UnexpectedErrorFault xsi:type="sf:UnexpectedErrorFault" xmlns:sf="urn:fault.enterprise.soap.sforce.com" xmlns:xsi="xsi">

   <sf:exceptionCode>UNKNOWN_EXCEPTION</sf:exceptionCode>

   <sf:exceptionMessage>Failed to read POST: POST requires content-length</sf:exceptionMessage>

</sf:UnexpectedErrorFault>

It looks like the content-length is not present in the HTTP Header (which is required by the webservice) of your POST method. The MessageTransformBean won't help here so you have to use a UDF to connect to the URL directly.

Hope this helps,

Mark

Former Member
0 Kudos

Hi Mark,

Thanks for your response.

I wrote the UDF to set the server URL. Now I am getting a different error:

Message processing failed. Cause: com.sap.aii.af.ra.ms.api.MessagingException: SOAP: response message contains an error XIAdapter/PARSING/ADAPTER.SOAP_EXCEPTION - soap fault: SOAPAction HTTP header missing

Is it necessary to given any SOAP Action? I tried giving 'login' as the SOAP Action but it gave a 500 Internal Server Error. So I reverted back.

Thanks & Regards,

Sudheer

markangelo_dihiansan
Active Contributor
0 Kudos

Hello Sudheer,

You can use the SOAP Action that you see in a successful SOAP UI execution.

Regards,

Mark

smavachee
Active Contributor
0 Kudos

Don't think any configuration issue, seems that SF server is not able to decode the request.

I believe this is synchronous scenario. Can you import the latest WSDL once again. Structure you have imported into ESR should match with the structure hosted on SF.

Regards,

Sunil

Former Member
0 Kudos

Hi Sunil,

Thanks for the quick response.

If I pick up the request message which is going out the SOAP receiver adapter and test using SOAP UI, it is giving the session id without any errors. Further, I am able to use this session id to do other SF queries successfully.

In that case do you think it could be a problem of structure mismatch?

Thanks & Regards,

Sudheer

smavachee
Active Contributor
0 Kudos

I agreed, still importing the latest WSDL is not a complicated activity. Try it once as error is not giving any specific clue.

Regards,

Sunil

Former Member
0 Kudos

Hi Sudheer,

Did you resolve this error. I am getting the same error

Thanks

Nikhil