PHP SoapClient __getFunctions () возвращает типы UNKNOWN

Я пытаюсь создать образец файла wsdl, который будет читаться PHP SoapClient, и хотя мой wsdl-файл сортировки работает (он возвращает функцию правильно), что-то по-прежнему не так, потому что метод __getFunctions PHP возвращает следующее:

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

Из того, что возвращается этой функцией, кажется, что определения типов не на 100% правильны, поскольку типы отображаются как UNKNOWN.

 <?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> 

Я пытаюсь определить простой документ wsdl, который имеет одну операцию «getDocument», которая принимает параметр строки имени пользователя и возвращает результат строки. Я очень новичок в SOAP и немного борюсь за то, чтобы справиться с этим, так что было бы очень полезно, если бы кто-то мог указать, что не так в моем определении wsdl.

Попробуйте type = 'xsd: string' вместо type = "tns: InputUserType"

В надежде, что примеры полезны, вот что я использую:

 <?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> пространство <?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>