posts - 50, comments - 168, trackbacks - 6

My Links

News



View Marcin Celej's profile on LinkedIn

Archives

Post Categories

Exposing Web Service without IIS

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.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Print | posted on Monday, April 02, 2007 7:16 PM |

Feedback

Gravatar

# re: Exposing Web Service without IIS

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
11/27/2007 10:28 PM | Marcin Celej
Gravatar

# re: Exposing Web Service without IIS

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
1/7/2009 9:53 AM | Eugene
Gravatar

# re: Exposing Web Service without IIS

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.
1/7/2009 10:17 AM | Marcin Celej
Gravatar

# re: Exposing Web Service without IIS

Marcin,

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

Thanks in advance
1/7/2009 1:58 PM | Eugene
Gravatar

# re: Exposing Web Service without IIS

i am using visual stdio 2.0,now i want to run the projectweb services without using iis.
1/24/2009 1:47 AM | baby
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 

Powered by: