带有身份验证的php soap请求和响应

带有身份验证的php soap请求和响应,php,web-services,soap,Php,Web Services,Soap,这是一个soap请求和响应 我收到以下错误消息,但我不明白是什么错了: 致命错误:未捕获的SoapFault异常:[soap:客户端]服务器无法读取请求。-->XML文档(2570)中存在错误。-->字符串“2016-02-24 11:14:15.638276”不是有效的AllXsd值。在test.php:19堆栈跟踪中:#0 test.php(19):SoapClient->u调用('CreateVehicleIn…',数组)#1 test.php(19):SoapClient->Create

这是一个soap请求和响应

我收到以下错误消息,但我不明白是什么错了:


致命错误:未捕获的SoapFault异常:[soap:客户端]服务器无法读取请求。-->XML文档(2570)中存在错误。-->字符串“2016-02-24 11:14:15.638276”不是有效的AllXsd值。在test.php:19堆栈跟踪中:#0 test.php(19):SoapClient->u调用('CreateVehicleIn…',数组)#1 test.php(19):SoapClient->CreateVehicleInsurancePolicy(数组)#2{main}在第19行的test.php中抛出

这是一个发布保险单的web应用程序,当时我们希望连接到web服务器

请求:

<?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>
    <SoapHeaderIn xmlns="http://adpolice.gov.ae/TrafficInsurance/TrafficInsuranceServices.asmx">
      <userName>string</userName>
      <Password>string</Password>
    </SoapHeaderIn>
  </soap:Header>
  <soap:Body>
    <CreateVehicleInsurancePolicy xmlns="http://adpolice.gov.ae/TrafficInsurance/TrafficInsuranceServices.asmx">
      <lngInsuranceCompanyCode>long</lngInsuranceCompanyCode>
      <intInsuranceKindCode>int</intInsuranceKindCode>
      <lngTcf>long</lngTcf>
      <strPolicyNo>string</strPolicyNo>
      <dtExpiryDate>dateTime</dtExpiryDate>
      <dtStartDate>dateTime</dtStartDate>
      <strChassisNo>string</strChassisNo>
      <strRemarks>string</strRemarks>
      <strUserCreated>string</strUserCreated>
    </CreateVehicleInsurancePolicy>
  </soap:Body>
</soap:Envelope>

一串
一串
长的
int
长的
一串
日期时间
日期时间
一串
一串
一串
答复:

<?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>
    <SoapHeaderOut xmlns="http://adpolice.gov.ae/TrafficInsurance/TrafficInsuranceServices.asmx">
      <intResponseCode>int</intResponseCode>
      <strArMsg>string</strArMsg>
      <strEnMsg>string</strEnMsg>
    </SoapHeaderOut>
  </soap:Header>
  <soap:Body>
    <CreateVehicleInsurancePolicyResponse xmlns="http://adpolice.gov.ae/TrafficInsurance/TrafficInsuranceServices.asmx">
      <CreateVehicleInsurancePolicyResult>
        <intFLSCode>int</intFLSCode>
        <strFlsDescAr>string</strFlsDescAr>
        <strFlsDescEn>string</strFlsDescEn>
        <lngSerial>long</lngSerial>
        <lngTrafficID>long</lngTrafficID>
      </CreateVehicleInsurancePolicyResult>
    </CreateVehicleInsurancePolicyResponse>
  </soap:Body>
</soap:Envelope>

int
一串
一串
int
一串
一串
长的
长的
我的代码:

<?php
class SOAPStruct
{
    function __construct($user, $pass) 
    {
        $this->Username = $user;
        $this->Password = $pass;
    }
}

$service = new SoapClient("https://es.adpolice.gov.ae/TrafficInsurance/TrafficInsuranceServicesNew.asmx?wsdl");

$auth = new SOAPStruct("****","*****");

$header = new SoapHeader("http://adpolice.gov.ae/TrafficInsurance/TrafficInsuranceServices.asmx","SoapHeaderIn",$auth,false); 

$service->__setSoapHeaders($header);   

$response = $service->CreateVehicleInsurancePolicy(array('lngInsuranceCompanyCode' => '71','intInsuranceKindCode'=>'123','lngTcf'=>'2563214','strPolicyNo'=>'10002356','dtExpiryDate'=>'2016-02-24 11:14:15.638276','dtStartDate'=>'2015-03-25 11:14:15.638276','strChassisNo'=>'WVWZZZ3AZRE161907','strRemarks'=>'demo','strUserCreated'=>'demo'));
var_dump($response);
?>

我试图访问此web服务,但出现错误


我不熟悉SOAP请求,所以我被卡住了。

欢迎再次使用新帐户返回并再次使用stackoverflow。:)您没有尝试我给您的吗?请告诉我们您遇到了什么错误。致命错误:未捕获的SoapFault异常:[soap:客户端]服务器无法读取请求。-->XML文档(2570)中存在错误。-->字符串“2016-02-24 11:14:15.638276”不是有效的AllXsd值。在test.php:19堆栈跟踪中:#0 test.php(19):SoapClient->uu调用('CreateVehicleIn…',Array)#1 test.php(19):SoapClient->CreateVehicleInsurancePolicy(Array)#2{main}抛出test.php第19行,现在我更改日期时间和错误,如“object(stdClass)#4(0){}”