Commit 46cff78d by Patryk Czarnik

Adnotacje @WebParam i @WebResult

parent 0528c885
package hello;
import jakarta.jws.WebParam;
import jakarta.jws.WebResult;
import jakarta.jws.WebService;
import java.time.LocalTime;
// JAX-WS → Java API for XML Web Services
// Od Java SE 6 do 10 to była część standardowej edycji
@WebService
public class Pierwszy {
public String hello(String kto) {
return "Hello " + kto;
@WebResult(name="powitanie")
public String hello(@WebParam(name="imie") String kto) {
return "Witaj " + kto;
}
public int add(int x, int y) {
@WebResult(name="suma")
public int add(@WebParam(name="x") int x,
@WebParam(name="y") int y) {
return x + y;
}
@WebResult(name="now")
public String ktoraGodzina() {
return LocalTime.now().toString();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment