2012-04-18 9 views
1

SOAP Webサービスを使用する.Net 4プロジェクトがあります。 Visual Studio(2008/2010)でWeb参照を追加した経験があり、Webサービス参照ツールを使用しています。問題が発生する/ ColdFusionが.Net 4でSOAPサービスを生成しました。WCF

は私が始める前に:私は私のプロジェクトに私のWebサービス参照を追加

、クラスやメソッドが生成され、I:

私はだから私の問題にhttp://pastebin.com/huSE0Qeh

にWSDLをアップロードしましたテストのためのいくつかの基本コードを書いています。私は、サービス責任者がコードをconfimedし、同じWSDLからいくつかのPHPファイルを生成するために私のPHPの対応を取得しています。

問題は、応答オブジェクトにnullプロパティが含まれていることです。私は例外がありません。私は、次を試してみました何

は:

は、私はそれがなかったが、再び私はレスポンスオブジェクトにヌルを取得するクラスファイルを作成するWSDL.exeを使ってみました。私は、次のコマンドを使用してsvcutil.exeを使用して(グーグル後に)しようとした

> 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 /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. 

Iはまた、/useSerializerForFaultフラグを使用して(よりグーグル後)試みたが、再び、私はそれ以上のエラーを受信しました。

だから私は今失業している。 PHPの同等機能はうまく動作し、SOAP UIというツールも同様です。したがって、Visual Studio/.Netの問題だと思うのですか?

助けがあれば助かります。

答えて

2

多くの時間の試行錯誤の末、literalではなくencodedに属性が設定されていることが「発見」されました。 Visual Studioではこれを扱う問題がありましたが、感謝してColdfusionの開発者はliteralに変更されました。

1

Visual Studioプロキシジェネレータでは、CFCInvocationExceptionフォルトのColdFusion WSDL定義が受け入れられないようです。 WSDLを調整してWCF(またはASMX)プロキシジェネレータにそれを受け入れる方法を考えてみることもできますが、単にWSDLからフォルト定義を削除することをお勧めします。

フォールト定義は、WCF FaultExceptionの強力なバージョンを生成するために使用されます(ASMXのランドで何が起こったかは記憶していません)。 WSDLから「違反」のフォールト定義を削除すると、そこに含まれる詳細情報が失われる可能性がありますが、スローされた場合でもフォールトを捕捉できます。 ColdFusionサービスの呼び出しを成功させるための最初のステップとして、これを少なくとも実行してください。後で障害WSDLをいつでも元に戻して追加することができます。

関連する問題