2010-12-10 10 views
0

私はC#で書かれたクライアントとPHP石鹸サーバーを接続しようとしています。 WSDLは、そのように作成されます。Zend_Soap_AutoDiscoverによって生成されたWSDLの変更名

$autodiscover = new Zend_Soap_AutoDiscover('Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex'); 
$autodiscover->setClass('Soap_Service1'); 
$autodiscover->handle(); 

は、私が受け取る:C#で解析され

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

この '名前= "Soap_Services1"' 属性は、(Services.Soap_Services1Service)醜いです。もちろん、名前はServiceBindingとPortTypeで結ばれています。 zendライブラリを手動でハッキングすることなくそれを変更する方法はありますか?

答えて

0

autodiscover/magical soap service creatorを使用しているので、作成した名前をそのまま上書きすることはできません。

これを行うには、Zend_Soap_AutoDiscoverを拡張し、wsdlを生成するときに独自の名前選択を使用する独自のsetClassメソッドを実装します。

1

はい。

$autodiscover->setClass('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" 
> 
0

を与える)とあなたは良いです。ちょうどあなたのサービスクラスの名前を変更。

関連する問題