private void applyOperationInfo(Options options) { String soapAction = "urn:" + operation;// Default if (this.operationInfo != null) { String soapActionInfo = this.operationInfo.get(Constant.SOAP_ACTION); if (soapActionInfo != null) { soapAction = soapActionInfo; } } options.setAction(soapAction); }
/** * @param soapAction */ public void setSoapAction(String soapAction) { if (log.isDebugEnabled()) { log.debug("Old SoapAction is (" + options.getAction() + ")"); log.debug("New SoapAction is (" + soapAction + ")"); } options.setAction(soapAction); }
/** * setWSAAction */ public void setWSAAction(String actionURI) { if (log.isDebugEnabled()) { log.debug("Old WSAAction is (" + options.getAction() + ")"); log.debug("New WSAAction is (" + actionURI + ")"); } options.setAction(actionURI); }
/** * setWSAAction */ public void setWSAAction(String actionURI) { if (log.isDebugEnabled()) { log.debug("Old WSAAction is (" + options.getAction() + ")"); log.debug("New WSAAction is (" + actionURI + ")"); } options.setAction(actionURI); }
/** * @param soapAction */ public void setSoapAction(String soapAction) { if (log.isDebugEnabled()) { log.debug("Old SoapAction is (" + options.getAction() + ")"); log.debug("New SoapAction is (" + soapAction + ")"); } options.setAction(soapAction); }
public void run() { client.getOptions().setAction(operation); try { long t1 = System.currentTimeMillis(); for (long i=0; i < iterations; i++) { OMElement response2 = client.sendReceive(msg); OMElement loadElement = response2.getFirstChildWithName(new QName("load")); System.out.println(invokerName + ": " + loadElement.toString()); } long t2 = System.currentTimeMillis(); System.out.println("================================================================"); System.out.println(invokerName + " completed requests."); System.out.println("================================================================"); runningTime = t2 - t1; } catch (AxisFault axisFault) { System.out.println(axisFault.getMessage()); } } }
public void setInvokerName(String invokerName) { this.invokerName = invokerName; if (statefull) { client.getOptions().setManageSession(true); client.getOptions().setAction("setClientName"); OMElement cName = fac.createOMElement("cName", null); cName.setText(invokerName); try { OMElement response = client.sendReceive(cName); System.out.println(response.getText()); } catch (AxisFault axisFault) { axisFault.printStackTrace(); } } }
public void setInvokerName(String invokerName) { this.invokerName = invokerName; if (statefull) { client.getOptions().setManageSession(true); client.getOptions().setAction("setClientName"); OMElement cName = fac.createOMElement("cName", null); cName.setText(invokerName); try { OMElement response = client.sendReceive(cName); System.out.println(response.getText()); } catch (AxisFault axisFault) { axisFault.printStackTrace(); } } }
public void setInvokerName(String invokerName) { this.invokerName = invokerName; if (statefull) { client.getOptions().setManageSession(true); client.getOptions().setAction("setClientName"); OMElement cName = fac.createOMElement("cName", null); cName.setText(invokerName); try { OMElement response = client.sendReceive(cName); System.out.println(response.getText()); } catch (AxisFault axisFault) { axisFault.printStackTrace(); } } }
public void publish(String topic, OMElement element) throws AxisFault{ log.debug("published element to "+ topic ); EventBrokerServiceStub service = new EventBrokerServiceStub(configurationContext, brokerUrl+"/publish/"+topic); configureCookie(service._getServiceClient()); ServiceClient serviceClient = service._getServiceClient(); OMElement header = fac.createOMElement(new QName(TOPIC_HEADER_NS, TOPIC_HEADER_NAME)); header.setText(topic); serviceClient.addHeader(header); serviceClient.getOptions().setTo(new EndpointReference(brokerUrl+"/publish")); //serviceClient.getOptions().setTo(new EndpointReference(brokerUrl)); serviceClient.getOptions().setAction("urn:publish"); serviceClient.sendRobust(element); }
public static Options getOptions(String soapAction, long timeout, EndpointReference destination) { Options opts = new Options(); opts.setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE); opts.setAction(soapAction); opts.setTimeOutInMilliSeconds(timeout); opts.setMessageId(UUIDGenerator.getUUID()); opts.setTo(destination); return opts; }
public static Options getOptions(String soapAction, long timeout, EndpointReference destination) { Options opts = new Options(); opts.setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE); opts.setAction(soapAction); opts.setTimeOutInMilliSeconds(timeout); opts.setMessageId(UUIDGenerator.getUUID()); opts.setTo(destination); return opts; }
public void publish(String topic, OMElement element) throws AxisFault { log.debug("published element to "+ topic ); EventBrokerServiceStub service = new EventBrokerServiceStub(configurationContext, backendUrl +"/publish/"+topic); configureCookie(service._getServiceClient()); ServiceClient serviceClient = service._getServiceClient(); OMElement header = omFactory.createOMElement(new QName(TOPIC_HEADER_NS, TOPIC_HEADER_NAME)); header.setText(topic); serviceClient.addHeader(header); serviceClient.getOptions().setTo(new EndpointReference(backendUrl+"/publish")); //serviceClient.getOptions().setTo(new EndpointReference(brokerUrl)); serviceClient.getOptions().setAction("urn:publish"); serviceClient.sendRobust(element); }
public void publish(String topic, OMElement element) throws AxisFault { log.debug("published element to "+ topic ); EventBrokerServiceStub service = new EventBrokerServiceStub(configurationContext, backendUrl +"/publish/"+topic); configureCookie(service._getServiceClient()); ServiceClient serviceClient = service._getServiceClient(); OMElement header = omFactory.createOMElement(new QName(TOPIC_HEADER_NS, TOPIC_HEADER_NAME)); header.setText(topic); serviceClient.addHeader(header); serviceClient.getOptions().setTo(new EndpointReference(backendUrl+"/publish")); //serviceClient.getOptions().setTo(new EndpointReference(brokerUrl)); serviceClient.getOptions().setAction("urn:publish"); serviceClient.sendRobust(element); }
protected void sendNotification(OMElement topicHeader, OMElement payload, String endpoint) throws AxisFault { // The parameter args is used as a mechanism to pass any argument into this method, which // is used by the implementations that extend the behavior of the default Carbon Event // Dispatcher. ServiceClient serviceClient = new ServiceClient(); Options options = new Options(); options.setTo(new EndpointReference(endpoint)); options.setAction(EventingConstants.WSE_PUBLISH); serviceClient.setOptions(options); serviceClient.addHeader(topicHeader); serviceClient.fireAndForget(payload); } }
protected void sendNotification(OMElement topicHeader, OMElement payload, String endpoint) throws AxisFault { // The parameter args is used as a mechanism to pass any argument into this method, which // is used by the implementations that extend the behavior of the default Carbon Event // Dispatcher. ServiceClient serviceClient = new ServiceClient(); Options options = new Options(); options.setTo(new EndpointReference(endpoint)); options.setAction(EventingConstants.WSE_PUBLISH); serviceClient.setOptions(options); serviceClient.addHeader(topicHeader); serviceClient.fireAndForget(payload); } }
public SearchResultsBean getSearchResults(HttpServletRequest request) throws RegistryException { String content = (String) Utils.getParameter(request, "content"); SearchResultsBean bean = null; try { //working around a bug which sets a worng content type stub._getServiceClient().getOptions().setAction("urn:getContentSearchResults"); bean = stub.getContentSearchResults(content); if (bean.getResourceDataList() == null) { bean.setResourceDataList(new ResourceData[0]); } } catch (Exception e) { String msg = "Failed to get search results from the search service. " + e.getMessage(); log.error(msg, e); throw new RegistryException(msg); } return bean; } }
private ServiceClient getServiceClient(QName rstQn, String issuerAddress) throws AxisFault { AxisService axisService = new AxisService("SecurityTokenService" + UUIDGenerator.getUUID()); axisService.setClientSide(true); AxisOperation operation = new OutInAxisOperation(rstQn); axisService.addOperation(operation); ServiceClient client = new ServiceClient(this.configCtx, axisService); if (this.options != null) { client.setOptions(options); } //Set the action client.getOptions().setAction(action); client.getOptions().setTo(new EndpointReference(issuerAddress)); client.engageModule("rampart"); return client; }
private void makeMessageReadyForReinjection(MessageContext messageContext) { messageContext.setProperty(AddressingConstants.WS_ADDRESSING_VERSION, null); messageContext.getOptions().setMessageId(null); messageContext.getOptions().setTo(null); messageContext.getOptions().setAction(null); messageContext.setProperty(Sandesha2Constants.APPLICATION_PROCESSING_DONE, Sandesha2Constants.VALUE_TRUE); }
public static void main(String[] args) throws AxisFault { String axis2_xml = CLIENT_REPO_PATH + File.separator + "client_axis2.xml"; ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(CLIENT_REPO_PATH,axis2_xml); Options clientOptions = new Options (); clientOptions.setTo(new EndpointReference (toEPR)); ServiceClient serviceClient = new ServiceClient (configContext,null); clientOptions.setAction("urn:wsrm:Ping"); serviceClient.setOptions(clientOptions); serviceClient.fireAndForget(getPingOMBlock("ping1")); serviceClient.fireAndForget(getPingOMBlock("ping2")); clientOptions.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true"); serviceClient.fireAndForget(getPingOMBlock("ping3")); serviceClient.cleanup(); }