I’am trying to use web-service from a desktop-application I used the Tutorials in here and made this code to connect to the web-service server project
public static void main(String[] args) {
float f1 = 60.5F;
float c1 = 0;
ConverterProxy s = new ConverterProxy();
try {
c1 = s.farenheitToCelsius(f1);
} catch (RemoteException e) {
e.printStackTrace();
}
System.out.println("Output: " + c1);
}
it did work put I need some where that explain what the other client side classes do
i need to know what the classes
Converter,ConverterProxy,ConverterService,ConverterServiceLocator,ConverterSoapBindingStub
Do and what we need them for ?
Thanks in advance
It’s a bit of a guess, as I’m not using your tutorial, but a lot of these classes follow a similar pattern.
Converter is likely an interface, which defines what methods the service will offer.
ConverterProxy is likely the client-side exposure of the Converter interface. It doesn’t actually do the work, instead it takes the methods in Converter and packages them for network transport.
ConverterService is likely the server-side exposure of the Converter interface. It takes network packages from ConverterProxy calls, unpacks them, performs the conversion, and sends the reply back to the ConverterProxy at the other end of the network connection. ConverterProxy will then unpack the network message, take out the result, and return it as the answer.
ConverterServiceLocator is likely a class which concerns itself with the code necessary to find a ConverterService. Sometimes to maintain a degree of flexibility, the ConverterService’s location is not specified at compile time, and ConverterServices tell a central registry (typically UDDI) where they are when they start up. ConverterServiceLocator will then (as you attempt to bind to a ConverterService with a ConverterProxy) query the central registry, and provide either the location of a suitable ConverterService or provide the ConverterService directly (I can’t remember if it does the fetching of the Service for you).
ConverterSoapBindingStub is a class that provides the (otherwise hidden) Java to SOAP XML marshalling / demarshalling necessary for the translation of ConverterProxy requests to get turned into XML requests and ConverterProxy replies to get turned into XML replies.
Again, I don’t have access to your source code or your tutorial (and I don’t have time to look over it at the moment); but, these are educated guesses based on very common naming conventions.