0

C# で記述されたクライアントと PHP の SOAP サーバーを接続しようとしています。WSDL は次のように作成されます。

$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 ライブラリを手動でハッキングせずに変更する方法はありますか?

4

3 に答える 3

1

はい。サービスクラスの名前を変更するだけです;)

$autodiscover->setClass('CoolServiceName');

あなたにあげます

<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" 
>
于 2010-12-10T15:30:31.137 に答える
0

サービス クラス (setClass() 呼び出しで設定されたクラス) の名前を変更するだけで済みます。

于 2011-05-06T11:18:36.347 に答える
0

自動検出/魔法の石鹸サービス作成者を使用しているため、作成された名前をそのまま上書きすることはできません。

これを行いたい場合は、Zend_Soap_AutoDiscover を拡張し、wsdl の生成時に独自の名前を選択して使用する独自の setClass メソッドを実装できます。

于 2010-12-10T15:30:11.293 に答える