我的WSDL中有以下定义
<wsdl:types>
<xs:schema targetNamespace="http://tryme.limes2.dev/interface/interface/schemas/types" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:l2="http://tryme.local.dev/interface/interface/schemas/types">
<xs:element name="AuthDataResponse">
<xs:annotation>
<xs:documentation>The response for authorization requests.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:all>
<xs:element ref="l2:SuccessResponse" minOccurs="1" maxOccurs="1">
<xs:annotation>
<xs:documentation>Success result.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="token" type="xs:string" minOccurs="1" maxOccurs="1">
<xs:annotation>
<xs:documentation>The token required for all actions.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
<xs:element name="SuccessResponse">
<xs:complexType>
<xs:all>
<xs:element name="message" type="xs:string" minOccurs="1" maxOccurs="1">
<xs:annotation>
<xs:documentation>The message returned by the server.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="success" type="xs:boolean" minOccurs="1" maxOccurs="1">
<xs:annotation>
<xs:documentation>Success result.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
...
(WSDL由IBM Enterprise Architect生成)
Zend_Soap_Server正在WSDL模式下运行并接受输入。我编写了一个小PHP函数,它应该需要一个AuthDataRequest并返回一个AuthDataResponse对象,带有一个令牌(string)和SuccessResponse对象。
我从服务器获得的响应是:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://tryme.local.dev/interface/interface/schemas/types">
<SOAP-ENV:Body>
<ns1:AuthDataResponse>
<SuccessResponse>
<message/>
<success>true</success>
</SuccessResponse>
<token>xVzSFnC5LmqJ4sNG</token>
</ns1:AuthDataResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
SoapUIs Schema Compliance测试失败,因为它提供 SuccessResponse 而不是 ns1:SuccessResponse 。 这究竟出了什么问题? 您还需要其他信息吗?
亲切的问候, tim3trick