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

RE: [soaplite] Passing nested structures

Expand Messages
  • Paul Harman
    Ignore me - I d put dots instead of commas. Wonderful toolkit, never thought otherwise };*) Paul ... http://docs.yahoo.com/info/terms/ This E-Mail and any
    Message 1 of 4 , Nov 20, 2003
    • 0 Attachment
      Ignore me - I'd put dots instead of commas. Wonderful toolkit, never thought
      otherwise };*)

      Paul

      > -----Original Message-----
      > From: Paul Harman [mailto:paul.harman@...]
      > Sent: 20 November 2003 11:17
      > To: 'soaplite@yahoogroups.com'
      > Subject: [soaplite] Passing nested structures
      >
      >
      > I'm using SOAP::Lite as a client to call methods on a gSOAP server.
      >
      > The method I am trying to call thakes 4 input parameters: two
      > strings, a
      > boolean, and a complex data structure. What I want to know
      > is... how do I
      > encode a structure?
      >
      > At the moment I'm doing this:
      >
      > my $gvh=new SOAP::Lite
      > proxy => 'http://localhost:18083/',
      > uri => 'urn:Grapevine',
      > on_action => sub{"\"\""},
      > ;
      >
      > my $res=$gvh->createNode(
      > SOAP::Data->name("nodeLabel")->value("test label"),
      > SOAP::Data->name("description")->value("test description"),
      > SOAP::Data->name("permanent")->type("xsd:boolean")->value("true"),
      > SOAP::Data->name("content")->type("gv:NodeContent")->value(
      > SOAP::Data->name("version")->value("testVersion").
      > SOAP::Data->name("revision")->value(0).
      > SOAP::Data->name("created")->value(time()).
      > SOAP::Data->name("lastUpdated")->value(time()).
      >
      > SOAP::Data->name("type")->type("gv:ContentType")->value("text").
      > SOAP::Data->name("source")->value("testSource").
      > SOAP::Data->name("format")->value("text/plain").
      > SOAP::Data->name("headline")->value("test headline").
      > SOAP::Data->name("byline")->value("test byline").
      >
      > SOAP::Data->name("embargo")->type("xsd:boolean")->value("false")
      > )
      > );
      >
      > i.e. the structure is of type gv:NodeContent, and is named as
      > "content" in
      > the WSDL, and has member fields "version", "revision" ...
      > "embargo". THe
      > above doesn't work: using trace I see that the contents of
      > "content" isn't
      > being encoded properly (no dount due to my lack of
      > understanding) - tabbing
      > and newlines added to aid readability:
      >
      > POST http://localhost:18083/
      > Accept: text/xml
      > Accept: multipart/*
      > Content-Length: 928
      > Content-Type: text/xml; charset=utf-8
      > SOAPAction: ""
      >
      > <?xml version="1.0" encoding="UTF-8"?>
      > <SOAP-ENV:Envelope
      > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      > xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      > xmlns:xsd="http://www.w3.org/1999/XMLSchema"
      > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      > <SOAP-ENV:Body>
      > <namesp1:createNode xmlns:namesp1="urn:Grapevine">
      > <nodeLabel xsi:type="xsd:string">test
      > label</nodeLabel>
      > <description xsi:type="xsd:string">test
      > description</description>
      > <permanent
      > xsi:type="xsd:boolean">true</permanent>
      > <content xsi:type="gv:NodeContent">
      > SOAP::Data=HASH(0x2e7da4)SOAP::Data=HASH(0x2e8a20)SOAP::Data=H
      > ASH(0x2e8ac8)S
      > OAP::Data=HASH(0x2e8b64)SOAP::Data=HASH(0x2e8c00)SOAP::Data=HA
      > SH(0x2e8cb4)SO
      > AP::Data=HASH(0x2e8d50)SOAP::Data=HASH(0x38b658)SOAP::Data=HAS
      > H(0x38b6f4)SOA
      > P::Data=HASH(0x38b790)
      > </content>
      > </namesp1:createNode>
      > </SOAP-ENV:Body>
      > </SOAP-ENV:Envelope>
      >
      > So... what do I have to do to the "value" passed for the
      > "content" element
      > so I get XML instead of the perl type/location gibberish? <grin>
      >
      > Surely I don't have to write my owen serialiser... do I?
      >
      > Paul
      >
      >
      > This E-Mail and any attachment is intended only for the
      > person or entity for
      > which it is addressed and may contain confidential material.
      > If you are not
      > the addressee or have received this E-Mail in error, please inform the
      > sender immediately and delete it from your computer. In
      > addition, if you are
      > not the addressee or have received this E-Mail in error, any
      > disclosure,
      > copying, distribution or any action taken or omitted to be
      > taken in reliance
      > upon it is prohibited and may be unlawful.
      > If this E-Mail has been transmitted outside the ordinary course of its
      > business, the company for which the sender works accepts no
      > liability for
      > any loss or damage suffered by any person arising from any use of or
      > reliance on information contained in this E-Mail, and any
      > opinion expressed
      > in this E-Mail is personal to the sender and may not reflect
      > the opinion of
      > such company. Although the network operator makes every
      > reasonable effort to
      > keep its network free from viruses, neither the network
      > operator nor the
      > sender or the company for which the sender works accepts any
      > responsibility
      > for computer viruses transmitted through this E-Mail or any
      > attachments; it
      > is your responsibility to virus scan this E-Mail and any
      > attachments. Any
      > E-Mail reply to this address may be subject to interception
      > or monitoring
      > for operational reasons or for lawful business practices.
      >
      >
      >
      >
      > ------------------------ Yahoo! Groups Sponsor
      > ---------------------~-->
      > Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
      > Printer at MyInks.com. Free s/h on orders $50 or more to the
      > US & Canada.
      > http://www.c1tracking.com/l.asp?cid=5511
      > http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/W6uqlB/TM
      > --------------------------------------------------------------
      > -------~->
      >
      > To unsubscribe from this group, send an email to:
      > soaplite-unsubscribe@yahoogroups.com
      >
      >
      >
      > Your use of Yahoo! Groups is subject to
      http://docs.yahoo.com/info/terms/



      This E-Mail and any attachment is intended only for the person or entity for
      which it is addressed and may contain confidential material. If you are not
      the addressee or have received this E-Mail in error, please inform the
      sender immediately and delete it from your computer. In addition, if you are
      not the addressee or have received this E-Mail in error, any disclosure,
      copying, distribution or any action taken or omitted to be taken in reliance
      upon it is prohibited and may be unlawful.
      If this E-Mail has been transmitted outside the ordinary course of its
      business, the company for which the sender works accepts no liability for
      any loss or damage suffered by any person arising from any use of or
      reliance on information contained in this E-Mail, and any opinion expressed
      in this E-Mail is personal to the sender and may not reflect the opinion of
      such company. Although the network operator makes every reasonable effort to
      keep its network free from viruses, neither the network operator nor the
      sender or the company for which the sender works accepts any responsibility
      for computer viruses transmitted through this E-Mail or any attachments; it
      is your responsibility to virus scan this E-Mail and any attachments. Any
      E-Mail reply to this address may be subject to interception or monitoring
      for operational reasons or for lawful business practices.
    • Byrne Reese
      Man - I cannot wait for wsdl2perl to be finished. These issues will become a lot easier when that tool is in place. wsdl2perl will also produce a new
      Message 2 of 4 , Nov 20, 2003
      • 0 Attachment
        Man - I cannot wait for wsdl2perl to be finished. These issues will become
        a lot easier when that tool is in place.

        wsdl2perl will also produce a new serializer that could possibly be
        reintegrated into the core module that will make serializing complex types
        a lot easier.

        For the time being, take a look at the following howto:
        http://www.majordojo.com/archives/000008.html

        > I'm using SOAP::Lite as a client to call methods on a gSOAP server.
        >
        > The method I am trying to call thakes 4 input parameters: two strings, a
        > boolean, and a complex data structure. What I want to know is... how do I
        > encode a structure?
        >
        > At the moment I'm doing this:
        >
        > my $gvh=new SOAP::Lite
        > proxy =< 'http://localhost:18083/',
        > uri =< 'urn:Grapevine',
        > on_action =< sub{"\"\""},
        > ;
        >
        > my $res=$gvh-


        ^byrne :/
      • Aaron Trevena
        ... If you have big old nested structures you can save your self time and tears using my SOAP::Data::Build perl Module, available from your local
        Message 3 of 4 , Nov 21, 2003
        • 0 Attachment
          On Thu, 20 Nov 2003, Paul Harman wrote:
          > [ removed ]

          If you have big old nested structures you can save your self time and
          tears using my <plug>SOAP::Data::Build</plug> perl Module, available from
          your local CPAN mirror.

          have a nice day

          A.

          --
          Aaron J Trevena - Perl Hacker, Kung Fu Geek, Internet Consultant
          AutoDia --- Automatic UML and HTML Specifications from Perl, C++
          and Any Datasource with a Handler. http://droogs.org/autodia
        Your message has been successfully submitted and would be delivered to recipients shortly.