/** * Constructor */ public MessageContext() { super(null); options = new Options(); }
/** * Constructor */ public MessageContext() { super(null); options = new Options(); }
protected OperationClient(AxisOperation axisOp, ServiceContext sc, Options options) { this.axisOp = axisOp; this.sc = sc; this.options = new Options(options); completed = false; oc = sc.createOperationContext(axisOp); }
protected OperationClient(AxisOperation axisOp, ServiceContext sc, Options options) { this.axisOp = axisOp; this.sc = sc; this.options = new Options(options); completed = false; oc = sc.createOperationContext(axisOp); }
public static Options translate(Map<String, String> properties) { return translate(properties, new Options()); }
protected WsrfResourceStub(EndpointReference resourceEpr, long timeout) { this.resourceEndpointReference = resourceEpr; logger.info("resourceEprInWsrfResourceStub Constructor" + resourceEpr.toString()); timeoutInMilliSeconds = timeout; opts = new Options(); opts.setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE); opts.setTo(resourceEpr); opts.setTimeOutInMilliSeconds(timeout); }
protected WsrfResourceStub(EndpointReference resourceEpr, long timeout) { this.resourceEndpointReference = resourceEpr; logger.info("resourceEprInWsrfResourceStub Constructor" + resourceEpr.toString()); timeoutInMilliSeconds = timeout; opts = new Options(); opts.setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE); opts.setTo(resourceEpr); opts.setTimeOutInMilliSeconds(timeout); }
@Override public void activateObject(final PooledObject<ServiceClient> pooledServiceClient) throws Exception { final ServiceClient serviceClient = pooledServiceClient.getObject(); // to avoid overriding settings that could impact other calls to this service client // we extend the option and will restore them after final Options originalOptions = serviceClient.getOptions(); final Options options = new Options(originalOptions); options.setProperty(ORIGINAL_OPTIONS_TO_RESTORE_ON_RETURN, originalOptions); // HttpClient is cached (in ServiceClientPoolObjectFactory.createOptions()) so we need to // add our own HttpState so that the one from HttpClient is not reused!! options.setProperty(HTTPConstants.CACHED_HTTP_STATE, new HttpState()); serviceClient.setOptions(options); }
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 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 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 void sendRequestOneWay(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()); sender.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); } }
@Setup @SuppressWarnings("unused") private void setUp(AxisTestClientContext context, Channel channel, AxisTestClientConfigurator[] configurators) throws Exception { this.configurators = configurators; sender = context.getSender(); serviceClient = new ServiceClient(context.getConfigurationContext(), null); axisOptions = new Options(); axisOptions.setTo(channel.getEndpointReference()); serviceClient.setOptions(axisOptions); }
@Setup @SuppressWarnings("unused") private void setUp(AxisTestClientContext context, Channel channel, AxisTestClientConfigurator[] configurators) throws Exception { this.configurators = configurators; sender = context.getSender(); serviceClient = new ServiceClient(context.getConfigurationContext(), null); axisOptions = new Options(); axisOptions.setTo(channel.getEndpointReference()); serviceClient.setOptions(axisOptions); }
@Setup @SuppressWarnings("unused") private void setUp(AxisTestClientContext context, Channel channel, AxisTestClientConfigurator[] configurators) throws Exception { this.configurators = configurators; sender = context.getSender(); serviceClient = new ServiceClient(context.getConfigurationContext(), null); axisOptions = new Options(); axisOptions.setTo(channel.getEndpointReference()); serviceClient.setOptions(axisOptions); }
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(); }
private AxisService createAxisClientService(Axis2WireTargetDefinition target, ClassLoader classLoader) throws WiringException { URL wsdlURL = getWsdlURL(target.getWsdlLocation(), classLoader); if (wsdlURL != null) { try { return AxisService.createClientSideAxisService(wsdlURL, target.getWsdlElement().getServiceName(), target.getWsdlElement().getPortName().getLocalPart(), new Options()); } catch (AxisFault e) { throw new WiringException(e); } } else { return null; } } }
private MessageContext getNewMessageContextUsingAxis2Info(CreateSequenceMessage createSequenceMessage) throws AxisFault, RMMessageBuildingException { MessageContext messageContext = new MessageContext(); messageContext.setServiceContext(this.axis2Info.getServiceContext()); messageContext.setEnvelope(createSequenceMessage.toSOAPEnvelope()); messageContext.setMessageID(UUIDGenerator.getUUID()); messageContext.setTransportIn(this.axis2Info.getTransportIn()); messageContext.setTransportOut(this.axis2Info.getTransportOut()); messageContext.setReplyTo(this.ackToEpr); messageContext.setProperty(MercuryConstants.PROCESS_RM_CONTROL_MESSAGE, Constants.VALUE_TRUE); messageContext.setOptions(new Options()); // set the correct options messageContext.getOptions().setTo(this.axis2Info.getOptions().getTo()); messageContext.getOptions().setUseSeparateListener(this.axis2Info.getOptions().isUseSeparateListener()); messageContext.setServerSide(this.axis2Info.isServerSide()); return messageContext; }