Generate WSE3 client without GUI

By admin - Last updated: Monday, August 24, 2009 - Save & Share - Leave a Comment

Solution 1

When using Visual Studio 2008, the web service proxy generated might not be WSE enabled.
In order to generate WSE enabled proxy class, you can use the command line to do that.
Yes, you can use WCF to communicate with WSE enabled service for sure, but here we are talking WSE3.

Firstly, you need install Web Services Enhancements (WSE) 3.0 for Microsoft .NET
with tools ticked during installation. Also you need .NET 2.0 SDK installed in order to use WseWsdl3.exe

C:\Program Files\Microsoft WSE\v3.0\Tools>WseWsdl3.exe http://host/MyService.asmx?wsdl /out:MyWseAsmxProxy.cs /type:webClient

MyWseAsmxProxy.cs contains Wse proxy you wanted.

Solution 2 (Easy)
Step 1,
Reference Microsoft.Web.Service3 in your project

Step 2,
Open Reference.cs
Change the parent of MyService to derive from Microsoft.Web.Services3.WebServicesClientProtocol Instead of System.Web.Services.Protocols.SoapHttpClientProtocol.




Posted in WebServices • Tags: Top Of Page

Write a comment


Captcha: × six = 42