我正在尝试连接到SOAP服务器并从名为的方法中调用一个: 的 GetContactPerson
为了测试我正在使用为我生成示例请求的SoapUI:
<soap:Header/>
<soap:Body>
<v2:GetReferencedDataRequest version="2.0.0">
<v2:authentication>USERNAME:PASSWORD</v2:authentication>
<!--Optional:-->
<v2:payload>
<!--Optional:-->
<v2:extensionPoint>WHATS SHOULD I PUT HERE ?</v2:extensionPoint>
</v2:payload>
</v2:GetReferencedDataRequest>
</soap:Body>
发送该请求后服务器的响应:
Could not unmarshal SOAP message due to invalid request: Unable to create an
instance of *.model.v20.PayloadType
我知道这是一个错误,但我不知道我在标签之间发出了什么样的喊叫:<v2:extensionPoint>
从文档XSD我有:
<xsd:complexType name="PayloadType" abstract="true">
<xsd:annotation>
<xsd:documentation xml:lang="en">The payload is the base type of the business content of a request or response.</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="extensionPoint" type="xsd:anyType" minOccurs="0">
<xsd:annotation>
<xsd:documentation xml:lang="en">Generic extension point</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
好的,但现在我正在尝试从PHP发送请求。
首先我是开火方法:$client->__getFunctions();
结果:
GetContactPersonResponse GetContactPerson(GetContactPersonRequest $GetContactPersonRequest)
来自文档:
<xsd:element name="GetContactPersonRequest">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="GetCustomerReferencingEntityRequestType"/>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
E.q代码:
$client = new SoapClient( $wsdlAddress, [
'login' => 'PlainText',
'password' => 'PlanText',
'soap_version' => SOAP_1_2
] );
$someTest = $client->GetContactPerson( $params );
如何从php正确创建请求?
如何创建$params
类型的GetContactPersonRequest
?