Commit 23837b01 by Patryk Czarnik

Adnotacje z nazwami parametrów

parent 9bdb8c71
package hello;
import jakarta.jws.WebParam;
import jakarta.jws.WebResult;
import jakarta.jws.WebService;
@WebService
......@@ -9,13 +11,17 @@ public class PierwszySerwis {
return "Witaj " + imie;
}
// TODO napisz metodę, która wykonuje jakieś działanie matematyczne
// 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(int x, int y) {
@WebResult(name="wynik")
public int pomnoz(
@WebParam(name="liczba1") int x,
@WebParam(name="liczba2") int 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;
}
......
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