Re: [SOAP] RE: element handling in schema

From: Date: Sun, 27 Mar 2005 14:58:38 +0000
Subject: Re: [SOAP] RE: element handling in schema
References: 1  Groups: php.soap 
Request: Send a blank email to php-soap+get-1784@lists.php.net to get a copy of this message
On Mar 21, 2005, at 2:16 AM, Dmitry Stogov wrote:
Hi George, I just removed all unnecessary SoapVar and got <ns1:MessageHeader version="2.0">. (I got it without your patch. I will look into it and one very similar path right now).
Hi, Running with HEAD and your soap1.php (which drops the 'unnecessary' SoapVar's), this is what I get as my request XML: <?xml version="1.0" encoding="UTF-8"?> <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://www.opentravel.org/OTA/2002/11" xmlns:ns2="http://www.ebxml.org/namespaces/messageHeader" xmlns:ns3="http://schemas.xmlsoap.org/ws/2002/12/secext"> <env:Header>
    <ns2:MessageHeader>
      <From>
        <ns2:PartyId>omniti.com</ns2:PartyId>
      </From>
      <To>
        <ns2:PartyId>webservices.sabre.com</ns2:PartyId>
      </To>
      <CPAId>IPCC</CPAId>
      <ConversationId>abc123@omniti.com</ConversationId>
      <Service>Session</Service>
      <Action>SessionCreateRQ</Action>
      <version>2.0</version>
      <MessageData>
        <MessageId>mid:123456@omnti.com</MessageId>
        <Timestamp>2005-03-18T05:15:00Z</Timestamp>
      </MessageData>
    </ns2:MessageHeader>
    <ns3:Security>
      <UsernameToken>
        <Username>USERNAME</Username>
        <Password>PASSWORD</Password>
        <Organization>IPCC</Organization>
        <Domain>Default</Domain>
      </UsernameToken>
    </ns3:Security>
</env:Header> <env:Body>
    <ns1:SessionCreateRQ>
      <ns1:POS>
        <ns1:Source PseudoCityCode="21797"/>
      </ns1:POS>
    </ns1:SessionCreateRQ>
</env:Body> </env:Envelope> There are a couple problems with this: 1) version doesn't go into ns2:MessageHeader as an attribute, it goes in as a child node. 2) Only the top level nodes are encoded with the correct namespace. Consider:
    <ns2:MessageHeader>
      <From>
        <ns2:PartyId>omniti.com</ns2:PartyId>
      </From>
      <To>
        <ns2:PartyId>webservices.sabre.com</ns2:PartyId>
      </To>
      <CPAId>IPCC</CPAId>
      <ConversationId>abc123@omniti.com</ConversationId>
      <Service>Session</Service>
      <Action>SessionCreateRQ</Action>
      <version>2.0</version>
      <MessageData>
        <MessageId>mid:123456@omnti.com</MessageId>
        <Timestamp>2005-03-18T05:15:00Z</Timestamp>
      </MessageData>
    </ns2:MessageHeader>
All of these guys should be in the ns2 namespace. That is why I had added the SoapVars originally.
Thanks. Dmitry.
-----Original Message----- From: George Schlossnagle [mailto:george@omniti.com] Sent: Sunday, March 20, 2005 17:56 To: Dmitry Stogov Cc: George Schlossnagle; soap@lists.php.net Subject: Re: element handling in schema On Mar 20, 2005, at 2:51 AM, Dmitry Stogov wrote:
<atribute> and <attributeGroup> are supported add should be handled correctly. The may not be handled correctly because you
pass data in
wrong structure. Of course ext/soap may have a bug.
I see the stubs for handling them, but I can't make it actually work. Would you mind seeing if it's something crazy I'm doing here: http://sanni.omniti.com/soap-attr.phps Specifically where version is serialized from MessageHeader. Tinkering around with it, I couldn't find any means to get it to serialize as an attribute (which is what the referenced wsdl specifies). It always serializes as a node. Thanks, and I'll actually be quite thrilled if it's just me who can't make this work. Otherwise I'm happy to work on patching it, as I need it kinda quickly. Best Regards, George
<soap1.php>-- PHP Soap Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php George Schlossnagle
-- Prinicipal Consultant -- OmniTI Computer Consulting -- http://www.omniti.com

« previous php.soap (#1784) next »