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

Re: [soaplite] Trouble figuring out SOAP::Data required for arcweb service

Expand Messages
  • Eric Bridger
    There was one final piece, at least for me solving a similiar problem, addressed in this post: http://www.majordojo.com/archives/2003_04.html#000009. By using
    Message 1 of 4 , Sep 20, 2005
    • 0 Attachment
      There was one final piece, at least for me solving a similiar problem,
      addressed in this post:
      http://www.majordojo.com/archives/2003_04.html#000009.

      By using the S::L->call method you can pass the service method name as a
      SOAP::Data element and in the process set the namespace of the requests
      root element.

      Eric


      On Mon, 2005-09-19 at 14:55, swoodbri wrote: Hi all,

      I am new to SOAP::Lite and I'm trying to access a service that
      requires a complex data structure sent to it and I am having no luck
      figuring this out. Below is the XML the service is expecting. I have
      been able to get very close to this, but I keep getting a soap fault
      from the server parsing the xml.

      I have spent 2 days working on this and have not got past this
      problem. Can someone please convert this into SOAP::Data calls I need
      to generate this. Or point me to some useful documents and examples. I
      have google for examples and tutorials and the error messages, but
      there is not much doc in this area.

      Thanks,
      -Steve

      <SOAP-ENV:Envelope
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:m0="http://www.themindelectric.com/package/com.esri.is.services.glue.v2.routefinder/"
      xmlns:m2="http://www.themindelectric.com/package/com.esri.is.services.glue.v2.mapimage/"
      xmlns:m3="http://www.themindelectric.com/package/com.esri.is.services.common.v2.geom/"
      xmlns:m4="http://schemas.xmlsoap.org/soap/encoding/">
      <SOAP-ENV:Body>
      <m:findRoute xmlns:m="v2">
      <routeStops xsi:type="SOAP-ENC:Array"
      SOAP-ENC:arrayType="m0:RouteStop[1]">
      <m0:item0 xsi:type="m0:RouteStop">
      <description xsi:type="xsd:string">The first
      stop</description>
      <point xsi:type="m3:Point">
      <x xsi:type="xsd:double">-117.183711</x>
      <y xsi:type="xsd:double">34.073837</y>
      </point>
      </m0:item0>
      <m0:item1 xsi:type="m0:RouteStop">
      <description xsi:type="xsd:string">The second
      stop</description>
      <point xsi:type="m3:Point">
      <x xsi:type="xsd:double">-117.185533</x>
      <y xsi:type="xsd:double">34.057055</y>
      </point>
      </m0:item1>
      <m0:item2 xsi:type="m0:RouteStop">
      <description xsi:type="xsd:string">The last stop</description>
      <point xsi:type="m3:Point">
      <x xsi:type="xsd:double">-117.195533</x>
      <y xsi:type="xsd:double">34.057055</y>
      </point>
      </m0:item2>
      </routeStops>
      <routeFinderOptions xsi:type="m0:RouteFinderOptions">
      <dataSource xsi:type="xsd:string">GDT.Streets.US</dataSource>
      </routeFinderOptions>
      <token xsi:type="xsd:string">MyToken</token>
      </m:findRoute>
      </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>





      ________________________________________________________________________
      YAHOO! GROUPS LINKS

      1. Visit your group "soaplite" on the web.

      2. To unsubscribe from this group, send an email to:
      soaplite-unsubscribe@yahoogroups.com

      3. Your use of Yahoo! Groups is subject to the Yahoo! Terms of
      Service.

      ________________________________________________________________________
    • Stephen Woodbridge
      Eric, Thank you for the excellent references. I found this one which was a major break through: http://www.majordojo.com/soaplite/docs/SOAP/Data.html And I was
      Message 2 of 4 , Sep 20, 2005
      • 0 Attachment
        Eric,

        Thank you for the excellent references. I found this one which was a
        major break through:
        http://www.majordojo.com/soaplite/docs/SOAP/Data.html

        And I was able to get it to work. This is a sample block of code:

        my @routeStops = ();
        my $item = 0;
        for my $s (@$stops) {
        push @routeStops, SOAP::Data->name("item$item")
        ->value( \SOAP::Data->value(
        SOAP::Data->name(description => $s->[2])->type('string'),
        SOAP::Data->name(point => \SOAP::Data->value(
        SOAP::Data->name(x => $s->[0])->type('double'),
        SOAP::Data->name(y => $s->[1])->type('double'))
        )
        ->type('m3:Point')

        ->uri('http://www.themindelectric.com/package/com.esri.is.services.common.v2.geom/')
        ->prefix('m3')
        ->attr({
        'xmlns:m3' =>
        'http://www.themindelectric.com/package/com.esri.is.services.common.v2.geom/',
        })
        ))
        ->type('m0:RouteStop')

        ->uri("http://www.themindelectric.com/package/com.esri.is.services.glue.v2.routefinder/")
        ->prefix('m0')
        ->attr({
        'xmlns:m0' =>
        "http://www.themindelectric.com/package/com.esri.is.services.glue.v2.routefinder/",
        })
        ;
        $item++;
        }

        There is probably a better way to do this, but this worked. My
        conclusion is the SOAP::Lite is anything but "Simple". I would think
        that is you supplied a WSDL that it would be smart enough to read and
        adapt itself to the namespace(s) involved. I was very close to just
        generating the XML directly for the request, because it would have been
        quicker, easier, and more efficent. I can imagine all the manipulations
        that are going on under the covers! :)

        Anyways, your help is greatly appreciated.

        Best regards,
        -Steve

        Eric Bridger wrote:
        > There was one final piece, at least for me solving a similiar problem,
        > addressed in this post:
        > http://www.majordojo.com/archives/2003_04.html#000009.
        >
        > By using the S::L->call method you can pass the service method name as a
        > SOAP::Data element and in the process set the namespace of the requests
        > root element.
        >
        > Eric
        >
        >
        > On Mon, 2005-09-19 at 14:55, swoodbri wrote: Hi all,
        >
        > I am new to SOAP::Lite and I'm trying to access a service that
        > requires a complex data structure sent to it and I am having no luck
        > figuring this out. Below is the XML the service is expecting. I have
        > been able to get very close to this, but I keep getting a soap fault
        > from the server parsing the xml.
        >
        > I have spent 2 days working on this and have not got past this
        > problem. Can someone please convert this into SOAP::Data calls I need
        > to generate this. Or point me to some useful documents and examples. I
        > have google for examples and tutorials and the error messages, but
        > there is not much doc in this area.
        >
        > Thanks,
        > -Steve
        >
        > <SOAP-ENV:Envelope
        > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
        > xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
        > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
        > xmlns:m0="http://www.themindelectric.com/package/com.esri.is.services.glue.v2.routefinder/"
        > xmlns:m2="http://www.themindelectric.com/package/com.esri.is.services.glue.v2.mapimage/"
        > xmlns:m3="http://www.themindelectric.com/package/com.esri.is.services.common.v2.geom/"
        > xmlns:m4="http://schemas.xmlsoap.org/soap/encoding/">
        > <SOAP-ENV:Body>
        > <m:findRoute xmlns:m="v2">
        > <routeStops xsi:type="SOAP-ENC:Array"
        > SOAP-ENC:arrayType="m0:RouteStop[1]">
        > <m0:item0 xsi:type="m0:RouteStop">
        > <description xsi:type="xsd:string">The first
        > stop</description>
        > <point xsi:type="m3:Point">
        > <x xsi:type="xsd:double">-117.183711</x>
        > <y xsi:type="xsd:double">34.073837</y>
        > </point>
        > </m0:item0>
        > <m0:item1 xsi:type="m0:RouteStop">
        > <description xsi:type="xsd:string">The second
        > stop</description>
        > <point xsi:type="m3:Point">
        > <x xsi:type="xsd:double">-117.185533</x>
        > <y xsi:type="xsd:double">34.057055</y>
        > </point>
        > </m0:item1>
        > <m0:item2 xsi:type="m0:RouteStop">
        > <description xsi:type="xsd:string">The last stop</description>
        > <point xsi:type="m3:Point">
        > <x xsi:type="xsd:double">-117.195533</x>
        > <y xsi:type="xsd:double">34.057055</y>
        > </point>
        > </m0:item2>
        > </routeStops>
        > <routeFinderOptions xsi:type="m0:RouteFinderOptions">
        > <dataSource xsi:type="xsd:string">GDT.Streets.US</dataSource>
        > </routeFinderOptions>
        > <token xsi:type="xsd:string">MyToken</token>
        > </m:findRoute>
        > </SOAP-ENV:Body>
        > </SOAP-ENV:Envelope>
        >
        >
        >
        >
        >
        > ________________________________________________________________________
        > YAHOO! GROUPS LINKS
        >
        > 1. Visit your group "soaplite" on the web.
        >
        > 2. To unsubscribe from this group, send an email to:
        > soaplite-unsubscribe@yahoogroups.com
        >
        > 3. Your use of Yahoo! Groups is subject to the Yahoo! Terms of
        > Service.
        >
        > ________________________________________________________________________
        >
        >
        >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.