views:

135

answers:

2

I am brand new to WCF, and have limited experience coding against web services.

At work it has been dictated to use WCF for everything network service oriented. The work I need to do involves querying a non-WCF web service, apparently built in Java, with a Netscape certificate server and related infrastructure (the service is not under our control). I have the WSDL for the web service.

  1. Does WCF add any value to this job?

  2. Is it reasonable, normal, or a best practice to build a WCF client against a non-WCF service?

  3. Can anyone offer any advice in doing this?

Thanks!!!

+2  A: 

Yes, a WCF client can work against a web service created with another technology or platform. It's fairly common. With Visual Studio, the client side proxy code is generated for you from the WSDL, and you can invoke a remote service as if it was a local code.

Not to pull a shameless plug, here's a sample of a WCF client calling the Amazon S3 web service, which is quite certainly not built with .NET. The sample demonstrates a typical workflow when creating a WCF client:

  1. Add a Service Reference to the web service, by pointing Visual Studio at the WSDL URL. You don't have to code anything in this step.

  2. Invoke the web service from your code. In the code below, the AmazonS3Client class was created by Visual Studio in step 1 above. You get full intellisense when typing client.ListAllMyBuckets to invke that service.

static void Main(string[] args) {  
    DateTime       now    = LocalNow();  

    // create the web service client object
    AmazonS3Client client = new AmazonS3Client();  

    // invoke the web service
    var result = client.ListAllMyBuckets(  
        accessKeyId,  
        now,  
        SignRequest(secretAccessKey, "ListAllMyBuckets", now));  

    // show the results returned from the web service
    foreach (var bucket in result.Buckets) {  
        Console.WriteLine(bucket.Name);  
    }  
}
Oren Trutner
1: nice penguin2: no shame in a shameless plug :-)3: thanks very much for the help, that looks like the direction I need to go
Jay
A: 

Please see an article posted at http://justcompiled.blogspot.com/2010/10/building-web-service-client-with-wcf.html with the topic, Building a web service client with WCF

Shameer Kunjumohamed