NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
julsorio
Joined: 05 Jun 2009 Posts: 168 Location: Bogota, Colombia, South America
|
Posted: Tue Aug 03, 2010 9:47 pm Post subject: Re: NB 6.9, GF 3.0.1. Newbe with Web Service |
|
|
Greetings
Did you try to debbug your app?
On 3 August 2010 13:28, Jose Alvarez de Lara <address-removed ([email]address-removed[/email])> wrote:
| Quote: | I am trying a simple WS. This is the code,
|
|
| Back to top |
|
 |
pepelara
Joined: 29 Nov 2008 Posts: 115
|
Posted: Wed Aug 04, 2010 7:31 am Post subject: Re: NB 6.9, GF 3.0.1. Newbe with Web Service |
|
|
Hi,
I did what you suggested. I put breakpoints in the client and in the WS
but the debugger never entries in the WS so I cannot see the values in it.
Regards,
Jose
From: JULIAN ENRIQUE OSORIO AMAYA ([email]address-removed[/email])
Sent: Tuesday, August 03, 2010 11:46 PM
To: address-removed ([email]address-removed[/email])
Subject: [nbj2ee] Re: NB 6.9, GF 3.0.1. Newbe with Web Service
Greetings
Did you try to debbug your app?
On 3 August 2010 13:28, Jose Alvarez de Lara <address-removed ([email]address-removed[/email])> wrote:
| Quote: | I am trying a simple WS. This is the code,
@WebService()
@Stateful()
public class AddNumbers {
private int num1;
private int num2;
/**
* Web service operation
*/
@WebMethod(operationName = "setNum1")
public void setNum1(@WebParam(name = "num1")
int num1) {
//TODO write your implementation code here:
this.num1 = num1;
}
/**
* Web service operation
*/
@WebMethod(operationName = "setNum2")
public void setNum2(@WebParam(name = "num2")
int num2) {
//TODO write your implementation code here:
this.num2 = num2;
}
/**
* Web service operation
*/
@WebMethod(operationName = "addNumbers")
public int addNumbers() {
//TODO write your implementation code here:
return this.num1 + this.num2;
}
}
And the client is as follow,
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
int num1 = 5;
int num2 = 3;
// The client connects to the service with this code.
AddNumbersService service = new AddNumbersService();
AddNumbers port = service.getAddNumbersPort();
port.setNum1(num1);
port.setNum2(num2);
System.out.println(num1 + " + " + num2 + " = " + port.addNumbers());
}
}
Everything is ok, but the result of the operation is always 0.
What is going wrong?
Regards,
Jose
|
--
Julian Osorio Amaya
Universidad Libre. Ingenier |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|
|