Zend framework 如何更改Zend_Soap_AutoDiscover生成的WSDL中的名称
我正在尝试将PHP soap服务器与用C#编写的客户端连接起来。 WSDL是这样创建的:Zend framework 如何更改Zend_Soap_AutoDiscover生成的WSDL中的名称,zend-framework,soap,wsdl,zend-soap,Zend Framework,Soap,Wsdl,Zend Soap,我正在尝试将PHP soap服务器与用C#编写的客户端连接起来。 WSDL是这样创建的: $autodiscover = new Zend_Soap_AutoDiscover('Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex'); $autodiscover->setClass('Soap_Service1'); $autodiscover->handle(); 然后我收到: <definitions xmlns="http://sche
$autodiscover = new Zend_Soap_AutoDiscover('Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex');
$autodiscover->setClass('Soap_Service1');
$autodiscover->handle();
然后我收到:
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://www.xx.de/soap/version/1"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://www.xx.de/soap/version/1"
name="Soap_Services1"
>
在C#中解析的这个'name=“Soap_Services1”'属性看起来很难看(Services.Soap_Services1Service)。当然,名称与ServiceBinding和PortType相连接。有没有办法在不手动破解zend library的情况下对其进行更改?由于您使用的是自动发现/神奇的soap服务创建者,因此无法覆盖它创建的名称
如果您想这样做,您可以扩展Zend_Soap_AutoDiscover并实现您自己的setClass方法,该方法在生成wsdl时使用您自己的名称选择。是。只需重命名您的服务类;) 我会给你
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://www.xx.de/soap/version/1"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://www.xx.de/soap/version/1"
name="CoolServiceName"
>
只需重命名服务类(由setClass()调用设置的服务类),就可以了
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://www.xx.de/soap/version/1"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://www.xx.de/soap/version/1"
name="CoolServiceName"
>