这真让我烦恼,所以任何帮助都会很棒。对getTerminalEntry的调用总是返回正常,但是对updateTicketPrinted的调用永远不会,并且我甚至使两个函数在它们返回的内容中彼此相同并作为参数。使用is_soap_fault()方法或任何其他方法也不会显示错误。
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
targetNamespace='http://10.1.10.187/api'
xmlns:tns=' http://10.1.10.187/api'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'
xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'
xmlns='http://schemas.xmlsoap.org/wsdl/'
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:impl="http://10.1.10.187/api">
<wsdl:message name="getTerminalEntryResponse">
<wsdl:part name="entryResponse" type="xsd:string">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getTerminalEntryRequest">
<wsdl:part name="terminalId" type="xsd:string">
</wsdl:part>
</wsdl:message>
<wsdl:message name="updateTicketPrintedResponse">
<wsdl:part name="ticketResponse" type="xsd:string">
</wsdl:part>
</wsdl:message>
<wsdl:message name="updateTicketPrintedRequest">
<wsdl:part name="ticketId" type="xsd:string">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="TerminalApi">
<wsdl:operation name="getTerminalEntry">
<wsdl:input message="impl:getTerminalEntryRequest" name="getTerminalEntryRequest">
</wsdl:input>
<wsdl:output message="impl:getTerminalEntryResponse" name="getTerminalEntryResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="updateTicketPrinted">
<wsdl:input message="impl:updateTicketPrintedRequest" name="updateTicketPrintedRequest">
</wsdl:input>
<wsdl:output message="impl:updateTicketPrintedResponse" name="updateTicketPrintedResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="TerminalApiBinding" type="impl:TerminalApi">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getTerminalEntry">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getTerminalEntryRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://10.1.10.187/api" use="encoded"/>
</wsdl:input>
<wsdl:output name="getTerminalEntryResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://10.1.10.187/api" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="updateTicketPrinted">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="updateTicketPrintedRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://10.1.10.187/api" use="encoded"/>
</wsdl:input>
<wsdl:output name="updateTicketPrintedResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://10.1.10.187/api" use="encoded"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="TerminalApi">
<wsdl:port binding="impl:TerminalApiBinding" name="TerminalApi">
<wsdlsoap:address location="http://10.1.10.187/api_alistair/api/index.php/api"/>
</wsdl:port>
</wsdl:service>
<?php
$client = new SoapClient("http://10.1.10.187/api_alistair/terminal.wsdl");
$catalogId='catalog2';
$result = $client->getTerminalEntry($catalogId);
$result2 = $client->updateTicketPrinted($catalogId);
echo $result;
if (is_soap_fault($result2)) {
trigger_error("SOAP Fault: (faultcode: {$result->faultcode}, faultstring: {$result->faultstring})", E_USER_ERROR);
}else{
echo $result2;
}
&GT;
任何帮助都会很棒。感谢。
UPDATE 随着php中的错误报告我得到:
Fatal error: Uncaught SoapFault exception: [Client] Function ("updateTicketPrinted") is not a valid method for this service in /sites/api_alistair/soap-client.php:7 Stack trace: #0 /sites/api_alistair/soap-client.php(7): SoapClient->__call('updateTicketPri...', Array) #1 /sites/api_alistair/soap-client.php(7): SoapClient->updateTicketPrinted('catalog2') #2 {main} thrown in /sites/api_alistair/soap-client.php on line 7
答案 0 :(得分:3)
尝试禁用缓存:
ini_set("soap.wsdl_cache_enabled", "0");
或使用__getFunctions()查看可用的方法: