有时脚本会向我返回500。我创建脚本并返回 就是这样:
use strict;
use SOAP::Lite +trace => 'debug';
my $user="dsa";
my $pass="9das";
my $soap = SOAP::Lite->uri('http://localhost/' )->proxy('http://localhost/', timeout => 1000 )->service('http://oteapi.netim.com/1.5/api.wsdl' );
my $sessionId;
$sessionId = $soap->login($user, $pass, "EN");
SOAP::Transport::HTTP::Client::send_receive: POST http://oteapi.netim.com/1.5/ HTTP/1.1
Accept: text/xml
Accept: multipart/*
Accept: application/soap
Content-Length: 607
Content-Type: text/xml; charset=utf-8
SOAPAction: "loginAction"
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:typens="urn:DRS" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body><typens:login><idReseller xsi:type="xsd:string">Someid</idReseller><password xsi:type="xsd:string">password</password><language xsi:type="xsd:string">EN</language></typens:login></soap:Body></soap:Envelope>
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal Service Error
Connection: close
Date: Mon, 13 Jul 2015 03:33:26 GMT
Server: nginx/1.2.1
Vary: Accept-Encoding
Content-Length: 289
Content-Type: text/xml; charset=utf-8
Client-Date: Mon, 13 Jul 2015 03:33:26 GMT
Client-Peer: 185.26.104.130:80
Client-Response-Num: 1
X-Powered-By: PHP/5.3.3-7+squeeze19
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:VersionMismatch</faultcode><faultstring>Wrong Version</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
问题是我的脚本有时会返回500个代码,有时还会返回200个代码