我正在尝试执行肥皂请求,该请求成功地在邮递员上工作。我总是出错。你能检查我的代码吗?
代码:
require_once('libs/nusoap/lib/nusoap.php');
$endpoint = "http://www.holidaywebservice.com/HolidayService_v2/HolidayService2.asmx?wsdl";
$soap_request .= "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'>";
$soap_request .= " <soapenv:Body>";
$soap_request .= " <GetHolidaysAvailable xmlns='http://www.holidaywebservice.com/HolidayService_v2/'>";
$soap_request .= " <countryCode xmlns='http://www.holidaywebservice.com/HolidayService_v2/'>UnitedStates</countryCode>";
$soap_request .= " </GetHolidaysAvailable>";
$soap_request .= " </soap:Body>";
$soap_request .= "</soap:Envelope>";
$client = new nusoap_client($endpoint, false);
$msg = $client->serializeEnvelope($soap_request);
$result=$client->send($msg, $endpoint);
print_r($result);
错误:
Array([faultcode] => soap:Client [faultstring] => System.Web.Services.Protocols.SoapException:服务器未在System.Web处识别HTTP标头SOAPAction:http://www.holidaywebservice.com/HolidayService_v2/HolidayService2.asmx?wsdl的值。 System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage消息)位于System.Web.Services.Protocols.SoapServerProtocol.Initialize()处于System.Web.Services.Proapcols.ServerProtocolFactory的Services.Protocols.Soap11ServerProtocolHelper.RouteRequest()。 Create(Type type,HttpContext context,HttpRequest request,HttpResponse response,Boolean&abortProcessing)[详细信息=>)
在邮递员中,一切正常