Commit 23837b01 by Patryk Czarnik

Adnotacje z nazwami parametrów

parent 9bdb8c71
package hello; package hello;
import jakarta.jws.WebParam;
import jakarta.jws.WebResult;
import jakarta.jws.WebService; import jakarta.jws.WebService;
@WebService @WebService
...@@ -9,13 +11,17 @@ public class PierwszySerwis { ...@@ -9,13 +11,17 @@ public class PierwszySerwis {
return "Witaj " + imie; return "Witaj " + imie;
} }
// TODO napisz metodę, która wykonuje jakieś działanie matematyczne @WebResult(name="wynik")
// ciekawe będzie dzielenie int-ów (bo może być wyjątek dzielenia przez zero - nie zapobiegaj, chcemy zobaczyć, jak działają wyjątki w SOAP public int pomnoz(
public int pomnoz(int x, int y) { @WebParam(name="liczba1") int x,
@WebParam(name="liczba2") int y) {
return x * y; return x * y;
} }
public int podziel(int x, int y) { @WebResult(name="wynik")
public int podziel(
@WebParam(name="liczba1") int x,
@WebParam(name="liczba2") int y) {
return x / y; return x / y;
} }
......
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