SOAP Web サービスを使用する必要がある .Net 4 プロジェクトがあります。Visual Studio (2008/2010) で Web 参照を追加した経験があり、Web サービス参照ツールを使用しています。
始める前に:
WSDL をhttp://pastebin.com/huSE0Qehにアップロードしました
だから私の問題に:
プロジェクトに Web サービス参照を追加し、クラスとメソッドを生成して、テスト用の基本的なコードをいくつか書きました。私は、サービスの責任者にコードを確認してもらい、PHP の担当者に同じ WSDL からいくつかの PHP ファイルを生成してもらいました。
問題は、応答オブジェクトに null プロパティが含まれていることです。例外はありません。
次に試したこと:
WSDL.exe を使用してクラス ファイルを作成しようとしましたが、これは実行されましたが、応答オブジェクトに null が返されます。次のエラーも表示されました (削除しました)。
> R2706: A wsdl:binding in a DESCRIPTION MUST use the value of "literal"
> for the use attribute in all soapbind:body, soapbind:fault,
> soapbind:header and soapbind:headerfault elements.
> - Input element soapbind:body of operation 'getProfile' on portType 'connect.cfcSoapBinding' from namespace 'http://ws'.
> - Output element soapbind:body of operation 'getProfile' on portType 'connect.cfcSoapBinding' from namespace 'http://ws'.
> - soapbind:fault 'CFCInvocationException' on operation 'getProfile' on portType 'connect.cfcSoapBinding' from namespace 'http://ws'.
> - Input element soapbind:body of operation 'getGroups' on portType 'connect.cfcSoapBinding' from namespace 'http://ws'.
> - Output element soapbind:body of operation 'getGroups' on portType 'connect.cfcSoapBinding' from namespace 'http://ws'.
> - soapbind:fault 'CFCInvocationException' on operation 'getGroups' on portType 'connect.cfcSoapBinding' from namespace 'http://ws'.
> - Input element soapbind:body of operation 'MessageReply' on portType 'connect.cfcSoapBinding' from namespace 'http://ws'.
> - Output element soapbind:body of operation 'MessageReply' on portType 'connect.cfcSoapBinding' from namespace 'http://ws'.
次に、次のコマンドを使用してsvcutil.exeを使用して(グーグルの後)試しました:
svcutil.exe /language:cs /out:generatedProxy.cs /config:app.config http://www.myurl.com/test.wsdl
しかし、その後、次のエラーを受け取りました(再びトリミングされました):
Warning: Fault named CFCInvocationException in operation getProfile cannot be imported. Unsupported WSDL, the fault message part must reference an element. This fault message does not reference an element. If you have edit access to the WSDL document, you can fix the problem by referencing a schema element using the 'element' attribute.
Warning: Fault named CFCInvocationException in operation getGroups cannot be imported. Unsupported WSDL, the fault message part must reference an element. This fault message does not reference an element. If you have edit access to the WSDL document, you can fix the problem by referencing a schema element using the 'element' attribute.
フラグを使用して(さらにグーグルで)試し/useSerializerForFault
ましたが、再びエラーが発生しました。
だから私は今途方に暮れています。同等の PHP は問題なく動作し、SOAP UI と呼ばれるツールも同様に動作します。これは Visual Studio/.Net の問題であると考えてよろしいですか?
どんな助けでも素晴らしいでしょう!