Php 错误SoapFault异常:[HTTP]禁止
请帮我解决这个问题。我只想测试这个示例web服务 错误:Php 错误SoapFault异常:[HTTP]禁止,php,soap,Php,Soap,请帮我解决这个问题。我只想测试这个示例web服务 错误: 3 add 4=SoapFault异常:[HTTP]在..soap-client-2.php:14堆栈跟踪:#0[内部函数]:SoapClient->_-doRequest(''调用('getResult',数组)#2../soap-client-2.php(14):SoapClient->getResult('add',3,4)#3{main} 客户: <?php phpinfo(); // Désactivation d
3 add 4=SoapFault异常:[HTTP]在..soap-client-2.php:14堆栈跟踪:#0[内部函数]:SoapClient->_-doRequest(''调用('getResult',数组)#2../soap-client-2.php(14):SoapClient->getResult('add',3,4)#3{main} 客户:
<?php
phpinfo();
// Désactivation du cache WSDL
ini_set("soap.wsdl_cache_enabled", "0");
$options = array("trace" => true);
$client = new SoapClient("operation.wsdl", $options);
try {
$operation = "add";
$integer1 = 3;
$integer2 = 4;
echo "$integer1 $operation $integer2 = ";
echo $client->getResult($operation, $integer1, $integer2);
print "<pre>\n";
print "Request :\n".htmlspecialchars($client->__getLastRequest()) ."\n";
print "Response:\n".htmlspecialchars($client->__getLastResponse())."\n";
print "</pre>";
} catch (SoapFault $exception) {
echo $exception;
}
?>
服务器
<?xml version ='1.0' encoding ='UTF-8' ?>
<definitions name='getResult'
targetNamespace='http://example.org/getResult'
xmlns:tns='http://example.org/getResult'
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'
xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/'
xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'
xmlns='http://schemas.xmlsoap.org/wsdl/'>
<message name='getResultRequest'>
<part name='operation' type='xsd:string'/>
<part name='integer1' type='xsd:int'/>
<part name='integer2' type='xsd:int'/>
</message>
<message name='getResultResponse'>
<part name='result' type='xsd:string'/>
</message>
<portType name='getResultPortType'>
<operation name='getResult'>
<input message='tns:getResultRequest'/>
<output message='tns:getResultResponse'/>
</operation>
</portType>
<binding name='getResultBinding' type='tns:getResultPortType'>
<soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
<operation name='getResult'>
<soap:operation soapAction='urn:xmethods-delayed-quotes#getResult'/>
<input>
<soap:body use='encoded' namespace='urn:xmethods-delayed-calcul'
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
</input>
<output>
<soap:body use='encoded' namespace='urn:xmethods-delayed-calcul'
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
</output>
</operation>
</binding>
<service name='getResult'>
<port name='getResultPort' binding='getResultBinding'>
<soap:address location='http://............../soap-server-2.php'/>
</port>
</service>
</definitions>
SoapFault异常:[HTTP]在..soap-client-2.php:14堆栈跟踪:#0[内部函数]:SoapClient->doRequest(''u call('getResult',Array)#2../soap-client-2.php(14):SoapClient->getResult('add',3,4)#3{main}抱歉,这是与web服务的通信错误
<?xml version ='1.0' encoding ='UTF-8' ?>
<definitions name='getResult'
targetNamespace='http://example.org/getResult'
xmlns:tns='http://example.org/getResult'
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'
xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/'
xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'
xmlns='http://schemas.xmlsoap.org/wsdl/'>
<message name='getResultRequest'>
<part name='operation' type='xsd:string'/>
<part name='integer1' type='xsd:int'/>
<part name='integer2' type='xsd:int'/>
</message>
<message name='getResultResponse'>
<part name='result' type='xsd:string'/>
</message>
<portType name='getResultPortType'>
<operation name='getResult'>
<input message='tns:getResultRequest'/>
<output message='tns:getResultResponse'/>
</operation>
</portType>
<binding name='getResultBinding' type='tns:getResultPortType'>
<soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
<operation name='getResult'>
<soap:operation soapAction='urn:xmethods-delayed-quotes#getResult'/>
<input>
<soap:body use='encoded' namespace='urn:xmethods-delayed-calcul'
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
</input>
<output>
<soap:body use='encoded' namespace='urn:xmethods-delayed-calcul'
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
</output>
</operation>
</binding>
<service name='getResult'>
<port name='getResultPort' binding='getResultBinding'>
<soap:address location='http://............../soap-server-2.php'/>
</port>
</service>
</definitions>