Commit 9475cbe6 by Patryk Czarnik

Adnotacje dot parametrów i wyników

parent ee618fb1
......@@ -2,7 +2,11 @@ package hello;
import java.time.LocalDateTime;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.xml.ws.RequestWrapper;
import javax.xml.ws.ResponseWrapper;
@WebService
public class PierwszySerwis {
......@@ -11,11 +15,18 @@ public class PierwszySerwis {
return "Witaj " + imie;
}
@WebResult(name="datetime")
public String ktoraGodzina() {
return LocalDateTime.now().toString();
}
public long oblicz(long x, long y, String operacja) {
@RequestWrapper(localName="wykonajObliczenie")
@ResponseWrapper(localName="wykonajObliczenieResponse")
@WebResult(name="wynik")
public long oblicz(
@WebParam(name="liczba1") long x,
@WebParam(name="liczba2") long y,
@WebParam(name="operacja") String operacja) {
switch(operacja) {
case "+": return x + y;
case "-": 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