Skip to Content
0

HTTP 500 response on SFDC WebService via SystemAccessor

Dec 21, 2016 at 12:30 PM

53

avatar image
Former Member

Hello all.

I have a new SFDC project, where I must make the Webservice call via Java Class using SystemAccessor.

When trying to make the call via "postman" I get HTTP 500 result along with XML payload explaining the fault:

However when running the interface via the Java Class, the SystemAccessor throws an exception and I cannot seem to be able to access the payload.

This is the code that I use to make the Webservice call:

Channel channel = LookupService.getChannel("Service_Name","Channel_Name");
SystemAccessor accessor = null;
accessor = LookupService.getSystemAccessor(channel);
InputStream in = new ByteArrayInputStream(PayloadXml.getBytes("UTF-8"));
Payload payload = LookupService.getXmlPayload(in);
Payload SOAPOutPayload = null;
SOAPOutPayload = accessor.call(payload);

Is there any way to extract the actuall SFDC faultstring as I need to use it for logging purposes?

Regards,

Imanuel Rahamim.

http-500.png (52.0 kB)
pi-http-500.png (33.8 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
avatar image
Former Member Dec 21, 2016 at 06:19 PM
0

Resolved!

As I use the "Do not use SOAP Envelope" for the SFDC SOAP receiver channel, it did not keep the SOAP FAULT payload.

Needed to add:

XMBWS.NoSOAPIgnoreStatusCode = true as instructed in:

https://archive.sap.com/discussions/thread/1675917

And now I get the fault message.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Dec 21, 2016 at 12:38 PM
0

Hi Imanuel,

I guess, you are using this JAVA mapping for SOAP Look up to get the session ID before final call to the SFDC WS.

Looks like, the problem is in the SOAP response message. Can you check once separately calling the WS from SOAPUI whether you are getting proper session ID or not.

Thanks,

Apu

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hello.

the problem is not with the error itself (I invoked it by intention by changing "Product2" which is a valid SFDC object to "Product111" which is not.

This is because I am checking error handling and logging of SFDC responses.

The problem is that I cannot see the XML of the fault response getting to me (it is coming back, as I can see it with postman / SOAP UI)

Please look in more detail into my original message to see what I ment.

0