Version 9 of SOAP Complex Data

Updated 2006-03-09 02:42:10

snichols I'm working on a Tcl client to integrate to a web service. I have an example of how the SOAP envelope should look. It is using two complex data types (WebUser and Authentication). I'd prefer to use Tcl SOAP then have to code the XML using tDOM and HTTP, which I will do if necessary. Here's my Tcl code that generates a SOAP request envelope that's close to the working SOAP envelope, but not good enough for the web service (there are some extra XML attributes, etc that are needed):

 package require SOAP
 package require rpcvar
 namespace import -force rpcvar::typedef

 typedef {
        Username DATA
        Password DATA
        Nonce DATA
        Created DATA
        RemoteUser DATA
        RemoteClient DATA
        RemoteAddress DATA
        EnvironmentalData DATA
        SessionID DATA
 } authentication

 typedef {
   Authentication  authentication
   ApplicationType DATA
   RequestID DATA
   WebUserID DATA
   WebUserName DATA
   PlanID DATA
   EmployerID DATA
   MemberID DATA
   EntityType MEMBER
   EntityReferenceNumber DATA
   Password DATA
   EncryptionMethod PLAINTEXT
   InputMethodEditor TELEPHONE
 } webUser

 SOAP::create Test -proxy "http://localhost/superSOAP/webcontrol.asmx" \
                        -action "http://www.atune.biz/web/services/WC/2006-01/isWebUserAuthenticated" \
                        -uri "http://www.atune.biz/web/services/WC/2006-01" \
                        -params {WebUser webUser}

When the soap method, isWebUserAuthenticated, is called it generates this as the SOAP request :

 <?xml version="1.0"?>
 <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-   ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">
        <SOAP-ENV:Body>
                <ns:isWebUserAuthenticated xmlns:ns="http://www.atune.biz/web/services/WC/2006-01">
                        <WebUser>
                                <Authentication>
                                        <Username>IVRUSER</Username>
                                        <Password>newPassword</Password>
                                        <Nonce></Nonce>
                                        <Created></Created>
                                        <RemoteUser>TESTER</RemoteUser>
                                        <RemoteClient>SomeCompany</RemoteClient>
                                        <RemoteAddress>127.0.0.1</RemoteAddress>
                                        <EnvironmentalData></EnvironmentalData>
                                        <SessionID></SessionID>
                                </Authentication>
                                <ApplicationType>MOL</ApplicationType>
                                <RequestID></RequestID>
                                <WebUserID></WebUserID>
                                <WebUserName>11111</WebUserName>
                                <PlanID>RS</PlanID>
                                <EmployerID>-1</EmployerID>
                                <MemberID>-1</MemberID>
                                <EntityType>MEMBER</EntityType>
                                <EntityReferenceNumber>0</EntityReferenceNumber>
                                <Password>5555</Password>
                                <EncryptionMethod>PLAINTEXT</EncryptionMethod>
                                <InputMethodEditor>TELEPHONE</InputMethodEditor>
                        </WebUser>
                </ns:isWebUserAuthenticated>
        </SOAP-ENV:Body>
 </SOAP-ENV:Envelope>

Its very close, but I need the SOAP above envelope to look like this working version (both are very close):

        <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <soap:Body>
      <isWebUserAuthenticated xmlns="http://www.atune.biz/web/services/WC/2006-01">

      <WebUser>
        <Authentication Enabled="1">
          <Username>IVRUSER</Username>
          <Password Type="PLAINTEXT" Token="*NONE*">newPassword</Password>
          <Nonce></Nonce>
          <Created>20060309T080101</Created>
          <RemoteUser>TESTER</RemoteUser>
          <RemoteClient>SomeCompany</RemoteClient>
          <RemoteAddress>127.0.0.1</RemoteAddress>
          <EnvironmentData></EnvironmentData>
          <SessionID></SessionID>
        </Authentication>
        <ApplicationType>MOL</ApplicationType>
        <RequestID></RequestID>
        <WebUserID></WebUserID>
        <WebUserName>157014233</WebUserName>
        <PlanID>RS</PlanID>
        <EmployerID>-1</EmployerID>
        <MemberID>-1</MemberID>
        <EntityType>MEMBER</EntityType>
        <EntityReferenceNumber>0</EntityReferenceNumber>
        <Password>5555</Password>
        <EncryptionMethod>PLAINTEXT</EncryptionMethod>
       <InputMethodEditor>TELEPHONE</InputMethodEditor>
      </WebUser>

          </isWebUserAuthenticated>
   </soap:Body>
 </soap:Envelope>

Any ideas what I need to change in my TclSOAP command calls to make the SOAP envelope look like the latter XML above? Its currently generating the first XML. I notice a couple of things different: The latter has an Enabled="1" attribute and the password tag has some more attributes too, and its not using the /ns: namespace like the first. The latter envelop works and returns a result the first request returns errors. The other thing thats differnt is the second version is using simpler looking tags like soap:Evelope and soap:Body. So, how do I add the XML attributes needed by the webservice, etc?

Thanks in advance. snichols.