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
JoeK.ax278JoeK.ax278 

Namespace problems with outbound SOAP message

Salesforce is generating the following outbound SOAP message to a legacy web service.

Salesforce leaves the <getAccountInformationRequest> element in the http://purolator/channelintegration/accountservice/ Namespace, but the legacy service expects this element to be in the http://purolator/channelintegration/business.entities namespace.

<?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>
<GetAccountInformation xmlns="http://purolator/channelintegration/accountservice/">
<getAccountInformationRequest>
<AccountNumber xmlns="http://purolator/channelintegration/business.entities">4381</AccountNumber>
<AccountDetailsRequiredIndicator xmlns="http://purolator/channelintegration/business.entities">Y</AccountDetailsRequiredIndicator>
<ChannelIntegrationRequestInformation xmlns="http://purolator/channelintegration/business.entities">
<RequestVersion>1.0.0.30</RequestVersion>
<RequestLanguage>En</RequestLanguage>
<TransactionGroupID>?</TransactionGroupID>
</ChannelIntegrationRequestInformation>
</getAccountInformationRequest>
</GetAccountInformation>
</env:Body>
</env:Envelope>

 

Here's the relevant snippet of the WSDL from which the Apex classes were generated:

 

...
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://purolator/channelintegration/accountservice/">
<s:import namespace="http://purolator/channelintegration/business.entities" />
<s:element name="GetAccountInformation">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" ref="s1:getAccountInformationRequest" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetAccountInformationResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" ref="s1:GetAccountInformationResult" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
<s:schema elementFormDefault="qualified" targetNamespace="http://purolator/channelintegration/business.entities">
<s:element name="getAccountInformationRequest" nillable="true" type="s1:GetAccountInformationRequest" />
<s:complexType name="GetAccountInformationRequest">
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="AccountNumber" nillable="true" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="AccountDetailsRequiredIndicator" nillable="true" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="ChannelIntegrationRequestInformation" nillable="true" type="s1:RequestInformation" />
</s:sequence>
</s:complexType>
<s:complexType name="RequestInformation">
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="RequestVersion" nillable="true" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="RequestLanguage" nillable="true" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="TransactionGroupID" type="s:string" />
</s:sequence>
</s:complexType>
<s:element name="GetAccountInformationResult" nillable="true" type="s1:GetAccountInformationResponse" />
<s:complexType name="GetAccountInformationResponse">
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="Account" nillable="true" type="s1:Account" />
<s:element minOccurs="1" maxOccurs="1" name="ChannelIntegrationResponseInformation" nillable="true" type="s1:ResponseInformation" />
</s:sequence>
</s:complexType>
...

 

The reading I've done so far seems to point toward this: elements ref'ing an imported namespace should themselves be in the imported namespace not the importing namespace -- which would agree with the legacy service.  I've not yet been able to confirm this myself in the w3c schema spec.

See, for example, this explanation from the folks at sun: http://developers.sun.com/jsenterprise/archive/nb_enterprise_pack/reference/techart/namespaces2.html

Is this a result of an ambiguity in the spec, or perhaps a salesforce bug?

Does anyone have a way to modify the generated classes or to hack the wsdl to move the <getAccountInformationRequest> to the required namespace?

 

Thank You! -- JoeK