3
현재 SOAP RPC/Literal 기반 웹 서비스를 제공하려고합니다.
여기 내 WSDL 파일입니다 : 나는 모든 것이 정확 생각RPC/Literal 프로 시저가 존재하지 않습니다.
<?xml version="1.0" encoding="iso-8859-1"?>
<!--WSDL genere permettant de decrire le service web.-->
<!--Partie 1 : Definitions-->
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" name="WSDL" targetNamespace="http://soap.mycompany.org/wsdl/" xmlns:typens="http://soap.mycompany.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<!--partie 2 : Types-->
<types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://soap.mycompany.org/wsdl/">
<xsd:complexType name="calculatorAuthInput">
<xsd:annotation>
<xsd:documentation>^CSoapHandler-calculatorAuth^</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="operation" type="xsd:string">
<xsd:annotation>
<xsd:documentation>^CSoapHandler-calculatorAuth-operation^</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="entier1" type="xsd:integer">
<xsd:annotation>
<xsd:documentation>^CSoapHandler-calculatorAuth-entier1^</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="entier2" type="xsd:integer">
<xsd:annotation>
<xsd:documentation>^CSoapHandler-calculatorAuth-entier2^</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="calculatorAuthOutput">
<xsd:sequence>
<xsd:element name="result" type="xsd:integer">
<xsd:annotation>
<xsd:documentation>^CSoapHandler-calculatorAuth-result^</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</types>
<!--partie 3 : Message-->
<message name="calculatorAuthRequest">
<part name="parameters" type="typens:calculatorAuthInput"/>
</message>
<message name="calculatorAuthResponse">
<part name="parameters" type="typens:calculatorAuthOutput"/>
</message>
<!--partie 4 : Port Type-->
<portType name="MyPort">
<!--partie 5 : Operation-->
<operation name="calculatorAuth">
<input message="typens:calculatorAuthRequest"/>
<output message="typens:calculatorAuthResponse"/>
</operation>
</portType>
<!--partie 6 : Binding-->
<binding name="MyBinding" type="typens:MyPort">
<soap:binding xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="calculatorAuth">
<soap:operation xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" soapAction=""/>
<input name="calculatorAuthRequest">
<soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/>
</input>
<output name="calculatorAuthResponse">
<soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/>
</output>
</operation>
</binding>
<!--Partie 7 : Service-->
<service name="MyService">
<documentation>Documentation du WebService</documentation>
<!--partie 8 : Port-->
<port name="MyPort" binding="typens:MyBinding">
<soap:address xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" location="http://localhost/mywebsite/?login=1&username=myusername&password=mypassword&m=webservices&a=soap_server&class=CSoapHandler&suppressHeaders=1"/>
</port>
</service>
</definitions>
하지만 내 SOAP 클라이언트를 시작할 때이 오류가없는 때문에 (내가 soapUI와 같은 오류가) 나타납니다 :
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>Procedure 'calculatorAuth' not present</faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
을 내 절차가 발견되지 않는 이유를 이해가 안
<?php
// Désactivation du cache WSDL
ini_set("soap.wsdl_cache_enabled", "0");
$client = new SoapClient("http://localhost/mywebsite/index.php?login=myusername:mypassword=webservices&a=soap_server&class=CSoapHandler&wsdl&wsdl_mode=CWSDLRPCLiteral", array("trace" => true));
try {
echo "<pre>";
$res = $client->calculatorAuth(array("operation" => "add", "entier1" => 888, "entier2" => 987654321));
print_r($res);
}
catch (SoapFault $e) {
echo $e;
}
?>
:
은 여기 내 SOAP 클라이언트 예제 코드입니다. 나는 내 WSDL에서 문제가있는 곳을 찾기 위해 수 시간을 허비했다.
아직이 기술에서 실제로 실험되지는 않았지만 누군가가 내게 외부 시각을 줄 수 있습니까?