in reply to Re^2: SOAP::Lite problem
in thread SOAP::Lite problem

Thanks for your comments, if you see the code above, there is a @data array, that is the structure that it needs to be sent on the XML request, but as I showed the request does not contain those values for some reason.

if the code you posted doesn't produce the xml you want, how will I guess what xml you want?

I can't look at the code, it doesn't do what you want

What can I look at to know what you want?

You have to post the xml you want

I tried to use XML::compile per your advise but I am getting stuck at the wsdl definition: Seems like the above declaration is expecting a local file? is there a way to define it as URL? -Thanks

Give it a file :) it wants a file, give it a file -- the WSDL isn't supposed to change frequently, so getting a file from local disk is better

But here is a hint from the docs

So, on purpose you must explicitly load the files you need from local disk! (of course, it is simple to find one-liners as work-arounds, but I will not tell you how! See XML::Compile::SOAP::FAQ)

Replies are listed 'Best First'.
Re^4: SOAP::Lite problem
by doqb (Initiate) on Oct 20, 2015 at 00:47 UTC
    Hello again :), here is the XML that the wsdl is expecting, I capture this from wireshark from another application:
    <?xml version="1 .0" encoding="UT F-8"?> <SOAP-ENV :Envelope xmlns: SOAP-ENV="http:/ /schemas.xmlsoap .org/soap/envelo pe/" xmlns:ns1=" http://www.huawei.com/bme/cbsint erface/common" xmlns:ns2="http:/ /www.huawei.com/bme/cbsinterface /cbs/accountmgr +" xmlns:ns3="http ://www.huawei.com/bme/cbsinterfa ce/cbs/accountmg +rmsg"> <SOAP-ENV: Body> <ns3:PaymentRequestMsg> <RequestHeader> <ns1: CommandId>Payment</ns1:CommandId> <ns1:Version>1< /ns1:Version> <ns1:TransactionId></ns1:TransactionId> <ns1:SequenceId>1</ns1:SequenceId> <ns1:RequestType>Event</ns1:RequestType> <ns1:SerialNo>eTopup_193</ns1:SerialNo> </RequestHeader> <PaymentRequest> <ns2:SubscriberNo>123</ns2:SubscriberNo> <ns2:PaymentAmt>100</ns2:PaymentAmt> <ns2:Pay mentMode>1001</ns2:PaymentMode> </PaymentRequest> </ns3:PaymentRequestMsg> </SOAP-ENV:Body> </SOAP-E NV:Envelope>

      Ok, you're using  my $result = $soap->Payment(@data); but you're expecting the xml to say PaymentRequestMsg, well you have to use ->PaymentRequestMsg for that to happen

      Does that get you closer?

        #!/usr/bin/perl -- use strict; use warnings; use SOAP::Lite +trace => 'debug', readable => 1; my $soap = SOAP::Lite -> uri('http://127.0.0.1/MyModule') -> proxy('http://127.0.0.1:1203') ;;;;;;;;; $soap->ns( "http://www.huawei.com/bme/cbsinterface/common" => 'ns1' ); $soap->ns( "http://www.huawei.com/bme/cbsinterface/cbs/accountmgr" => +'ns2' ); $soap->ns( "http://www.huawei.com/bme/cbsinterface/cbs/accountmgrmsg" + => 'ns3',); $soap->envprefix('SOAP-ENV'); my @data = SOAP::Data->name("RequestHeader" => \SOAP::Data->value( SOAP::Data->name("CommandId" => 'Payment')->prefix('ns1'), SOAP::Data->name("Version" => '1')->prefix('ns1'), SOAP::Data->name("TransactionId" => '')->prefix('ns1'), SOAP::Data->name("SequenceId" => '1')->prefix('ns1'), SOAP::Data->name("RequestType" => 'Event')->prefix('ns1'), SOAP::Data->name("SerialNo" => 'USSD_00000001')->prefix('ns1'), ) ); push (@data, SOAP::Data->name("PaymentRequest" => \SOAP::Data->value( SOAP::Data->name("SubscriberNo" => '123')->prefix('ns2'), SOAP::Data->name("PaymentAmt" => 100)->prefix('ns2'), SOAP::Data->name("PaymentMode" => 1001)->prefix('ns2'), ) )); my $result = $soap->PaymentRequestMsg(@data); __END__ $ perl soap-lite-1145282.pl SOAP::Transport::HTTP::Client::send_receive: POST http://127.0.0.1:120 +3 HTTP/1.1 Accept: text/xml Accept: multipart/* Accept: application/soap Content-Length: 1380 Content-Type: text/xml; charset=utf-8 SOAPAction: "http://www.huawei.com/bme/cbsinterface/cbs/accountmgrmsg# +PaymentRequestMsg" <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.huawei.com/bme/cbsinterface/common" xmlns:ns2="http://www.huawei.com/bme/cbsinterface/cbs/accountmgr" xmlns:ns3="http://www.huawei.com/bme/cbsinterface/cbs/accountmgrms +g" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <ns3:PaymentRequestMsg> <RequestHeader> <ns1:CommandId xsi:type="xsd:string">Payment</ns1:CommandId> <ns1:Version xsi:type="xsd:int">1</ns1:Version> <ns1:TransactionId xsi:type="xsd:string" /> <ns1:SequenceId xsi:type="xsd:int">1</ns1:SequenceId> <ns1:RequestType xsi:type="xsd:string">Event</ns1:RequestType> <ns1:SerialNo xsi:type="xsd:string">USSD_00000001</ns1:SerialN +o> </RequestHeader> <PaymentRequest> <ns2:SubscriberNo xsi:type="xsd:int">123</ns2:SubscriberNo> <ns2:PaymentAmt xsi:type="xsd:int">100</ns2:PaymentAmt> <ns2:PaymentMode xsi:type="xsd:int">1001</ns2:PaymentMode> </PaymentRequest> </ns3:PaymentRequestMsg> </SOAP-ENV:Body> </SOAP-ENV:Envelope> SOAP::Transport::HTTP::Client::send_receive: 500 Can't connect to 127. +0.0.1:1203 Content-Type: text/plain Client-Date: Tue, 20 Oct 2015 01:56:11 GMT Client-Warning: Internal response Can't connect to 127.0.0.1:1203 No connection could be made because the target machine actively refuse +d it. at .../site/lib/LWP/Protocol/http.pm line 47. 500 Can't connect to 127.0.0.1:1203 at soap-lite-1145282.pl line 40.