2

I am testing an integration between Salesforce and another system via Web Service Collouts. For that, I am using WSDL->APEX generated class. When invoke the web service via anonymous apex, I get a vague exception:

 System.CalloutException: Web service callout failed: Failed to deserialize value '', due to:For input string: ""

I can't really wrap my head around it. The other system is a black box I do not have an access to, so I cannot look at the matter from the other side. Is anybody familiar with the exception? What is the likely cause?

5

It would help to see the proxy generated by WSDL->Apex, the response from the WS, or just the schema.

From the error message, you get a response from the WS, but de-serialization fails.

First, you could call the WS from SOAP UI to get a proper image of what you are getting back.

Second, check if you have any numeric properties in the Proxy. Apparently, the deserializer does not map empty strings to 0. To test this, just change the type from Integer/Decimal to String in the generated proxy, and see if you still get the error.

  • 1
    Right you are sir! Numeric (long) nilable from the XML was the cause of the issue. I wonder why, though, because Salesforce never treats primitives as real primitives (java style) and allows for integer = null in APEX. Thank you very much. – Tomáš Kolín Nov 26 '14 at 10:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.