在.Net 4 WCF中使用Coldfusion生成的SOAP服务的问题/错误 [英] Issues/Errors consuming Coldfusion generated SOAP service in .Net 4 WCF

查看:232
本文介绍了在.Net 4 WCF中使用Coldfusion生成的SOAP服务的问题/错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个.Net 4项目,必须使用SOAP Web服务。我在Visual Studio(2008/2010)中添加了Web引用,并使用了Web服务引用工具。

I have a .Net 4 project that has to consume a SOAP Web Service. I have had some experience adding web references in Visual Studio (2008/2010), and I use the web service reference tools.

在开始之前:

我已将WSDL上传到 http://pastebin.com/huSE0Qeh

I have uploaded the WSDL to http://pastebin.com/huSE0Qeh

对我的问题:

我将我的Web服务引用添加到我的项目,类和方法生成和我写了一些基本的代码测试。我已经让那些负责服务的人确定了代码,并让我的PHP对手从同一个WSDL生成一些PHP文件。

I added my Web service reference to my project, the classes and methods were generated and I wrote some basic code for testing. I have had the code confimed by those responsible for the service and by getting my PHP counterpart to generate some PHP files from the same WSDL.

问题是响应对象包含null属性。我没有异常。

The issue is that the response object contains null properties. I do not get an exception.

我尝试下一步:

我尝试使用WSDL.exe创建类文件,它做了,但我再次在响应对象中获得一个null。我也看到以下错误(我已修剪它们):

I tried using WSDL.exe to create the class files, which it did but again I get a null in the response object. I also saw the following errors (I have trimmed them down):

> 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尝试(在Googling之后)使用以下命令:

I then tried (after Googling) using the svcutil.exe using the following command:

svcutil.exe /language:cs /out:generatedProxy.cs /config:app.config http://www.myurl.com/test.wsdl

但后来收到以下错误(再次修正):

But then received the following errors (trimmed down again):

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.

我也尝试了(使用更多的Google之后)使用 / useSerializerForFault 标志,但我再次收到更多错误。

I also tried (after more Googling) using the /useSerializerForFault flag but again I received more errors.

所以我现在在亏损。 PHP的工作正常,所以是一个工具,称为SOAP UI,所以我是正确的,认为这是一个Visual Studio / .Net问题?

So I am now at a loss. The PHP equivalent works fine and so does a tool called SOAP UI, so am I right in thinking this is a Visual Studio/.Net issue?

任何帮助将是伟大的!

推荐答案

经过多个小时的试验和错误,它被发现的属性设置为编码而不是 literal 是罪魁祸首。 Visual Studio遇到了与此有关的问题,幸运的是Coldfusion开发者为我改为 literal

After many hours of trial and error it was "discovered" that having attributes set to encoded rather than literal was the culprit. Visual Studio was having issues dealing with this and thankfully the Coldfusion developers changed to literal for me.

这篇关于在.Net 4 WCF中使用Coldfusion生成的SOAP服务的问题/错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆