1

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 の問題であると考えてよろしいですか?

どんな助けでも素晴らしいでしょう!

4

2 に答える 2

2

何時間にもわたる試行錯誤の末、属性が原因encodedではなくに設定されていることが「発見」されliteralました。Visual Studioはこれに対処する上で問題を抱えていましたが、ありがたいことに、Coldfusionの開発者は私に代わって変更しliteralました。

于 2012-04-24T23:47:49.590 に答える
1

それらの障害のColdFusionWSDL定義は、VisualStudioCFCInvocationExceptionプロキシジェネレーターには受け入れられないようです。WSDLを微調整してWCF(またはASMX)プロキシジェネレーターがそれを受け入れるようにする方法を考え出すこともできますが、WSDLから障害定義を完全に削除することをお勧めします。

障害定義は、WCFジェネリックの強い型のバージョンを生成するために使用されますFaultException(ASMXランドで何が起こるかを覚えていないでください)。「問題のある」障害定義をWSDLから削除すると、WSDLに含まれている可能性のある詳細情報が失われる可能性がありますが、障害がスローされた場合でも障害をキャッチできます。少なくとも、ColdFusionサービスへの呼び出しを成功させるための最初のステップとしてこれを実行してください。いつでも元に戻して、後で障害のあるWSDLを追加できます。

于 2012-04-18T13:39:34.557 に答える