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

Re: [soaplite] Extra XML being sent via Soap::Lite

Expand Messages
  • Duncan Cameron
    At 2004-07-13, 06:52:02 Dianne Van Dulken
    Message 1 of 2 , Jul 13, 2004
    • 0 Attachment
      At 2004-07-13, 06:52:02 Dianne Van Dulken <Dianne.VanDulken@team.
      ozemail.com.au> wrote:

      >Hi everyone,
      >
      >Thanks very much for your help on sending cookies. That is now working
      >wonderfully, but I am having trouble with the next step.
      >
      >I'm using the following code to send my XML
      >
      >use LWP::Protocol::https;
      >Use HTTP::Cookies
      >use SOAP::Lite;
      > my $fnn = '0296755004'; # phone number to be checked.
      > my $productOffering = 'Layer-2';
      > my $spReferenceNbr = '12341234';
      > my $spContactName = 'Foo';
      > my $spContactNumber = '0296755004';
      >$soap = SOAP::Lite
      >-> uri('http://bean.b2b.lolo2.telstra.com')
      >-> encoding('Shift_JIS')
      >-> on_debug(sub{print@_})
      >-> on_action( sub { join '', 'http://bean.b2b.lolo2.telstra.com', $_[1]
      >} )
      >->
      >proxy('https://shopfront3.telstra.com.
      >au/LOLOSTGCb2b/services/ServiceQua
      >lImmService',
      > cookie_jar => HTTP::Cookies->new(
      > file => "lwp_cookies.dat",
      >))
      >;
      >$method = SOAP::Data->name('ServiceQualImmRequest')->attr({xmlns =>
      >'http://bean.b2b.lolo2.telstra.com/'});
      >@params = (
      > SOAP::Data->name("sqdetailsreq"=>
      > \SOAP::Data->value(SOAP::Data->name("spReferenceNbr" =>
      >$spReferenceNbr),
      > SOAP::Data->name("spContactName" => $spContactName),
      > SOAP::Data->name("spContactPhoneNbr" =>
      >$spContactNumber))),
      > SOAP::Data->name("sqitemdetailsreq"=>
      > \SOAP::Data->value(SOAP::Data->name("fnn" => $fnn),
      > SOAP::Data->name("productOffering" =>
      >$productOffering))));
      >$result = $soap->headers($method => @params);
      >print "Search result: " . $result . "\n";
      >~
      >The XML string I am getting as a result is
      >
      ><?xml version="1.0" encoding="Shift_JIS"?>
      ><SOAP-ENV:Envelope
      >xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      >SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      >xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      >xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      >xmlns:xsd="http://www.w3.org/1999/XMLSchema">
      ><SOAP-ENV:Body>
      ><namesp1:headers xmlns:namesp1="http://bean.b2b.lolo2.telstra.com">
      ><ServiceQualImmRequest xmlns="http://bean.b2b.lolo2.telstra.com/"/>
      ><sqdetailsreq>
      ><spReferenceNbr xsi:type="xsd:int">12341234</spReferenceNbr>
      ><spContactName xsi:type="xsd:string">Foo</spContactName>
      ><spContactPhoneNbr xsi:type="xsd:int">0296755004</spContactPhoneNbr>
      ></sqdetailsreq>
      ><sqitemdetailsreq>
      ><fnn xsi:type="xsd:int">0296755004</fnn>
      ><productOffering xsi:type="xsd:string">Layer-2</productOffering>
      ></sqitemdetailsreq>
      ></namesp1:headers>
      ></SOAP-ENV:Body>
      ></SOAP-ENV:Envelope>
      >
      >The bit we think is causing the problem is the namesp1:headers tag, as
      >the other side isn't expecting this. I haven't been able to find any
      >reference to this online at all. Can anyone tell me how I might be
      >able
      >to remove this?

      The headers element is in your message because you are calling a
      headers() method. >$result = $soap->headers($method => @params);

      In my previous reply I asked what the headers() method was for, it
      looks like you have misunderstood something.

      I would guess that you are meaning to do this

      $result = $soap->call($method => @params);

      Regards
      Duncan
    Your message has been successfully submitted and would be delivered to recipients shortly.