Package org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.basic

Examples of org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.basic.BasicAuthenticationReferencePolicyInterceptor


        }
    }

    public Message invoke(Message msg) {
       
        WSAxis2BindingContext bindingContext = msg.getBindingContext();
        OperationClient operationClient = bindingContext.getAxisOperationClient();
       
        String username = null;
        String password = null;
       
        // get the security context
View Full Code Here


    }
  
    public Message invoke(Message msg) {
        try {
            final OperationClient operationClient = createOperationClient(msg);
            WSAxis2BindingContext bindingContext = new WSAxis2BindingContext();
            bindingContext.setAxisOperationClient(operationClient);
            bindingContext.setAxisOutMessageContext(operationClient.getMessageContext("Out"));
            // set in the transport invoker when the response is received
            //bindingContext.setAxisInMessageContext(operationClient.getMessageContext("In"));
            msg.setBindingContext(bindingContext);
           
            msg = endpointReference.getBindingInvocationChain().getHeadInvoker().invoke(msg);
View Full Code Here

        return msg;
    }

    protected Object invokeTarget(Message msg) throws AxisFault {
        WSAxis2BindingContext bindingContext = msg.getBindingContext();
        final OperationClient operationClient = bindingContext.getAxisOperationClient();

        // ensure connections are tracked so that they can be closed by the reference binding
        MessageContext requestMC = operationClient.getMessageContext("Out");
        requestMC.getOptions().setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE);
        requestMC.getOptions().setTimeOutInMilliSeconds(240000L);
             
       
        // Allow privileged access to read properties. Requires PropertiesPermission read in
        // security policy.
        try {
            AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
                public Object run() throws AxisFault {
                    operationClient.execute(true);
                    return null;
                }
            });
        } catch (PrivilegedActionException e) {
            operationClient.complete(requestMC);
            throw (AxisFault)e.getException();
        }

        MessageContext responseMC = operationClient.getMessageContext("In");
        bindingContext.setAxisInMessageContext(responseMC);
               
        OMElement response = responseMC.getEnvelope().getBody().getFirstElement();

        // FIXME: [rfeng] We have to pay performance penalty to build the complete OM as the operationClient.complete() will
        // release the underlying HTTP connection.
View Full Code Here

        return response;
    }
   
    protected Object invokeTargetOneWay(Message msg) throws AxisFault {
        WSAxis2BindingContext bindingContext = msg.getBindingContext();
        OperationClient operationClient = bindingContext.getAxisOperationClient();

        // ensure connections are tracked so that they can be closed by the reference binding
        MessageContext requestMC = operationClient.getMessageContext("Out");
        //requestMC.getOptions().setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE);
        Options opt = requestMC.getOptions();
View Full Code Here

        }
    }

    public Message invoke(Message msg) {
       
        WSAxis2BindingContext bindingContext = msg.getBindingContext();
        OperationClient operationClient = bindingContext.getAxisOperationClient();
       
        String username = null;
        String password = null;
       
        // get the security context
View Full Code Here

        }
    }

    public Message invoke(Message msg) {
       
        WSAxis2BindingContext bindingContext = msg.getBindingContext();       
        MessageContext messageContext = bindingContext.getAxisInMessageContext();
       
        Map httpHeaderProperties = (Map)messageContext.getProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS);
       
        String basicAuthString = (String)httpHeaderProperties.get("Authorization");
        String decodedBasicAuthString = null;
View Full Code Here

    }
  
    public Message invoke(Message msg) {
        try {
            final OperationClient operationClient = createOperationClient(msg);
            WSAxis2BindingContext bindingContext = new WSAxis2BindingContext();
            bindingContext.setAxisOperationClient(operationClient);
            bindingContext.setAxisOutMessageContext(operationClient.getMessageContext("Out"));
            // set in the transport invoker when the response is received
            //bindingContext.setAxisInMessageContext(operationClient.getMessageContext("In"));
            msg.setBindingContext(bindingContext);
           
            msg = endpointReference.getBindingInvocationChain().getHeadInvoker().invoke(msg);
View Full Code Here

public class HelloWorldSOAP12TestCaseOFF extends TestCase {

    private Node node;

    public void testHelloWorld() throws Exception {
        HelloWorld helloWorld = node.getService(HelloWorld.class, "HelloWorldClient");
        assertEquals("Hello petra", helloWorld.getGreetings("petra"));
    }
View Full Code Here

    public void testHelloWorld() throws Exception {
        HelloWorld helloWorld = node.getService(HelloWorld.class, "HelloWorldClient");
        assertEquals("Hello petra", helloWorld.getGreetings("petra"));
    }
    public void testHelloWorldSOAP() throws Exception {
        HelloWorld helloWorld = node.getService(HelloWorld.class, "HelloWorldClientSOAP");
        assertEquals("Hello petra", helloWorld.getGreetings("petra"));
    }
View Full Code Here

    public void testHelloWorldSOAP() throws Exception {
        HelloWorld helloWorld = node.getService(HelloWorld.class, "HelloWorldClientSOAP");
        assertEquals("Hello petra", helloWorld.getGreetings("petra"));
    }
    public void testHelloWorldSOAP11() throws Exception {
        HelloWorld helloWorld = node.getService(HelloWorld.class, "HelloWorldClientSOAP11");
        assertEquals("Hello petra", helloWorld.getGreetings("petra"));
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.basic.BasicAuthenticationReferencePolicyInterceptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.