Zend_Soap_Client如何获取结果complexType
我正在尝试调用一个将复杂类型描述为输入和输出参数的 Web 服务
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
<s:element name="getTermsForService">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="universalid" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="getTermsForServiceResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="getTermsForServiceResult" type="tns:ArrayOfString" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="ArrayOfString">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="string" nillable="true" type="s:string" />
</s:sequence>
</s:complexType>
</s:schema>
</wsdl:types>
,
<wsdl:message name="getTermsForServiceSoapIn">
<wsdl:part name="parameters" element="tns:getTermsForService" >
</wsdl:message>
<wsdl:message name="getTermsForServiceSoapOut">
<wsdl:part name="parameters" element="tns:getTermsForServiceResponse" />
</wsdl:message>
<wsdl:portType name="Service1Soap">
<wsdl:operation name="getTermsForService">
<wsdl:input message="tns:getTermsForServiceSoapIn" />
<wsdl:output message="tns:getTermsForServiceSoapOut" />
</wsdl:operation>
</wsdl:portType>
我认为调用它会像以下一样简单:
$client = new Zend_Soap_Client($this->config->webserviceWsdlFile);
try {
$result = $client->getTermsForService($_GET['universalid']);
} catch (Exception $e) {
// @TODO catch correctly
var_dump($e);
}
但似乎并非如此。那么我该怎么做才能得到答案中包含字符串的正确结果......
I'm trying to call a webservice that has complexTypes described as input and output params
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
<s:element name="getTermsForService">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="universalid" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="getTermsForServiceResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="getTermsForServiceResult" type="tns:ArrayOfString" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="ArrayOfString">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="string" nillable="true" type="s:string" />
</s:sequence>
</s:complexType>
</s:schema>
</wsdl:types>
And
<wsdl:message name="getTermsForServiceSoapIn">
<wsdl:part name="parameters" element="tns:getTermsForService" >
</wsdl:message>
<wsdl:message name="getTermsForServiceSoapOut">
<wsdl:part name="parameters" element="tns:getTermsForServiceResponse" />
</wsdl:message>
<wsdl:portType name="Service1Soap">
<wsdl:operation name="getTermsForService">
<wsdl:input message="tns:getTermsForServiceSoapIn" />
<wsdl:output message="tns:getTermsForServiceSoapOut" />
</wsdl:operation>
</wsdl:portType>
I thought, calling it would be as eaysy as:
$client = new Zend_Soap_Client($this->config->webserviceWsdlFile);
try {
$result = $client->getTermsForService($_GET['universalid']);
} catch (Exception $e) {
// @TODO catch correctly
var_dump($e);
}
But it seems it isn't. So what do I have to do to get a correct result with a string in the answer...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实际上很容易
给出正确的结果:
actually it was really easy
gave the correct result: