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

3267Re: new to soap, cant seem to get it right

Expand Messages
  • jpeyser
    Jan 5, 2004
    • 0 Attachment
      Here are some methods that will help to generate the desired XML.

      $soap
      ->uri('urn:schemas-xmlsoap-org:soap:vl')
      ->on_action(sub { return 'urn:schemas-xmlsoap-org:soap:vl' })
      ->proxy('https://www.mywebsite.com/secure/SOAP.asp')
      -> maptype({`elig' => 'www.mywebsite.com/secure/'})
      -> autotype(0)
      -> envprefix('SOAP')

      However, there are a number of issues.

      First, there are predefined schemas in SOAP::Lite that are placed in
      the envelope; urn:schemas-xmlsoap-org:v1 is not one of them. So,
      there is no way to put it in the envelope without hacking (See
      SOAP::Constants)

      Second, there is no reason to put it in the envelope as it will be
      the default namespace for the method.

      <namesp1:Batch xmlns:namesp1="urn:schemas-xmlsoap-
      org:soap:vl">

      Third, I have encountered ASP SOAP servers that do not like namespace
      prefixes. The above line would have to be generated as

      < Batch xmlns="urn:schemas-xmlsoap-org:soap:vl">

      This can be accomplished by redefining SOAP::Serializer::gen_ns (THIS
      IS A HACK)

      BEGIN {
      # no warnings 'redefine';
      local($^W) = 0;
      *SOAP::Serializer::gen_ns = sub {};
      }

      However, prefixes in SOAP::Lite are an important part of namespace
      mapping as can be seen from the next issue. Suppressing the prefixes
      will interfere with some mappings.

      Lastly, the method maptype will add the namespace definition to the
      envelope, provided that it is referenced in the XML. There is no
      prefix `elig' for any method or element.

      Jonathan

      --- In soaplite@yahoogroups.com, "opus23k" <nihal@e...> wrote:
      >
      > So you can see the XML I'm trying to generate at the bottom of this
      > message, but here's as close as I can get to that:
      >
      > <?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:Batch xmlns:namesp1="urn:schemas-xmlsoap-org:soap:vl">
      > <Transaction>
      > <MultipleRequestFlag xsi:type="xsd:string"/>
      > </Transaction>
      > <Transaction>
    • Show all 6 messages in this topic