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

non-RPC usage for SOAP::Lite

Expand Messages
  • wagner19722001@yahoo.es
    Hi all, I intend to use SOAP::Lite in a distributed transaction environment. I won t use the rpc-related stuff for now, but my main objective is to wrap/unwrap
    Message 1 of 3 , Mar 5, 2001
      Hi all,

      I intend to use SOAP::Lite in a distributed transaction environment. I
      won't use the rpc-related stuff for now, but my main objective is
      to wrap/unwrap well-formed XML in one (or more) SOAP body entries,
      referenced via id's in the SOAP headers.

      Do I *really* need to call freeform() to serialize my data or access
      the XML docs in the envelope? SOAP::Serializer docs says the above
      method "lets you build your own payload inside a SOAP envelope".

      Or merely should I use SOAP::Custom::XML methods as pointed in
      t/05-customxml?

      I would like Paul or someone to explain freeform() usage and maybe
      some example.

      Thanks,

      --
      Alvaro Fdez. Lago
      Dynamic Soft, ES
    • Paul Kulchenko
      Hi, Alvaro! ... Yes, it s basically does the same as method(), so it build envelope, but method() has little bit special logic for method element (like put uri
      Message 2 of 3 , Mar 5, 2001
        Hi, Alvaro!

        --- wagner19722001@... wrote:
        > Do I *really* need to call freeform() to serialize my data or
        > access
        > the XML docs in the envelope? SOAP::Serializer docs says the above
        > method "lets you build your own payload inside a SOAP envelope".
        Yes, it's basically does the same as method(), so it build envelope,
        but method() has little bit special logic for method element (like
        put uri on it) and freeform() method doesn't do anything with it,
        just put everything as is inside the envelope.

        If you have XML generated somewhere and want to include it inside the
        message than you can take a look into 'xml' type, whi let you write
        SOAP::Data->type(xml => '<element>value</element>') and include XML
        fragment into your payload or write your own serializer (next version
        will include XML::DOM example for serialization/deserialization).

        > Or merely should I use SOAP::Custom::XML methods as pointed in
        > t/05-customxml?
        SOAP::Custom::XML can be used only on parsing side (it simplifies
        interface for parsing messages, and couldn't be used for creating
        messages).

        > I would like Paul or someone to explain freeform() usage and maybe
        > some example.

        SOAP::Serializer->readable(1)
        ->freeform(SOAP::Data->name(root => {a => 1}));

        will generates:

        <SOAP-ENV:Body
        >
        <root xsi:type="namesp1:SOAPStruct"
        >
        <a xsi:type="xsd:int"
        >1</a></root></SOAP-ENV:Body>

        and

        SOAP::Serializer->readable(1)
        ->method(method => SOAP::Data->name(root => {a => 1}));

        will generates:

        <SOAP-ENV:Body
        >
        <method
        >
        <root xsi:type="namesp2:SOAPStruct"
        >
        <a xsi:type="xsd:int"
        >1</a></root></method></SOAP-ENV:Body>

        Envelope skipped in both cases.

        As you see the only difference is 'method' element (ad your control
        on it). The important question is who (and how) will handle this
        package on server side (you may, for example, create AUTOLOAD sub on
        server side in your package and it'll catch ALL dispatched calls, but
        server side of SOAP::Lite will treat 'root' element in first case as
        method's name and others as parameters, that could be not what you
        want. There is no way to alter this behavior on server side for now
        as far as I understand.

        Hope it gives you some ideas and if it won't help, please provide
        some details of what do you want to achive, maybe we could help with
        implementation.

        Best wishes, Paul.

        __________________________________________________
        Do You Yahoo!?
        Get email at your own domain with Yahoo! Mail.
        http://personal.mail.yahoo.com/
      • wagner19722001@yahoo.es
        Thanks Paul!, ... the ... Yes, it would be useful , but I want to parse the XMLs (even MIME, S/MIME structures, etc), so ... ... ....That s right, it ll work
        Message 3 of 3 , Mar 5, 2001
          Thanks Paul!,

          > If you have XML generated somewhere and want to include it inside
          the
          > message than you can take a look into 'xml' type, whi let you write
          > SOAP::Data->type(xml => '<element>value</element>') and include XML
          > fragment into your payload ....

          Yes, it would be useful , but I want to parse the XMLs (even MIME,
          S/MIME structures, etc), so ...

          > or write your own serializer (next version
          > will include XML::DOM example for serialization/deserialization).

          ....That's right, it'll work for me. I'll try libxml-enno modules also
          which also offer validation.

          >
          > > Or merely should I use SOAP::Custom::XML methods as pointed in
          > > t/05-customxml?
          > SOAP::Custom::XML can be used only on parsing side (it simplifies
          > interface for parsing messages, and couldn't be used for creating
          > messages).

          Custom::XML it's nice and easy so I'll use it on server (receiving)
          side, definitely, for quick & dirty deploy...

          >
          > As you see the only difference is 'method' element (ad your control
          > on it). The important question is who (and how) will handle this
          > package on server side (you may, for example, create AUTOLOAD sub on

          I'll handle the code at the two sides. Client side: will parse XML
          docs, add some transaction info and routing; and server side will
          simply process
          the SOAP Header entries and Body payload, get the docs (& attachments)
          and maybe generate receipts destined for client side...

          À la BizTalk fashion (just kidding:)



          > Hope it gives you some ideas and if it won't help, please provide
          > some details of what do you want to achive, maybe we could help with
          > implementation.

          Tomorow I'll post some details, very much thanks again!

          Yours,

          Alvaro Fdez. Lago
          Dynamic Soft, ES
        Your message has been successfully submitted and would be delivered to recipients shortly.