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

Sending "custom" xml (with multipart mime headers) to class.

Expand Messages
  • One4K4
    This may be a FAQ, I m not sure. If so, feel free to flame away. Anyway, after reading the various docs on soaplite.com, and especially t/04-attach.t. My
    Message 1 of 1 , Jun 14 9:28 AM
    • 0 Attachment
      This may be a FAQ, I'm not sure. If so, feel free to flame away.
      Anyway, after reading the various docs on soaplite.com, and
      especially t/04-attach.t.

      My question is this:

      Since SOAP::Lite doesn't like attachments very much, at least sending
      them.. can I execute (from the client) arbitrary XML on the server.
      Take, for instance the code below:

      ####################################################
      my $x = SOAP::Serializer->serialize(<<'END');

      Content-Type: Multipart/Related; boundary=MIME_boundary;
      type="text/xml"; start="<hello.xml>"
      SOAPAction: http://10.7.2.33:2738/Hello
      Content-Description: This is the optional message description.

      --MIME_boundary
      Content-Type: text/xml; charset=UTF-8
      Content-Transfer-Encoding: 8bit
      Content-ID: <hello.xml>

      <?xml version='1.0' ?>
      <SOAP-ENV:Envelope
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
      <SOAP-ENV:Body>
      <Hello:sayHello name="Thomas"
      xmlns:sayHello="http://10.7.2.33:2738/Hello">
      <upload_file href="cid:test_file_to_upload.gif"/>
      </Hello:sayHello>
      </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>

      --MIME_boundary
      Content-Type: image/gif
      Content-Transfer-Encoding: base64
      Content-ID: <test_file_to_upload.gif>

      AAECAyAgIAQFBg==
      --MIME_boundary--

      END
      ####################################################

      Is there a way I can create this within the client, populating the
      values as needed, then executing it against the sayHello method, in
      the Hello class?

      Do I have to use the plain old SOAP line of modules?

      04-attach.t didn't actually execute the XML over the wire, it simply
      deserialized it, and displayed the values, checking for "OK"ed ness.

      Curious,

      -Tom
    Your message has been successfully submitted and would be delivered to recipients shortly.