Skip to content

Commit faac9c7

Browse files
committed
Order w serwisie
1 parent 8f8f9a4 commit faac9c7

File tree

5 files changed

+29
-69
lines changed

5 files changed

+29
-69
lines changed

spring-capgemini-web/src/main/java/pl/altkom/spring/capgemini/web/ws/HelloService.java

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import javax.jws.WebMethod;
88
import javax.jws.WebParam;
99
import javax.jws.WebService;
10+
import pl.altkom.spring.spring.capgemini.core.model.Order;
1011

1112
/**
1213
*
@@ -17,5 +18,7 @@ public interface HelloService {
1718

1819
@WebMethod
1920
String sayHallo(@WebParam(name = "name") String name);
21+
22+
Order loadOrder(long id);
2023

2124
}
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,31 @@
11
/*
22
* Copyright 2014-11-20 the original author or authors.
33
*/
4-
54
package pl.altkom.spring.capgemini.web.ws;
65

76
import javax.jws.WebService;
7+
import org.springframework.beans.factory.annotation.Autowired;
8+
import pl.altkom.spring.spring.capgemini.core.model.Order;
9+
import pl.altkom.spring.spring.capgemini.core.service.OrderService;
810

911
/**
1012
*
1113
* @author Adrian Lapierre <[email protected]>
1214
*/
1315
@WebService(endpointInterface = "pl.altkom.spring.capgemini.web.ws.HelloService")
1416
public class HelloServiceImpl implements HelloService {
15-
16-
@Override
17-
public String sayHallo(String name) {
18-
return "hallo " + name;
19-
}
17+
18+
@Autowired
19+
private OrderService orderService;
2020

21+
@Override
22+
public String sayHallo(String name) {
23+
return "hallo " + name;
24+
}
25+
26+
@Override
27+
public Order loadOrder(long id) {
28+
return orderService.loadOrder(id);
29+
}
30+
2131
}

ws-client/src/jax-ws-catalog.xml

-4
This file was deleted.

ws-client/src/main/java/pl/altkom/spring/ws/client/Main.java

+10-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44

55
package pl.altkom.spring.ws.client;
66

7-
import java.net.Authenticator;
7+
import java.net.MalformedURLException;
8+
import java.net.URL;
9+
import javax.xml.namespace.QName;
810
import pl.altkom.spring.capgemini.web.ws.HelloServiceImplService;
911

1012
/**
@@ -13,15 +15,20 @@
1315
*/
1416
public class Main {
1517

16-
public static void main(String[] args) {
18+
public static void main(String[] args) throws MalformedURLException {
1719

1820
WSAuthenticator auth = new WSAuthenticator();
1921
auth.setUsername("user");
2022
auth.setPassword("user");
2123

2224
auth.init();
2325

24-
HelloServiceImplService srv = new HelloServiceImplService();
26+
QName qName = new QName("http://ws.web.capgemini.spring.altkom.pl/",
27+
"HelloServiceImplService");
28+
29+
HelloServiceImplService srv = new HelloServiceImplService(
30+
new URL("http://10.12.11.60:8084/spring-capgemini-web/services/HelloWorld")
31+
, qName);
2532

2633
String res = srv.getHelloServiceImplPort().sayHallo("Alicja");
2734

ws-client/src/wsdl/localhost_8084/spring-capgemini-web/services/HelloWorld.wsdl

-56
This file was deleted.

0 commit comments

Comments
 (0)