use SOAP::Lite +trace => all; $soap = SOAP::Lite -> uri('http://www.webservicex.net') -> on_action( sub { join '/', 'http://www.webserviceX.NET', $_[1] +} ) -> proxy('http://www.webservicex.net/globalweather.asmx'); my $method = SOAP::Data->name('GetCitiesByCountry') ->attr({xmlns => 'http://www.webserviceX.NET/'}); my $param = SOAP::Data->name("CountryName" =>"India"); $result= $soap->call($method,$param)->result();
Even though i am passing the parameter "CountryName" it gives an exception on it. I have observed that the soap requests generated by the above code are in the following format
where as the the the example soap request is in the following format<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:xsi="ht +tp://www.w3.org/1999/XMLSchema-instance" xmlns:SOAP-ENC="http://schem +as.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap +.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOA +P-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP +-ENV:Body><GetCitiesByCountry xmlns="http://www.webserviceX.NET/"><Co +untryName xsi:type="xsd:string">India</CountryName></GetCitiesByCount +ry></SOAP-ENV:Body></SOAP-ENV:Envelope>
Could you please help on this.. Regards, SivaPOST /globalweather.asmx HTTP/1.1 Host: www.webservicex.net Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "http://www.webserviceX.NET/GetCitiesByCountry" <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" x +mlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schema +s.xmlsoap.org/soap/envelope/"> <soap:Body> <GetCitiesByCountry xmlns="http://www.webserviceX.NET"> <CountryName>string</CountryName> </GetCitiesByCountry> </soap:Body> </soap:Envelope>
In reply to Accessing .Net Web Service by cs3p
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |