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

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

Expand Messages
  • jpeyser
    Here are some methods that will help to generate the desired XML. $soap - uri( urn:schemas-xmlsoap-org:soap:vl ) - on_action(sub { return
    Message 1 of 6 , 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>
    • Byrne Reese
      In the upcoming release of SOAP::Lite, one will be able to programmatically turn namespace prefixing on/off. .NET for example wants default namespaces to be
      Message 2 of 6 , Jan 6, 2004
      • 0 Attachment
        In the upcoming release of SOAP::Lite, one will be able to
        programmatically turn namespace prefixing on/off. .NET for example wants
        default namespaces to be used, as opposed to prefixes. In any event, this
        capability is forthcoming.

        >
        >
        >
        >
        > Here are some methods that will help to generate the desired XML.
        >
        > $soap
        > -
        >
        >
        >
        >
        > Yahoo! Groups Links
        >
        > To visit your group on the web, go
        > to:http://groups.yahoo.com/group/soaplite/
        > To unsubscribe from this group, send an email
        > to:soaplite-unsubscribe@yahoogroups.com
        > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
        >
        >
        >
        >
        >
        >
        >


        ^byrne :/
      Your message has been successfully submitted and would be delivered to recipients shortly.