logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: Re: Problem after vendor upgrade to use Document Literal Type: msg#00036

Subject: Re: Re: Problem after vendor upgrade to use Document Literal Type
The actual root of the problem is the way NuSOAP handles

   <message name="authenticateWithMAC_response">
      <part name="parameters" element="tns:authenticateWithMAC_response" />
   </message>

The <part> can specify either an element attribute, as above, or a type 
attribute.  NuSOAP's issue is that is does not distinguish between whether the 
element or type was specified: it just stores the value of either attribute.  
It then looks up that value, first checking whether there is a type of that 
name, then checking whether there is an element of that name.  Everything works 
fine if either (a) there is no case where a type and an element have the same 
name, or (b) where there is a type and element of the same name, the <part> 
uses a type attribute.  The WSDL you are using hits the case where things don't 
work: there is a type and element of the same name, but the <part> specifies 
the element.  The NuSOAP logic picks up the type instead of the element, which 
creates the error.  The fix is for NuSOAP to keep track of whether it was 
element or type, but unfortunately that is an hour or more of work, and I do 
not have that much time available until next week, because of a deadline I am 
killing myself on.

Scott Nichol

Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.
----- Original Message ----- 
From: "Blaine Lang" <blaine@xxxxxxxxxxxxx>
To: <nusoap-general@xxxxxxxxxxxxxxxxxxxxx>
Sent: Friday, November 12, 2004 3:17 PM
Subject: Re: [Nusoap-general] Re: Problem after vendor upgrade to use Document 
Literal Type


> Scott,
> 
> I've been digging into the code and have managed to make some headway. I 
> don't have all the WSDL lingo down and this explaination is more for me and 
> others then it is to help you in how you want to address it. My hacks are 
> just that and I really could you use your review and preferred resolution.
> 
>  The first issue (difference between a working WebService Doc/Literal 
> exchange and the with NuSoap)  was: that it was picking up the word 
> "parameters" as the outer message definition node.
> 
> Original Message Format being sent
> <SOAP-ENV:Body>
>     <parameters>
>       <phoneNumber>4162349091</phoneNumber>
>       <phonePassword>1234</phonePassword>
>       <partitionName></partitionName>
>       <remoteHost></remoteHost>
>    </parameters>
>  </SOAP-ENV:Body>
> 
> After:
> <SOAP-ENV:Body>
>    <authenticate xmlns="http://www.vocaldata.com/Utilities";>
>          <phoneNumber>4162389091</phoneNumber>
>          <phonePassword>1234</phonePassword>
>         <partitionName></partitionName>
>        <remoteHost></remoteHost>
>     </authenticate>
> </SOAP-ENV:Body>
> 
> The Doc/Lit format WSDL is very different as you know it now like below with 
> the element referenced defined in the <type> portion of the WSDL
>    <message name="authenticateWithMAC_response">
>       <part name="parameters" element="tns:authenticateWithMAC_response" />
>    </message>
> 
> Where before in the RPC/encoding the part name and type were defined in the 
> message block.
> 
> NuSoap changes I made and am still testing but are allowing me to proceed to 
> test more complex API's.
> 1: In serializeType() approx line 4125
>     I added a check for type == complexType as that was just the type that 
> matched what I saw but may not be correct
>     I then set the outer XML tags to use the element name and the namespace
> 
>             if ($use == 'literal') {
>                 if ($forceType) {
>                     $xml = "<$elementName$elementNS xsi:type=\"" . 
> $this->getPrefixFromNamespace($ns) . ":$uqType\">";
>                 } else {
>                     $this->debug("BL: serializeRPCParmeters: typeDef Class 
> is {$typeDef['typeClass']}");
>                     if (isset($typeDef['typeClass']) && 
> $typeDef['typeClass'] == 'complexType') {
>                         $xml = "<{$typeDef['name']} xmlns=\"$ns\">";
>                     } else {
>                         $xml = "<$elementName$elementNS>";
>                     }
>                 }
>             } else {
>                 $xml = "<$elementName$elementNS xsi:type=\"" . 
> $this->getPrefixFromNamespace($ns) . ":$uqType\"$encodingStyle>";
>             }
> 
> 2: I have to also set the ending XML tag correctly so approx line 4190
>             $xml .= "</{$typeDef['name']}>";
>    instead of:
>             $xml .= "</$elementName>";
> 
> 3: I found I need to now setup the webservice call different and pass an 
> array of array where array['parameters'] will then match the part 
> name="paramaters" in the WSDL Message block
> 
> $parms = array (
>     'user'        => $authOID
> );
> $username = $soapclient->call("getUserName",array('parameters' => $parms));
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Sybase ASE Linux Express Edition - download now for FREE
> LinuxWorld Reader's Choice Award Winner for best database on Linux.
> http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
> _______________________________________________
> Nusoap-general mailing list
> Nusoap-general@xxxxxxxxxxxxxxxxxxxxx
> https://lists.sourceforge.net/lists/listinfo/nusoap-general
>


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_idU88&alloc_id065&op=click


<Prev in Thread] Current Thread [Next in Thread>