Commit 95dd728f by Patryk Czarnik

Adnotacje wpływające na nazwy parametrów

parent df898c7e
......@@ -2,6 +2,8 @@ package hello;
import java.time.LocalDateTime;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
@WebService
......@@ -16,15 +18,21 @@ public class PierwszaUsluga {
* JAX-WS to technologia Javy, która służy do tworzenia usług typu SOAP (oraz klientów tych usług).
*/
public String powitaj(String imie) {
@WebResult(name="komunikat")
public String powitaj(@WebParam(name="imie") String imie) {
return "Witaj " + imie + "!";
}
@WebResult(name="data_i_czas")
public String ktoraGodzina() {
return LocalDateTime.now().toString();
}
public long oblicz(long liczba1, long liczba2, String operacja) {
@WebResult(name="wynik")
public long oblicz(
@WebParam(name="arg1") long liczba1,
@WebParam(name="arg2") long liczba2,
@WebParam(name="operacja") String operacja) {
switch(operacja) {
case "+": return liczba1 + liczba2;
case "-": return liczba1 - liczba2;
......
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