Geeks With Blogs
Marcin Celej blog

I've been recently looking for a way to expose web services without IIS (directly from my windows service). I found two ways of doing that:

  • Windows Communication Foundation
  • Web Service Enhancements 3.0

The first one (WCF) requires change of my application architecture so I decided to try the WSE 3.0; It can be downloaded from here: Web Services Enhancements (WSE) 3.0 for Microsoft .NET.

 I followed those steps:

Step 1. I created an ordinary Web Service that looks like this:

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class CustomerWebService : System.Web.Services.WebService {
    [WebMethod]
    public string Register(long id, string data1) {
        return "ID.CUSTOMER";
    }
}

Step 2. I published the web service to my local ASP.NET development server

Step 3. I generated Web Service Proxy to my web service

Step 4. I changed the base class of my Web Service Proxy from System.Web.Services.Protocols.SoapHttpClientProtocol to Microsoft.Web.Services3.WebServicesClientProtocol (I did it manually as I do not know yet how to enforce the VS to do it for me).

Step 5. I added following lines to my windows service application startup:

Uri address = new Uri("soap.tcp://localhost/CustomerWebService");
SoapReceivers.Add(new EndpointReference(address), typeof(CustomerWebService));

Step 6. I changed my client-side proxy url to the one: soap.tcp://localhost/CustomerWebService

Step 7. I run the client application

Everything worked smothly. I will just have to check if the web service is callable from a Web Sphere environment.

Posted on Monday, April 2, 2007 7:16 PM | Back to top


Comments on this post: Exposing Web Service without IIS

# re: Exposing Web Service without IIS
Requesting Gravatar...
Hi,

I did connect the ASMX from an external system. It was IBM WebSomething (my friend tested it). The consumer was written in Java and it worked fine for me. The service and client were separated but in local network. We had some problems though first - caused by the WSDL details, but it was quick to fix it.

I am not sure if it helps you (except the information it can be done).

Regards,
Marcin
Left by Marcin Celej on Nov 27, 2007 10:28 PM

# re: Exposing Web Service without IIS
Requesting Gravatar...
Hi Marcin,
I am new to WSE, sorry for the trivial question.

How do I perform step 3 and 4 of your instructions above?

Thanks
Left by Eugene on Jan 07, 2009 9:53 AM

# re: Exposing Web Service without IIS
Requesting Gravatar...
3 - in VS right click on References in a new project. Then click 'Add new web reference' (or something like that). Then place there your WS url. Remember: The service must be running.

4 - The web service proxy generated by step 3 is a class that you need to find in your project. It is hidden by default so you need to press 'Show all files' button in your solution explorer. Then go inside the file. I believe it is usually named Reference.cs and change the base class.

I hope it helps you though I write it from memory.
Left by Marcin Celej on Jan 07, 2009 10:17 AM

# re: Exposing Web Service without IIS
Requesting Gravatar...
Marcin,

I am still having difficult time following the instructions. Is it possible to get the sample VS solution source code?

Thanks in advance
Left by Eugene on Jan 07, 2009 1:58 PM

# re: Exposing Web Service without IIS
Requesting Gravatar...
i am using visual stdio 2.0,now i want to run the projectweb services without using iis.
Left by baby on Jan 24, 2009 1:47 AM

Your comment:
 (will show your gravatar)


Copyright © Marcin Celej | Powered by: GeeksWithBlogs.net