4

I have generated an Apex class from my WSDL successfully and was able to authenticate on the remote server by setting the HTTP Authorization header manually. I have double checked on the remote server that…

  • the HTTP authentication works corrently
  • the webservice returns the correct response XML
  • no errors are thrown (no try/catch statements in the entire code)

However, if I inspect the result of the webservice call, I always get a "null" object back. I suspect that Salesforce is not able to generate an Object from the XML response. Any ideas on why that could be and what i could try? Did someone already have the same problem?

This is how i do the call:

String user = 'username';
String pass = 'secret';

MyService.InfoSoap soapClient = new MyService.InfoSoap();
Blob raw = Blob.valueOf( user + ':' + pass );
String token = EncodingUtil.base64Encode( raw );
soapClient.inputHttpHeaders_x = new Map<String, String>{
    'Authorization' => 'Basic ' + token
};

Integer externalId = 1234;
System.debug(
    soapClient.getObject(externalId)
);

// prints "null" to the debug log

2 Answers 2

2

One way to verify these silent failures is to try the parsing of WSDL in developer edition org and making the callout.Silent failures are captured in developer edition than trying out the same in sandbox environment

1
  • Thanks for the suggestion! Good idea, but didn't actually yield different results. Commented May 16, 2013 at 11:02
2

We managed to fix the problem today, by adding a namespace to every single XML element in the response.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .