我们得到了以下内容xml
,需要翻译成 Perl。
POST /carrierintegrationapi.asmx HTTP/1.1
Host: carrierintegrationapi.3tlogistics.net
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://carrierintegrationapi.3tlogistics.net/Login"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<CiSoapHeader xmlns="https://carrierintegrationapi.3tlogistics.net/">
<Username>cccict</Username>
<Password>xxxxxx</Password>
<AuthenticationToken>string</AuthenticationToken>
</CiSoapHeader>
</soap:Header>
<soap:Body>
<Login xmlns="https://carrierintegrationapi.3tlogistics.net/" />
</soap:Body>
</soap:Envelope>';
我们的尝试:
my $service = SOAP::Lite
-> service ('https://carrierintegrationapi.3tlogistics.net/carrierintegrationapi.asmx');
my $AuthHeader = SOAP::Header->new(
name =>'AuthenticationHeader',
attr => { xmlns => "https://carrierintegrationapi.3tlogistics.net/" },
value => {Username => 'cccict', Password => 'xxxxxx' },
);
my $result = $service->GetIt($AuthHeader);
我们得到不匹配的标签parser.pm
?