Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
用于复杂XML请求的PHP SOAP客户端_Php_Soap Client - Fatal编程技术网

用于复杂XML请求的PHP SOAP客户端

用于复杂XML请求的PHP SOAP客户端,php,soap-client,Php,Soap Client,我正在尝试使用以下XML创建请求: <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <

我正在尝试使用以下XML创建请求:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<VertexEnvelope xmlns="urn:vvvvvvvv:o-series:tps:8:0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:vvvvvvv:o-series:tps:8:0 vvvvvv_Envelope.xsd">
         <Login>
            <UserName>xxxxxxx</UserName>
            <Password>xxxxxxxx</Password>
         </Login>
         <QuotationRequest documentDate="2018-02-07" transactionType="SALE">
  <Currency isoCurrencyCodeAlpha="USD"/>
  <Seller>
    <Company>2</Company>
    <Division>340</Division>
  </Seller>
  <Customer>
    <Destination taxAreaId="230132823">
      <City>BARAGA</City>
      <MainDivision>MI</MainDivision>
      <PostalCode>49908-9204</PostalCode>
    </Destination>
  </Customer>
  <LineItem lineItemNumber="1">
    <Seller>
      <PhysicalOrigin taxAreaId="261835449">
        <City>ST. CHARLES</City>
        <MainDivision>MO</MainDivision>
        <PostalCode>63301</PostalCode>
      </PhysicalOrigin>
    </Seller>
    <Customer>
      <CustomerCode classCode="20683"/>
    </Customer>
    <Product productClass="143"/>
    <Quantity>1</Quantity>
    <UnitPrice>6.95</UnitPrice>
    <FlexibleFields>
      <FlexibleCodeField fieldId="7">SP STD</FlexibleCodeField>
    </FlexibleFields>
  </LineItem>
  <LineItem lineItemNumber="2">
    <Customer>
      <CustomerCode classCode="20683"/>
    </Customer>
    <Product productClass="276"/>
    <Quantity>1</Quantity>
    <UnitPrice>2</UnitPrice>
  </LineItem>
</QuotationRequest>
</VertexEnvelope>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
我得到的结果是:

args
Array ( [0] => SoapVar Object ( [enc_type] => 147 [enc_value] =>  username password  2 340  BARAGA MI 49908-9204   ST. CHARLES MO 63301    1 6.95 SP STD    1 2      ) ) 
错误信息为:

string(9) "SoapFault" object(SoapFault)#5 (10) { ["message":protected]=> string(30) "java.lang.NullPointerException" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(50) "/soapservices/xxxxxx05.php" ["line":protected]=> int(103) ["trace":"Exception":private]=> array(2) { [0]=> array(6) { ["file"]=> string(50) "//soapservices/xxxxxx05.php" ["line"]=> int(103) ["function"]=> string(6) "__call" ["class"]=> string(10) "SoapClient" ["type"]=> string(2) "->" ["args"]=> array(2) { [0]=> string(14) "calculateTax80" [1]=> array(1) { [0]=> string(1570) " xxxxxxxx xxxxxx  2 340  BARAGA MI 49908-9204   ST. CHARLES MO 63301    1 6.95 SP STD    1 2     " } } } [1]=> array(6) { ["file"]=> string(50) "/var/www/html/ecommerce/soapservices/testphp05.php" ["line"]=> int(103) ["function"]=> string(14) "calculateTax80" ["class"]=> string(10) "SoapClient" ["type"]=> string(2) "->" ["args"]=> array(1) { [0]=> string(1570) " xxxxxxx xxxxx  2 340  BARAGA MI 49908-9204   ST. CHARLES MO 63301    1 6.95 SP STD    1 2     " } } } ["previous":"Exception":private]=> NULL ["faultstring"]=> string(30) "java.lang.NullPointerException" ["faultcode"]=> string(14) "soapenv:Server" ["detail"]=> object(stdClass)#3 (1) { ["vvvvvException"]=> object(stdClass)#4 (2) { ["exceptionType"]=> string(20) "NullPointerException" ["rootCause"]=> string(30) "java.lang.NullPointerException" } } } 

你能检查服务器端日志吗?还有,“我正在使用wsdl方法”是什么意思?如果您有一个完整的SOAP消息,您应该将其作为RESTXML文档发布。在我看来,SOAP服务器是一个Java应用程序,其中有一个bug导致了使用空指针的异常。请首先检查服务器代码,您的PHP代码很可能没有bug。我无法访问服务器端日志。关于“WSDL”方法:我一直在搜索的许多站点都提到在SoapClient调用中使用WSDL url作为“WSDL”方法vs null,并在parms中定义连接如果我错了,请随意更正。我在SOAPUI中设置了一个测试,它在将位置修改为https后工作//WSDL指的是http://
string(9) "SoapFault" object(SoapFault)#5 (10) { ["message":protected]=> string(30) "java.lang.NullPointerException" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(50) "/soapservices/xxxxxx05.php" ["line":protected]=> int(103) ["trace":"Exception":private]=> array(2) { [0]=> array(6) { ["file"]=> string(50) "//soapservices/xxxxxx05.php" ["line"]=> int(103) ["function"]=> string(6) "__call" ["class"]=> string(10) "SoapClient" ["type"]=> string(2) "->" ["args"]=> array(2) { [0]=> string(14) "calculateTax80" [1]=> array(1) { [0]=> string(1570) " xxxxxxxx xxxxxx  2 340  BARAGA MI 49908-9204   ST. CHARLES MO 63301    1 6.95 SP STD    1 2     " } } } [1]=> array(6) { ["file"]=> string(50) "/var/www/html/ecommerce/soapservices/testphp05.php" ["line"]=> int(103) ["function"]=> string(14) "calculateTax80" ["class"]=> string(10) "SoapClient" ["type"]=> string(2) "->" ["args"]=> array(1) { [0]=> string(1570) " xxxxxxx xxxxx  2 340  BARAGA MI 49908-9204   ST. CHARLES MO 63301    1 6.95 SP STD    1 2     " } } } ["previous":"Exception":private]=> NULL ["faultstring"]=> string(30) "java.lang.NullPointerException" ["faultcode"]=> string(14) "soapenv:Server" ["detail"]=> object(stdClass)#3 (1) { ["vvvvvException"]=> object(stdClass)#4 (2) { ["exceptionType"]=> string(20) "NullPointerException" ["rootCause"]=> string(30) "java.lang.NullPointerException" } } }