Loading ...
Sorry, an error occurred while loading the content.

RE: [soapbuilders] Interoperability lab

Expand Messages
  • Paul Kulchenko
    Hi, Tony! ... Yes, that s true. You may specify (with maptype() method) mappings between types and namespaces. Introduced basically for Apache interoperability
    Message 1 of 18 , Feb 2, 2001
    • 0 Attachment
      Hi, Tony!

      > One thing to note: in versions prior to 0.46, the namespace of the
      > generated
      > structure is the same as the method namespace URI (in this case,
      > urn:xmethodsInterop) . I believe in 0.46, this is now configurable.
      Yes, that's true. You may specify (with maptype() method) mappings
      between types and namespaces. Introduced basically for Apache
      interoperability :)).

      Best wishes, Paul.

      --- Tony Hong <thong@...> wrote:
      > Simon, here's a snippet of SOAP::Lite that calls the echoStruct
      > service.
      > Paul, please don't beat me up if the Perl isn't pretty! :-)
      >
      >
      ----------------------------------------------------------------------------
      > -----------------
      >
      > #!/usr/bin/perl
      >
      > use SOAP::Lite;
      >
      > SOAP::Data->import('name');
      >
      > my %hash = (
      > varInt => 5,
      > varString => "test string",
      > varFloat => 6.2
      > );
      >
      > $h=SOAP::Lite
      > -> uri ('urn:xmethodsInterop')
      > ->
      > proxy('http://services.xmethods.com:80/soap/servlet/rpcrouter')
      > -> echoStruct(name("testStruct" => \%hash))
      > ;
      >
      > if($h->faultcode)
      > {print "FAULT CODE --------------------\n";
      > print $h->faultcode. "\n\n";
      > print "FAULT DETAIL--------------------\n";
      > print $h->faultstring. "\n";
      > }
      > else
      > {
      > print "RESULT --------------------\n";
      > foreach $k (keys %{$h->result})
      > {
      > print $k."\t".$h->result->{$k}."\n";
      > }
      > }
      >
      >
      ------------------------------------------------------------------------
      >
      > It generates the following envelope:
      >
      > POST /soap/servlet/rpcrouter HTTP/1.0
      > Host: tony:8080
      > User-Agent: SOAP::Lite/Perl/0.45
      > Content-Length: 662
      > Content-Type: text/xml
      > SOAPAction: "urn:xmethodsInterop#echoStruct"
      >
      > <?xml version="1.0" encoding="UTF-8"?>
      > <SOAP-ENV:Envelope
      > xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      > xmlns:xsd="http://www.w3.org/1999/XMLSchema">
      > <SOAP-ENV:Body>
      > <namesp1:echoStruct xmlns:namesp1="urn:xmethodsInterop">
      > <testStruct xsi:type="namesp1:SOAPStruct">
      > <varFloat xsi:type="xsd:float">6.2</varFloat>
      > <varString xsi:type="xsd:string">test string</varString>
      > <varInt xsi:type="xsd:int">5</varInt></testStruct>
      > </namesp1:echoStruct>
      > </SOAP-ENV:Body>
      > </SOAP-ENV:Envelope>
      >
      > ---------------------------------------------------
      >
      > And when you run it, here's the output bounced off the Apache
      > version
      > echoStruct method:
      >
      > RESULT --------------------
      > varFloat 6.2
      > varString test string
      > varInt 5
      >
      >
      >
      > One thing to note: in versions prior to 0.46, the namespace of the
      > generated
      > structure is the same as the method namespace URI (in this case,
      > urn:xmethodsInterop) . I believe in 0.46, this is now configurable.
      > I'll let
      > Paul comment on that .
      >
      > Cheers,
      > Tony
      > -----Original Message-----
      > From: Simon Fell [mailto:soap@...]
      > Sent: Thursday, February 01, 2001 12:23 AM
      > To: soapbuilders@yahoogroups.com
      > Subject: Re: [soapbuilders] Interoperability lab
      >
      >
      > I've got an implementation of this running, i'll try and get it
      > on a
      > public server tomorrow. I'm testing with SOAP::Lite as a client,
      > can
      > anyone show me how to call the echoStruct method, i'm having
      > trouble
      > getting the values nested in the inputStruct element (my perl
      > skills
      > can only get better from this point <g>)
      >
      > this is what i currently have
      >
      > my @struct = (
      > SOAP::Data->name(varInt => 42),
      > SOAP::Data->name(varFloat => 42.42),
      > SOAP::Data->name(varString => "SOAP::Lite to 4s4c")
      > ) ;
      >
      > my @parameters = (
      > SOAP::Data->name(inputStruct => @struct )
      > ) ;
      >
      > print @{$soap->echoStruct(@parameters)->method}{'outputStruct'} ,
      > "\n"
      > ;
      >
      >
      > For reference here are traces for the call to echoStringArray,
      > one
      > thing i did notice is that SOAP::Lite types the array as
      > namesp2:Array
      > whilst i'm typing it as SOAP-ENC:Array.
      >
      > Cheers
      > Simon
      >
      > ------------------ SOAP::Lite request ---------------------------
      > POST /ilab/soap.asp HTTP/1.0
      > Host: localhost:8080
      > User-Agent: SOAP::Lite/Perl/0.45
      > Content-Type: text/xml
      > SOAPAction: "urn:xmethodsInterop#echoStringArray"
      >
      > <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
      > xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      >
      > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      > xmlns:xsd="http://www.w3.org/1999/XMLSchema"><SOAP-ENV:Body>
      > <namesp2:echoStringArray xmlns:namesp2="urn:xmethodsInterop">
      > <inputStringArray SOAP-ENC:arrayType="xsd:string[3]"
      > xsi:type="namesp2:Array">
      > <c-gensym9 xsi:type="xsd:string">SOAP::Lite</c-gensym9>
      > <c-gensym9 xsi:type="xsd:string">to</c-gensym9>
      > <c-gensym9 xsi:type="xsd:string">4s4c</c-gensym9>
      > </inputStringArray></namesp2:echoStringArray>
      > </SOAP-ENV:Body></SOAP-ENV:Envelope>
      >
      >
      > ---------------------- 4s4c Response
      > -----------------------------
      > HTTP/1.1 200 OK
      > Server: Microsoft-IIS/5.0
      > Date: Thu, 01 Feb 2001 08:09:24 GMT
      > Connection: Keep-Alive
      > Content-Type: text/xml
      > Expires: Thu, 01 Feb 2001 08:09:24 GMT
      > Set-Cookie: ASPSESSIONIDGGQGQPMO=OOMLALIAMAFPCEFMOJNBNGGN; path=/
      > Cache-control: private
      >
      > <?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/"
      > xmlns:xsd="http://www.w3.org/1999/XMLSchema"
      > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      >
      > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      > <SOAP-ENV:Body><m:echoStringArrayResponse
      > xmlns:m="urn:xmethodsInterop">
      > <outputStringArray xsi:type="SOAP-ENC:Array"
      > SOAP-ENC:arrayType="xsd:string[3]">
      > <item xsi:type="xsd:string">SOAP::Lite</item>
      > <item xsi:type="xsd:string">to</item>
      > <item xsi:type="xsd:string">4s4c</item>
      > </outputStringArray></m:echoStringArrayResponse>
      > </SOAP-ENV:Body></SOAP-ENV:Envelope>
      >
      >
      >
      > On Wed, 31 Jan 2001 17:17:32 -0800, in soap you wrote:
      >
      > >Sanjiva,
      > >
      > >One other note - to illustrate the existing struct array test,
      > here is
      > the
      > >request/response wiredump. In
      > >this example, it's a Apache 2.0 client hitting a SOAPLite server
      > (it
      > works
      > >successfully) . Let me know if
      > >this is what you're thinking about, or if you need something
      > different.
      >
      === message truncated ===


      __________________________________________________
      Get personalized email addresses from Yahoo! Mail - only $35
      a year! http://personal.mail.yahoo.com/
    Your message has been successfully submitted and would be delivered to recipients shortly.