Click here to Skip to main content
15,893,564 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I'm very new to web service development, so forgive me if my question is a trivial one, but I've tried searching on many forums and couldn't find any information anywhere.

I developed a web service in Java, and as part of an assignment I have to complete for my University degree, I created a consumer of this web service in C#. Now when I deploy the Java web service in Netbeans using the Glassfish server, I can easily connect to the webservice from the C# application, since I imported the webservice reference and refer to it in my C# code.

I need to make the C# application connect to the Java Web service remotely however, by inserting the URL (or IP address) and port number of the server of the Java Web Service (being hosted on the glassfish server), thereby being able to connect even from a different machine.

How can this be completed?
Posted

1 solution

Hi,

If your Java Web Service is hosted [on Glassfish Server] on a server machine.,
you should basically get a get a Web Service URL like so:

http://Mac-name:port/servicename

Such URL could be used to add reference to your C# application at Design Time.

If the same needs to be during runtime,
you can simply create objects for Address, Binding, and Contract (With the address as the above address)
and connect to the service.
 
Share this answer
 
Comments
Luke Buttigieg 29-Jan-12 10:17am    
Hi thanks for your answer. Where and how can you insert such an address though? I've been looking around for objects or properties I can edit at design time which would allow me to insert the custom URL, but to no avail. Any nudge in the right direction would be greatly appreciated. Please note I'm not using WCF but the older technology.
Luke Buttigieg 31-Jan-12 14:19pm    
I managed by editing the Address property. It wasn't that hard after all. Thanks a million!
[no name] 31-Jan-12 15:55pm    
That's great, kudos :) You *MUST* be feeling great!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900