+ Start a Discussion
dhana9dhana9 

Issue with SOAP namespace

Hi,

 

I was trying to do integration from Salesforce with other system. The way the Salesforce generates the SOAP message is as follows:

 

<?xml version="1.0" encoding="UTF-8"?>

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<env:Header />

<env:Body>

<processRequest xmlns="java:credit.sfa.beans">

</processRequest>

</env:Body>

</env:Envelope>

 

Whereas the Other System that I'm integration is expecting SOAP message like as follows:

 

<?xml version="1.0" encoding="UTF-8"?>

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<env:Header />

<env:Body>

<cdt:processRequest>

</cdt:processRequest>

</env:Body>

</env:Envelope>

 

And i'm getting SOAP Fault from the other System Saying (unexpected element processRequest).

I'm not sure whether i can control the SOAP message from Salesforce (to change the SOAP message dynamically) nor I should change the WSDL so that it works in both Salesforce and the other System.

 

Please suggest me.

 

Note: I'm using APEX callout (Synchronous).

 

 

 

Suresh_SoftsquareSuresh_Softsquare

I'm having this same issue. Did you figure out a workaround for this?

 

Thanks,

Suresh.

forecast_is_cloudyforecast_is_cloudy

The SOAP message format that the external system seems to expect is invalid XML. The 'cdt' prefix is never declared anywhere in the payload and that makes it invalid XML. Not sure how you can generate invalid XML if you're using the WSDL2Apex functionality (which will always generate valid XML - as it should). Maybe you can create the XML payload as a String and use the HTTPRequest class intead of using the WSDL2Apex generated classes? Its a big hack, but unless you can fix the external system to expect the correct XML format, not sure if you have another option.