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

changing the namespace for SOAP::Data objects

Expand Messages
  • calinm
    Hello, How do I change the namespace of a SOAP::Data object? I need it in another namespace than http://namespaces.soaplite.com/perl. Thanks a lot, Calin The
    Message 1 of 2 , Aug 23 9:06 AM
    • 0 Attachment
      Hello,

      How do I change the namespace of a SOAP::Data object? I need it in
      another namespace than http://namespaces.soaplite.com/perl.

      Thanks a lot,

      Calin

      The code and the bad XML follow.

      $m1 = SOAP::Data->new()->name('m1')->type('string')
      ->value('SampleString');
      $m2 = SOAP::Data->new()->name('m2')->type('int')
      ->value(2222);
      $bean = SOAP::Data->new()
      ->value({m1 => $m1, m2 => $m2});
      $bean->type('Bean1');

      $beanarray = SOAP::Data->new();
      $beanarray->value([$bean,$bean,$bean]);

      I don't want the objects in http://namespaces.soaplite.com/perl I
      want them all in http://com.test/wsdl/ZoneEditWS.

      <?xml version="1.0" encoding="UTF-8" ?>
      - <SOAP-ENV:Envelope
      xmlns:namesp2="http://namespaces.soaplite.com/perl"
      xmlns:namesp3="http://xml.apache.org/xml-soap" SOAP-
      ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xsi="http://www.w3.org/2001/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/2001/XMLSchema">
      - <SOAP-ENV:Body>
      - <namesp1:echoBean1Array
      xmlns:namesp1="http://com.test/wsdl/ZoneEditWS">
      - <arrayOfBean1_1 SOAP-ENC:arrayType="namesp2:Bean1[3]"
      xsi:type="SOAP-ENC:Array">
      <item href="#ref-135306068" xsi:type="namesp2:Bean1" />
      <item href="#ref-135306068" xsi:type="namesp2:Bean1" />
      <item href="#ref-135306068" xsi:type="namesp2:Bean1" />
      </arrayOfBean1_1>
      </namesp1:echoBean1Array>
      - <c-gensym3 id="ref-135306068" xsi:type="namesp3:SOAPStruct">
      <m2 xsi:type="xsd:int">2222</m2>
      <m1 xsi:type="xsd:string">SampleString</m1>
      </c-gensym3>
      <item href="#ref-135306068" xsi:type="namesp2:Bean1" />
      <m1 _id="1" xsi:type="xsd:string">SampleString</m1>
      <m2 _id="1" xsi:type="xsd:int">2222</m2>
      </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>
    • Eric Promislow
      Something like this should do it: $soapObj = SOAP::Lite- new (... uri = http://com.test/wsdl/ZoneEditWS ); ... $soapObj- call( method = $beanarray); -
      Message 2 of 2 , Aug 26 10:40 AM
      • 0 Attachment
        Something like this should do it:

        $soapObj = SOAP::Lite->new (... 'uri' => 'http://com.test/wsdl/ZoneEditWS');
        ...
        $soapObj->call('method' => $beanarray);

        - Eric

        >
        > Date: Fri, 23 Aug 2002 16:06:42 -0000
        > From: "calinm" <calinm@...>
        > Subject: changing the namespace for SOAP::Data objects
        >
        > Hello,
        >
        > How do I change the namespace of a SOAP::Data object? I need it in
        > another namespace than http://namespaces.soaplite.com/perl.
        >
        > Thanks a lot,
        >
        > Calin
        >
        > The code and the bad XML follow.
        >
        > $m1 = SOAP::Data->new()->name('m1')->type('string')
        > ->value('SampleString');
        > $m2 = SOAP::Data->new()->name('m2')->type('int')
        > ->value(2222);
        > $bean = SOAP::Data->new()
        > ->value({m1 => $m1, m2 => $m2});
        > $bean->type('Bean1');
        >
        > $beanarray = SOAP::Data->new();
        > $beanarray->value([$bean,$bean,$bean]);
        >
        > I don't want the objects in http://namespaces.soaplite.com/perl I
        > want them all in http://com.test/wsdl/ZoneEditWS.
        > [... soap msg deleted]
      Your message has been successfully submitted and would be delivered to recipients shortly.