2011-09-20 3 views
2

PHP SoapClient에서 읽을 샘플 wsdl 파일을 만들려고합니다. 내 wsdl 문서 일종의이 작동하더라도 (함수가 올바르게 반환 됨) PHP의 __getFunctions 방법은 다음과 리턴 아직하지 못하기 때문에이 함수에 의해 반환 된 것과PHP SoapClient 알 수없는 타입을 반환하는 __getFunctions()

array(1) { [0]=> string(35) "UNKNOWN getDocument(UNKNOWN $input)" } 

유형으로 UNKNOWN 보이고있다으로 유형 정의가 100 % 정확하지 않은 것 같다.

<?xml version="1.0"?> 
<definitions name="Document" targetNamespace="urn:Document" xmlns:tns="urn:Document"  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/" xmlns="http://schemas.xmlsoap.org/wsdl/"> 
<types> 
    <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:Document"> 
    <xsd:element name="InputUserType" type="xsd:string" /> 
    <xsd:element name="DocumentResponseType" type="xsd:string" />   
    </xsd:schema>   
</types> 

<message name="getDocumentInputUser"> 
    <part name="input" type="tns:InputUserType" /> 
</message> 

<message name="getDocumentResponse"> 
    <part name="return" type="tns:DocumentResponseType" /> 
</message> 

<portType name="DocumentPort"> 
    <operation name="getDocument"> 
     <input message="tns:getDocumentInputUser" /> 
     <output message="tns:getDocumentResponse" /> 
    </operation> 
</portType> 

<binding name="DocumentBinding" type="tns:DocumentPort"> 
    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" /> 
    <operation name="getDocument"> 
     <soap:operation soapAction="urn:DocumentAction" /> 
     <input> 
      <soap:body use="encoded" namespace="urn:Document" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />   
     </input> 
     <output> 
      <soap:body use="encoded" namespace="urn:Document" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />   
     </output> 
    </operation>  
</binding> 

<service name="DocumentService"> 
    <port name="DocumentPort" binding="tns:DocumentBinding"> 
     <soap:address location="http://www.apollo.co.za/soap/test2server.php" /> 
    </port> 
</service> 

</definitions> 

하나의 작업 "getDocument"가있는 간단한 wsdl 문서를 정의하려고합니다.이 문서에서는 사용자 이름 문자열 매개 변수를 사용하고 문자열 결과를 반환합니다. 나는 SOAP에 익숙하지 않고 그립을 잡기 위해 약간 고심하고 있기 때문에 누군가 내 wsdl 정의에서 잘못된 점을 지적 할 수 있다면 정말 고맙겠습니다.

+0

내가 같은 직면하고

에서이 예 도움이 희망, 여기 내가 사용하는 하나 문제. 이 XML 파일의 위치를 ​​알려주십시오. –

답변

3

시도 유형 = 대신 유형 = "TNS : InputUserType"의 'XSD 문자열'

<?xml version='1.0' encoding='UTF-8' ?> 
<definitions name='AddWidget' 
    targetNamespace='urn:ANYTHINGHEREAddWidget' 
    xmlns:tns='urn:ANYTHINGHEREAddWidget' 
    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='AddWidgetRequest'> 
    <part name='Auth_Username' type='xsd:string'/> 
    <part name='Auth_Password' type='xsd:string'/> 
    <part name='Widget_Name' type='xsd:string'/> 
    <part name='Widget_Description' type='xsd:string'/> 
</message> 
<message name='AddWidgetResponse'> 
    <part name='Result' type='xsd:string'/> 
</message> 

<portType name='AddWidgetPortType'> 
    <operation name='AddWidget'> 
    <input message='tns:AddWidgetRequest'/> 
    <output message='tns:AddWidgetResponse'/> 
    </operation> 
</portType> 

<binding name='AddWidgetBinding' type='tns:AddWidgetPortType'> 
    <soap:binding style='rpc' 
    transport='http://schemas.xmlsoap.org/soap/http'/> 
    <operation name='AddWidget'> 
    <soap:operation soapAction='urn:xmethods-delayed-quotes#AddWidget'/> 
    <input> 
     <soap:body use='encoded' namespace='urn:xmethods-delayed-quotes' 
     encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> 
    </input> 
    <output> 
     <soap:body use='encoded' namespace='urn:xmethods-delayed-quotes' 
     encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> 
    </output> 
    </operation> 
</binding> 

<service name='AddWidgetService'> 
    <port name='AddWidgetPort' binding='tns:AddWidgetBinding'> 
    <soap:address location='https://www.yoursite.com/en/Soap_Server.html'/> 
    </port> 
</service> 
</definitions> 
+0

예제가 도움이됩니다. 그리고 당신이 추천 한 변화가 자리를 잡았습니다. __getFunctions()의 결과가 더 좋아 보인다. 도와 줘서 고마워, 찰리. – BruceHill

+0

나는 또한 똑같은 문제에 직면 해있다. 이 XML 파일의 위치를 ​​알려주십시오. - @ Charlie –

관련 문제