The Artima Developer Community
Sponsored Link

Web Services Forum
Building clients for deployed webservice

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Johnson abraham

Posts: 1
Nickname: johnsonaj
Registered: Sep, 2006

Building clients for deployed webservice Posted: Sep 6, 2006 4:41 AM
Reply to this message Reply
Advertisement
Hi,
I have coded by the following webservice and deployed using Axis engine and Tomcat webserver.
The webservice I deployed has the following structure

package noniaxisws;

public class DipsoProjectWSSoapBindingImpl implements noniaxisws.HelloAxisAnt{
private int x;
private int y;
private int s;
public int sum() throws java.rmi.RemoteException {
s=x+y;
return s;
}

public java.lang.String getMessage() throws java.rmi.RemoteException {
return "The sum of x+y= "+s;
}

public void assign() throws java.rmi.RemoteException {
x=10;
y=20;
}

}

The client of the webservice is given below
public class ClientMain {

/** Creates a new instance of ClientMain */
public ClientMain() {
}

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
String outputString="Failed to use Web Service";
try{
String endpoint="http://localhost:8080/axis/services/DipsoProjectWS";
Service service=new Service();
DipsoProjectWSSoapBindingStub wsstub=new DipsoProjectWSSoapBindingStub(new URL(endpoint), service);

wsstub.assign();
System.out.println(wsstub.sum());
outputString=(String)wsstub.getMessage();
System.out.println(outputString);
}catch(Exception ex)
{
outputString=ex.toString();
ex.printStackTrace();
}
}

}

The problem I am facing currently is Though I have initialised the private member X and Y using assign method.
The result of the sum methods is performed next and the results are printed out.
But the result seems to x+y=0;
Why is the value of x and y is not assigned in the function
assign.
How to achieve sharing of data through private variable between different functions deployed as webservices?.


thank you,
Johnson Abraham

Topic: In appropriate post --- Attention: Bill/Webmaster Previous Topic   Next Topic Topic: getting access to provider's ibm-webservices-ext.xmi file by a  client...?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use