1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package org.miloss.fgsms.wsn.broker;
23
24 import javax.annotation.Resource;
25 import javax.jws.WebMethod;
26 import javax.jws.WebParam;
27 import javax.jws.WebResult;
28 import javax.jws.WebService;
29 import javax.jws.soap.SOAPBinding;
30 import javax.xml.bind.annotation.XmlSeeAlso;
31 import javax.xml.datatype.DatatypeFactory;
32 import javax.xml.ws.WebServiceContext;
33 import javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder;
34 import org.apache.log4j.Logger;
35 import org.oasis_open.docs.wsn.b_2.CreatePullPointResponse;
36 import org.oasis_open.docs.wsn.brw_2.UnableToCreatePullPointFault;
37
38
39
40
41
42
43 @WebService(name = "CreatePullPoint", targetNamespace = "http://docs.oasis-open.org/wsn/brw-2", serviceName = "CreatePullPointService", portName = "CreatePullPointBindingPort"
44 ,wsdlLocation = "brw-2impl.wsdl")
45 @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
46 @XmlSeeAlso({
47 org.oasis_open.docs.wsrf.r_2.ObjectFactory.class,
48 org.oasis_open.docs.wsrf.bf_2.ObjectFactory.class,
49 org.oasis_open.docs.wsn.t_1.ObjectFactory.class,
50 org.oasis_open.docs.wsn.b_2.ObjectFactory.class,
51 org.oasis_open.docs.wsn.br_2.ObjectFactory.class
52 })
53 public class CreatePullPointService implements
54 org.oasis_open.docs.wsn.brw_2.CreatePullPoint {
55
56 private DatatypeFactory df = null;
57 @Resource
58 private WebServiceContext ctx;
59 final static Logger log = Logger.getLogger("WS-NotificationBroker");
60
61
62
63
64
65
66
67 @WebMethod(operationName = "CreatePullPoint", action = "CreatePullPoint")
68 @WebResult(name = "CreatePullPointResponse", targetNamespace = "http://docs.oasis-open.org/wsn/b-2", partName = "CreatePullPointResponse")
69 public CreatePullPointResponse createPullPoint(
70 @WebParam(name = "CreatePullPoint", targetNamespace = "http://docs.oasis-open.org/wsn/b-2", partName = "CreatePullPointRequest") org.oasis_open.docs.wsn.b_2.CreatePullPoint createPullPointRequest)
71 throws UnableToCreatePullPointFault {
72 CreatePullPointResponse res = new CreatePullPointResponse();
73
74
75 SingletonBroker.getInstance();
76 W3CEndpointReferenceBuilder b = new W3CEndpointReferenceBuilder();
77
78 String AddSubscription = SingletonBroker.CreateMailBox(createPullPointRequest, "anonymous");
79 b.address(AddSubscription);
80 res.setPullPoint(b.build());
81 return res;
82
83 }
84 }