开发者

How I can access to WSDL 1.1 file from ASP.NET 3.5

开发者 https://www.devze.com 2022-12-25 20:02 出处:网络
I have a WSDL 1.1 file which describes my Web Service. Now I need get access to its methods using ASP.NET 3.5

I have a WSDL 1.1 file which describes my Web Service. Now I need get access to its methods using ASP.NET 3.5

I tried to use wsdl.exe utility but I think 开发者_如何学编程that this utility use only WSDL 2.0 format.


Assuming you are using VS 2008 Right click on the references folder in you project Select "Add Web Reference..." Enter the URL to your webservice In the Web reference name textbox type in how you would like to reference it. So for an inventory Extension type "Inventory".

To create the object in code you would use Inventory.ProductSoapClient client = new Inventory.ProductSoapClient()

To call a method in you webservice client.Method();


I've installed .NET Framework 1.1 and SDK 1.1. Just for test, I thought its can help me, because .NET 1.1 works with WSDL 1.1 (SDK 1.1 and WSDL 1.1 its just coincidence, it's doen't mean what SDK 1.1 for WSDL 1.1 and/or SDK 2.0 for WSDL 2.0) I have save error message then in case of using wsdl.exe from SDK 2.0

Error message sounds as: Error: The element attribute is not allowed on encoded message parts. The erroneous part is named 'result' in message 'PurchaseResponse'.

Part of code is:

<message name='PurchaseResponse'>
    <part name='result' element='xsd:string'/>
</message>


There is no difference between WSDL 1.1 and WSDL 2.0 for wsdl.exe. I just have an error in .wsdl file. This code:

<message name='PurchaseResponse'>
    <part name='result' element='xsd:string'/>
</message>

Must be:

<message name='PurchaseResponse'>
    <part name='result' type='xsd:string'/>
</message>
0

精彩评论

暂无评论...
验证码 换一张
取 消