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

Re: Question about SOAP:Lite concerning the body

Expand Messages
  • Paul Kulchenko
    Hi, Filip! ... Short answer is it s possible . ... Ideally you should have one root element under body (it might be not method call, but it should be one).
    Message 1 of 1 , May 21, 2001
    • 0 Attachment
      Hi, Filip!

      > As you see there are some differences in structure is it possible
      > to handle this?
      Short answer is "it's possible".
      > If not do you have eventually a proposal or another solution?
      Ideally you should have one root element under body (it might be not
      method call, but it should be one).

      Long answer:
      1. That's not the right thing to do because, according to SOAP
      authors is was the bad idea to allow to have multiple roots under
      Body for document/literal encoding. Absolutely unclear how to
      dispatch calls in this case, where is the root and how to handle it
      on server side. Microsoft is little bit ahead in handling literal
      documents, but even they handle it with single root element.
      2. SOAP::Lite CAN do it (partially). If you create class that will
      map namespace of first immediate child of body element (mUSTheader in
      your example) and create AUTOLOAD function, then you can catch ALL
      calls and having access to envelope object get ALL information you
      need. You have NO CONTROL over name of response element (SOAP::Lite
      will do 'mUSTheaderResponse' automatically), but it's easy to alter
      also: you need to register your own serializer and alter envelope
      method, catch call with 'method' and specific name and change it to
      whatever you want. 5 lines of code. Let me know if you REALLY need
      it, I'll send you an example, or you can look at XMLRPC::Lite for
      XMLRPC::Serializer::envelope that does similar thing.

      Hope it helps and let me know if you need more information. Future
      versions should have better support for document/literal encoding,
      but only after it becomes clear how to handle it. I'm CC'ing soaplite
      list, because it's important question and ideally I would like to
      know how many people are looking for similar solutions right now.

      Best wishes, Paul.

      --- filip.vanpraet@... wrote:
      > Hi Paul
      > with the evolution of the project i'm working I' wanted to ask if
      > SOAP:Lite
      > always works using the rpc mode. Is it possible t do it different
      > by just
      > sending an XML structure in the SOAP:body.
      > What I mean is the following:
      > For now I using SOAP as like an RPC call and I handle it
      > accordingly. So
      > the message I send id
      >
      > <?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/" xmln
      > s:xsd="http://www.w3.org/1999/XMLSchema">
      > <SOAP-ENV:Body>
      > <function>
      > <mUSTheader>
      > ... some parameters
      > </mUSTheader>
      > <mUSTRequest>
      > ... some parameters
      > </mUSTRequest>
      > </function>
      > </SOAP-ENV:Body>
      > </SOAP-ENV:Envelope>
      >
      > And I get a response accordingly
      > My question is the can SOAP:Lite handle the the following:
      >
      > <?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/" xmln
      > s:xsd="http://www.w3.org/1999/XMLSchema">
      > <SOAP-ENV:Body>
      > <mUSTheader>
      > ... some parameters
      > </mUSTheader>
      > <mUSTRequest>
      > <function>
      > <name>blabla</name>
      > ... some parameters
      > </function>
      > <function>
      > <name>blabla</name>
      > ... some parameters
      > </function>
      > </mUSTRequest>
      > </SOAP-ENV:Body>
      > </SOAP-ENV:Envelope>
      >
      > and the reply
      >
      > <?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/" xmln
      > s:xsd="http://www.w3.org/1999/XMLSchema">
      > <SOAP-ENV:Body>
      > <mUSTheader>
      > ... some parameters
      > </mUSTheader>
      > <mUSTResponse>
      > <function>
      > <name>blabla</name>
      > ... some parameters
      > </function>
      > <function>
      > <name>blabla</name>
      > ... some parameters
      > </function>
      > </mUSTResponse>
      > </SOAP-ENV:Body>
      > </SOAP-ENV:Envelope>
      >
      > As you see there are some differences in structure is it possible
      > to handle
      > this? If not do you have eventually a proposal or another solution?
      >
      > Thanks for any answer
      >
      > Greetings
      > Filip
      >


      __________________________________________________
      Do You Yahoo!?
      Yahoo! Auctions - buy the things you want at great prices
      http://auctions.yahoo.com/
    Your message has been successfully submitted and would be delivered to recipients shortly.