Java – Consume WCF .svc WebService in Java

cjavanetwcfweb services

I am new to WebServices.
I have created a .NET WebService (WCF service .svc).

I am able to consume this service from a .NET Client application. Here I have added the service via (Add Service Reference) in the .NET Client.

Now I want to consume the .NET service from a Java desktop application.

  • How do I add the service reference?
  • How do I consume the service in java?

Best Answer

You can use wsdl2java and pass it the wsdl file and it will automatically generate the whole client so you can communicate with the WebService.

If you are using eclipse you can use this plugin:

wsdl2java eclipse plugin