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
ckempckemp 

Web service multiple namespace issue

Hello,

I have a very tricky problem with a web service call I'm doing to an external server.  When I generate the WSDL and do a callout, I get this SOAP request that I trap in the System Log with the debug level set to "Callout":

Code:
<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>
  <doUserPointTransactions xmlns="http://webservice.razorpoints.ilr.com">
   <adminUsername>my.name@domain.com</adminUsername>
   <adminPassword>mypassword</adminPassword>
   <wsPointUploads>
    <WsPointUpload>
     <amount>111</amount>
     <description>aaaaaaaaaaaaa</description>
     <programAccountPK>1</programAccountPK>
     <userPK>bbb</userPK>
    </WsPointUpload>
   </wsPointUploads>
  </doUserPointTransactions>
 </env:Body>
</env:Envelope>

However, this returns a SoapFault because the receiving side says that WsPointUpload is empty, which it clearly is not.  When I generate the same web service call in Eclipse with the same WSDL, I get this:

Code:
<soapenv:Envelope xmlns:q0="http://webservice.razorpoints.ilr.com" 
 xmlns:q1="http://webservice.model.razorpoints.ilr.com"
 xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Header></soapenv:Header>
 <soapenv:Body>
  <q0:doUserPointTransactions>
   <q0:adminUsername>my.name@domain.com</q0:adminUsername>
   <q0:adminPassword>mypassword</q0:adminPassword>
   <q0:wsPointUploads>
    <q1:WsPointUpload>
     <q1:amount>111</q1:amount>
     <q1:description>aaaaaaaaaaaaa</q1:description>
     <q1:programAccountPK>1</q1:programAccountPK>
     <q1:userPK>bbb</q1:userPK>
    </q1:WsPointUpload>
   </q0:wsPointUploads>
  </q0:doUserPointTransactions>
 </soapenv:Body>
</soapenv:Envelope>

Note that in this request, there are two namespaces, http://webservice.razorpoints.ilr.com and http://webservice.model.razorpoints.ilr.com.  In the first WS call (the one generated by Salesforce) there is only one namespace, http://webservice.razorpoints.ilr.com, and the WsPointUpload element is not part of this namespace.

If I make a SOAP request in Eclipse using the Salesforce request (the first one above) and manually add 'xmlns="http://webservice.model.razorpoints.ilr.com"' to the <WsPointUpload> element, the web service call works.  Is there any way I can force this second namespace to appear in Salesforce or is this just a Saleforce bug?


Message Edited by ckemp on 05-16-2008 10:14 AM
cheenathcheenath
This is a known bug and it is fixed in the latest release.

DemintDemint

Hi Cheenath

 

I am hitting what I suspect is the same issue to this - I have posted here:

 

http://community.salesforce.com/sforce/board/message?board.id=apex&message.id=23817&jump=true

 

No-one has answered my post so I wondered if you would be prepared to have a look for me?

 

Many thanks

 

Demi

vngpraveenvngpraveen

I am having the same issue with callout.  In fact, multiple namespaces are working for me, but it looks to me that callout feature is expecting second element to be in same name space as highest level element.  In my wsdl, I have three namespaces in total, say namespace1, namespace2, and namespace3.  The following will be valid soap message for the service I am calling.

 

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

<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>

        <Request xmlns="namespace1">

            <RequestElement1 xmlns="namespace2>

                   <Data1>Data1</Data1>

                   <Data2>Data2</Data2>

            </RequestElement1>

         </Request>        

                 </env:Body>

</env:Envelope> 

 

But Sales force generates the following xml:

 

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

<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>

        <Request xmlns="namespace1">

            <RequestElement1>

                   <Data1  xmlns="namespace2">Data1</Data1>

                   <Data2  xmlns="namespace2">Data2</Data2>

            </RequestElement1>

         </Request>        

                 </env:Body>

</env:Envelope> 

 

 

My WSDL is valid and I am able make calls from any other system.   If anyone can post a solution to this, it will be great help. 

DemintDemint

Hi Praveen,

 

For info I never had any responses and also raised a case with Salesforce which did not resolve in time so in the end I approached the calout using HTTP Request.  This is fairly straightforward and well documented.

 

If you or anyone else finds a solution in the meantime I'd still be interested to find out what the workaround is. 

 

Demi

dknoerndknoern

Hi-

 

Did you ever get an answer to this?  This issue is causing me a lot of trouble and it seems SFDC should be able to handle multiple namespaces!

JOHN FERGUSONJOHN FERGUSON
I have the same issue repeating namespaces when it shouldn't need to because they are inherited, also they should be declared as prefixes. This is cause the SOAP payload to be considerably larger then necessary.