public void generateNotification() throws AxisFault { OMElement message = factory.createOMElement("generateNotification", NameSpaceConstants.WIDGET_NS); ServiceClient client = createServiceClient(message); client.sendReceive(message); client.cleanupTransport(); }
public void pauseSubscription() throws AxisFault { OMElement message = factory.createOMElement("PauseSubscription", NameSpaceConstants.WSNT_NS); ServiceClient client = createServiceClient(message); client.sendReceive(message); client.cleanupTransport(); }
public void generateNotification() throws AxisFault { OMElement message = factory.createOMElement("generateNotification", NameSpaceConstants.WIDGET_NS); ServiceClient client = createServiceClient(message); client.sendReceive(message); client.cleanupTransport(); }
public void resumeSubscription() throws AxisFault { OMElement message = factory.createOMElement("ResumeSubscription", NameSpaceConstants.WSNT_NS); ServiceClient client = createServiceClient(message); client.sendReceive(message); client.cleanupTransport(); }
public void resumeSubscription() throws AxisFault { OMElement message = factory.createOMElement("ResumeSubscription", NameSpaceConstants.WSNT_NS); ServiceClient client = createServiceClient(message); client.sendReceive(message); client.cleanupTransport(); }
public void pauseSubscription() throws AxisFault { OMElement message = factory.createOMElement("PauseSubscription", NameSpaceConstants.WSNT_NS); ServiceClient client = createServiceClient(message); client.sendReceive(message); client.cleanupTransport(); }
public synchronized OMElement deliverMessage(OMElement notificationMessage, String type, EndpointReference brokerLocationEPR, long timeout) throws AxisFault { ServiceClient client = createServiceClient(type, notificationMessage, brokerLocationEPR, timeout, null); OMElement ret = client.sendReceive(notificationMessage); client.cleanupTransport(); return ret; }
public synchronized OMElement deliverMessage(OMElement notificationMessage, String type, EndpointReference brokerLocationEPR, long timeout, OMElement topicExpressionEl) throws AxisFault { ServiceClient client = createServiceClient(type, notificationMessage, brokerLocationEPR, timeout, topicExpressionEl); OMElement ret = client.sendReceive(notificationMessage); client.cleanupTransport(); return ret; }
public String execute() throws AxisFault { OMElement message = createMessageEl(this.msgBoxId); ServiceClient serviceClient = createServiceClient(message); OMElement responseMessage = null; try { responseMessage = serviceClient.sendReceive(message); } finally { serviceClient.cleanupTransport(); } responseMessage = serviceClient.sendReceive(message); if (responseMessage == null) { throw AxisFault.makeFault(new RuntimeException("no response recieved for subscription message")); } return responseMessage.getFirstElement().getText(); }
public static void main(String[] ars) throws AxisFault, XMLStreamException { // Client side keystore location, here we use same keystore System.setProperty("javax.net.ssl.trustStore", "../httpsService/target/jetty-ssl.keystore"); System.setProperty("javax.net.ssl.trustStorePassword", "axis2key"); String epr = "https://localhost:8443/services/SimpleService/"; Options options = new Options(); options.setTo(new EndpointReference(epr)); ServiceClient sender = new ServiceClient(); sender.setOptions(options); OMElement ret = sender.sendReceive(creatMsg()); ret.serialize(System.out); }
public String execute(OMElement messageIn) throws AxisFault { ServiceClient serviceClient = createServiceClient(); OMElement responseMessage = null; try { responseMessage = serviceClient.sendReceive(messageIn); } finally { serviceClient.cleanupTransport(); } if (responseMessage == null) { throw AxisFault.makeFault(new RuntimeException("no response recieved for subscription message")); } return responseMessage.getFirstElement().getText(); }
public OMElement subscribe(EndpointReference eventSinkReferenceEPR, OMElement filterEl, boolean useNotfy, long expireTime) throws AxisFault { OMElement message = createMessageEl(eventSinkReferenceEPR, filterEl, expireTime); ServiceClient serviceClient = createServiceClient(message); OMElement responseMessage = serviceClient.sendReceive(message); serviceClient.cleanupTransport(); if (responseMessage == null) { throw AxisFault.makeFault(new RuntimeException("no response recieved for subscription message")); } OMElement responseSubscriptionsManagerElement = responseMessage.getFirstChildWithName(new QName( NameSpaceConstants.WSE_NS.getNamespaceURI(), "SubscriptionManager")); return responseSubscriptionsManagerElement; }
public synchronized OMElement deliverMessage(OMElement notificationMessage, String type, EndpointReference brokerLocationEPR, long timeout, OMElement topicExpressionEl) throws AxisFault { ServiceClient client = createServiceClient(type, notificationMessage, brokerLocationEPR, timeout, topicExpressionEl); OMElement ret = client.sendReceive(notificationMessage); client.cleanup(); client.cleanupTransport(); return ret; }
public static OMElement sendRequest(String payloadStr, EndpointReference targetEPR) throws XMLStreamException, AxisFault { OMElement payload = AXIOMUtil.stringToOM(payloadStr); Options options = new Options(); options.setTo(targetEPR); ServiceClient sender = new ServiceClient(); sender.setOptions(options); log.info("Request: " + payload.toString()); OMElement result = sender.sendReceive(payload); log.info("Response: " + result.toString()); return result; }
public OMElement getCurrentMessage(OMElement topicExp) throws AxisFault { OMElement message = factory.createOMElement("GetCurrentMessage", NameSpaceConstants.WSNT_NS); message.addChild(topicExp); ServiceClient client = createServiceClient(message); OMElement responseMessage = client.sendReceive(message); client.cleanupTransport(); if (responseMessage.getFirstElement() == null) { return null; } return (OMElement) responseMessage.getChildren().next(); }
public synchronized OMElement deliverMessage(OMElement notificationMessage, String type, EndpointReference brokerLocationEPR, long timeout) throws AxisFault { ServiceClient client = createServiceClient(type, notificationMessage, brokerLocationEPR, timeout, null); OMElement ret = client.sendReceive(notificationMessage); client.cleanup(); client.cleanupTransport(); return ret; }
public OMElement getCurrentMessage(OMElement topicExp) throws AxisFault { OMElement message = factory.createOMElement("GetCurrentMessage", NameSpaceConstants.WSNT_NS); message.addChild(topicExp); ServiceClient client = createServiceClient(message); OMElement responseMessage = client.sendReceive(message); client.cleanupTransport(); if (responseMessage.getFirstElement() == null) { return null; } return (OMElement) responseMessage.getChildren().next(); }
public OMElement subscribe(EndpointReference eventSinkReferenceEPR, OMElement filterEl, boolean useNotfy, long expireTime) throws AxisFault { OMElement message = createMessageEl(eventSinkReferenceEPR, filterEl, expireTime); ServiceClient serviceClient = createServiceClient(message); OMElement responseMessage = serviceClient.sendReceive(message); serviceClient.cleanup(); serviceClient.cleanupTransport(); if (responseMessage == null) { throw AxisFault.makeFault(new RuntimeException("no response recieved for subscription message")); } OMElement responseSubscriptionsManagerElement = responseMessage.getFirstChildWithName(new QName( NameSpaceConstants.WSE_NS.getNamespaceURI(), "SubscriptionManager")); return responseSubscriptionsManagerElement; }
public String execute(OMElement messageIn) throws AxisFault { ServiceClient serviceClient = createServiceClient(); OMElement responseMessage = null; try { responseMessage = serviceClient.sendReceive(messageIn); } finally { serviceClient.cleanup(); serviceClient.cleanupTransport(); } if (responseMessage == null) { throw AxisFault.makeFault(new RuntimeException("no response recieved for subscription message")); } return responseMessage.getFirstElement().getText(); }
/** * Connect to the service using the current config */ protected void login() throws AxisFault { if (isLoggedIn()) { // relogin logout(); } OMElement loginMethod = callFactory.createLoginCall(this.config.getApiUser(), this.config.getApiKey()); log.info("====================================== Logging in user: {}", this.config.getApiUser()); OMElement loginResult = sender.sendReceive(loginMethod); sessionId = loginResult.getFirstChildWithName(LOGIN_RETURN).getText(); log.info("====================================== Logged in sessionId: {}", sessionId); }