function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
CodeFinderCodeFinder 

Custom Webservice callout

I have a WSDL which has 4 namespaces in it. I am trying to pass a custom object as a input parameter to the method which performs the WebServiceCallout.invoke() method. The webservice callout is done in a different namespace and the element is in a different namespace.

 

I am getting a XML output which does not have the namespace. As there is no namespace for the custom object the external system is giving a Null Pointer exception. We contacted saleforce. The issue got escalated to tire 3 and they informed that we are using "ref" and currently salesforce do not support element ref outside of the same target namespace.

 

The solution they gave me is For now,

 

"To avoid this error you will have to remove these types of references from the WSDL, or modify the Apex Classes to fix this."

 

We cannot change the wsdl as other systems are already suing the WSDL. I do not know what changes can we do to the apex classes so that it does not consider "ref"

 

So has anyone tried to custom build the WebServiceCallout.invoke(). Method? Can anyone tell me what is done in the method? I mean how the data is binded and sent through the endpoint.

 

Thanks in advance and Please let me know if you need any further information.