消费WSDL的问题 - .NEt 3.5 vs .Net 4 [英] Issue consuming WSDL - .NEt 3.5 vs .Net 4

查看:88
本文介绍了消费WSDL的问题 - .NEt 3.5 vs .Net 4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



所以我被问到是否可以更改现有网站以利用网络服务(由一家公司提供) EmailCenterUK)。



现在我打开了Visual Studio 2012 express,创建了一个控制台应用程序并添加了以下内容作为服务参考:

https://maxemail.emailcenteruk.com/api/soap/file_upload?wsdl [ ^ ]

代理类是当我这样做时没有出现任何问题。 他们似乎生成没有错误,但实际上他们以与VS2008尝试相同的方式失败



然而,我被告知它需要与现有的网站一起使用,如.Net 3.5而不是.Net 4.这是我的问题开始的时候,由于某种原因,这个wsdl无法使用3 .5主要是因为它无法找到Array类型的Soap Encoding定义。这让我很烦,因为如果我浏览以下内容(这是wsdl中提供的路径):

http:/ /schemas.xmlsoap.org/encoding

我可以找到定义的数组类型。



Any想法a)如何将Visual Studio 2008(或2012年项目框架设置为3.5)读取此WSDL? b)一旦读取(如果我需要在读取过程后进行更改)如何使其生成代理类?



我尝试过一些关于设置导入的事情,所以我可以指定命名空间文件的位置,但是我无法生成代理类。





希望你能帮助我。如果您需要更多信息,请告诉我们。





感兴趣的人的信息

我通过使用soapUI发现了以下内容,我测试了WSDL文档是否符合WS-I,遗憾的是该文档不符合标准,因此Visual Studio无法处理它。这不是框架依赖或版本依赖所以我的问题有点误导。



我按如下方式调整这个问题:



有没有人建议如何通过Visual Studios消费不合规的服务?

Hi Guys,

So I have been asked to see if I can change an existing website to utilize a web-service (which is provided by a company called EmailCenterUK).

Now I opened Visual Studio 2012 express, created a console application and added the following as a service reference:
https://maxemail.emailcenteruk.com/api/soap/file_upload?wsdl[^]
The proxy class was generated with no problems when I did this. They appeared to generate with no errors but in fact they failed in the same ways as the VS2008 attempt does

However, I was then told that it needs to be used with this existing website which as .Net 3.5 and not .Net 4. This is when my issue started, for some reason this wsdl will not work with 3.5 primarily because it cannot find the Soap Encoding definition for the type "Array". This bugs me because if I browse to the following (which is the path provided in the wsdl):
http://schemas.xmlsoap.org/encoding
I can find the "Array" type defined.

Any ideas a) how I can get Visual Studio 2008 (or 2012 with project framework set to 3.5) to read this WSDL? b) Once it is read (if I need to make changes after the read process) how can I make it generate the proxy class(es) ?

I've tried a few things which talk about setting an import so I can specify the location of the namespace file, but I have been unable to get the proxy class to generate.


Hope you can help me. If you need more info let me know.


Information for anyone interested
I have found out the following, by using soapUI I tested the WSDL document for compliance to the WS-I, unfortunately the document does not comply with the standard and as a result Visual Studio is unable to process it. This is not framework dependent or version dependent so my question was a bit misleading.

I adjust this question as follows:

Does anyone have a suggestion on how I can consume a non-compliant service via Visual Studios?

推荐答案

您好,



选中此项以添加您提供的URL的Web引用:

但我认为您应该创建HTTP而不是HTTPS它会给出一些错误。



http:/ /msdn.microsoft.com/en-us/library/bb628649.aspx [ ^ ]



希望有所帮助。
Hello,

check this to add a web reference of the URL that you have provide :
but i think you should create it HTTP not HTTPS it will give some error.

http://msdn.microsoft.com/en-us/library/bb628649.aspx[^]

Hope it help.


这篇关于消费WSDL的问题 - .NEt 3.5 vs .Net 4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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