From: Egor S. <soa...@sh...> - 2009-02-16 15:10:32
|
Hi everyone! I'm trying to get SOAP::Lite to generate proper XML to connect to channeladvisor.com SOAP interface which is known to be written in .NET In the simplest case (a ping request) what I'm aiming to get is this: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://api.channeladvisor.com/webservices/"> <soapenv:Header> <web:APICredentials> <web:DeveloperKey>XXXX</web:DeveloperKey> <web:Password>XXX</web:Password> </web:APICredentials> </soapenv:Header> <soapenv:Body> <web:Ping/> </soapenv:Body> </soapenv:Envelope> And here's what SOAP::Lite generates: <?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <Ping xmlns="http://api.channeladvisor.com/webservices" xsi:nil="true" /> </soap:Body> </soap:Envelope> My code is as as follows: my $ca = SOAP::Lite->new( service => 'channel_advisor.wsdl', proxy => 'https://api.channeladvisor.com/ChannelAdvisorAPI/v1/ShippingService.asmx', ); $ca->uri('http://api.channeladvisor.com/webservices'); $ca->on_action(sub { join '/', @_ }); # setup SOAPaction header for .NET Best regards, Egor Shipovalov. |