JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setServiceClass(EventSourceEndpoint.class);
factory.setAddress("http://localhost:8080/ws_eventing/services/EventSource");
EventSourceEndpoint requestorClient = (EventSourceEndpoint)factory.create();
String expires = null;
if (req.getParameter("expires-set") == null) {
expires = req.getParameter("expires");
} else {
if (!req.getParameter("expires-set").equals("false")) {
expires = req.getParameter("expires");
}
}
Subscribe sub = createSubscribeMessage(req.getParameter("targeturl"),
req.getParameter("filter-set") == null ? req.getParameter("filter") : null,
expires);
resp.getWriter().append("<h3>Subscription request</h3>");
resp.getWriter().append(convertJAXBElementToStringAndEscapeHTML(sub));
SubscribeResponse subscribeResponse = requestorClient.subscribeOp(sub);
resp.getWriter().append("<h3>Response from Event Source</h3>");
resp.getWriter().append(convertJAXBElementToStringAndEscapeHTML(subscribeResponse));
resp.getWriter().append("<br/><a href=\"index.jsp\">Back to main page</a>");