Examples of BindingProvider


Examples of javax.xml.ws.BindingProvider

           
            try {
                greeter.testDocLitFault(badRecordFault);
                fail("Should have thrown BadRecordLitFault exception");
            } catch (BadRecordLitFault brlf) {               
                BindingProvider bp = (BindingProvider)greeter;
                Map<String, Object> responseContext = bp.getResponseContext();
                String contentType = (String) responseContext.get(Message.CONTENT_TYPE);
                assertEquals("text/xml; charset=utf-8", contentType);
                Integer responseCode = (Integer) responseContext.get(Message.RESPONSE_CODE);
                assertEquals(500, responseCode.intValue());               
                assertNotNull(brlf.getFaultInfo());
View Full Code Here

Examples of javax.xml.ws.BindingProvider

                        "http://localhost:9000/SoapContext/SoapPort");
        Greeter greeter = service.getPort(fakePortName, Greeter.class);

        try {
            //try the jaxws way
            BindingProvider bp = (BindingProvider)greeter;
            bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "BJ");
            bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "pswd");
            String s = greeter.greetMe("secure");
            assertEquals("Hello BJ", s);
            bp.getRequestContext().remove(BindingProvider.USERNAME_PROPERTY);
            bp.getRequestContext().remove(BindingProvider.PASSWORD_PROPERTY);
           
            //try setting on the conduit directly
            Client client = ClientProxy.getClient(greeter);
            HTTPConduit httpConduit = (HTTPConduit)client.getConduit();
            AuthorizationPolicy policy = new AuthorizationPolicy();
View Full Code Here

Examples of javax.xml.ws.BindingProvider

    @Test
    public void testBogusAddress() throws Exception {
        String realAddress = "http://localhost:9015/SoapContext/SoapPort";
        SOAPServiceBogusAddressTest service = new SOAPServiceBogusAddressTest();
        Greeter greeter = service.getSoapPort();
        BindingProvider bp = (BindingProvider)greeter;
        bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                                   realAddress);
        greeter.greetMe("test");

        //should persist
        greeter.greetMe("test");

        bp.getRequestContext().remove(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
       
        try {
            greeter.greetMe("test");
            fail("Should fail");
        } catch (WebServiceException f) {
            // expected
        }

        bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                                   realAddress);
        String reply = greeter.sayHi();
        assertNotNull("no response received from service", reply);
        assertEquals("Bonjour", reply);
                                  
View Full Code Here

Examples of javax.xml.ws.BindingProvider

       
        // Make a successful invocation
        doubleIt(port, 25);
       
        // Change the STSClient so that it can no longer find the STS
        BindingProvider p = (BindingProvider)port;
        clearSTSClient(p, bus);
       
        // This should succeed as the token is cached
        doubleIt(port, 30);
       
View Full Code Here

Examples of javax.xml.ws.BindingProvider

       
        // Make a successful invocation
        doubleIt(port, 25);
       
        // Change the STSClient so that it can no longer find the STS
        BindingProvider p = (BindingProvider)port;
        clearSTSClient(p, bus);
       
        // This should fail as it can't get the token
        try {
            doubleIt(port, 35);
View Full Code Here

Examples of javax.xml.ws.BindingProvider

        set = service.getPort(portName, SetServiceBA.class);

        /*
         * Add client handler chain so that XTS can add the transaction context to the SOAP messages.
         */
        BindingProvider bindingProvider = (BindingProvider) set;
        List<Handler> handlers = new ArrayList<Handler>(1);
        handlers.add(new JaxWSHeaderContextProcessor());
        bindingProvider.getBinding().setHandlerChain(handlers);
    }
View Full Code Here

Examples of javax.xml.ws.BindingProvider

        set = service.getPort(portName, SetServiceBA.class);

        /*
         * Add client handler chain so that XTS can add the transaction context to the SOAP messages.
         */
        BindingProvider bindingProvider = (BindingProvider) set;
        List<Handler> handlers = new ArrayList<Handler>(1);
        handlers.add(new JaxWSHeaderContextProcessor());
        bindingProvider.getBinding().setHandlerChain(handlers);
    }
View Full Code Here

Examples of javax.xml.ws.BindingProvider

        QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wsrm", "ReliableService");
        URL wsdlURL = new URL(baseUrl, "ReliableService?wsdl");
        Service service = Service.create(wsdlURL, serviceName);
        ReliableService proxy = (ReliableService) service.getPort(ReliableService.class);

        BindingProvider bp = (BindingProvider) proxy;
        bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, new URL(baseUrl, "ReliableService").toString());

        proxy.writeLogMessage();
    }
View Full Code Here

Examples of org.apache.axis2.jaxws.BindingProvider

     */
    public static boolean getExceptionToBeThrownOnSOAPFault(org.apache.axis2.context.MessageContext msgContext){
      if(log.isDebugEnabled()){
        log.debug("start getExceptionToBeThrownOnSOAPFault(MsgContext)");
      }
      BindingProvider bp = (BindingProvider)msgContext.getProperty(BindingProvider.BINDING_PROVIDER);
      if(bp == null){
        return true;
      }
      //ThrowExceptionIfSOAPFault should be checked only for message Mode.
      if(bp instanceof BaseDispatch){
View Full Code Here

Examples of org.apache.axis2.jaxws.spi.BindingProvider

    }

    public Object intercept(Object target, Method method, Object[] arguments, MethodProxy methodProxy) throws Throwable {
        Object proxy = super.intercept(target, method, arguments, methodProxy);

        BindingProvider axisProxy = (BindingProvider) proxy;

        List<Handler> handlers =
            (axisProxy.getBinding() != null) ? axisProxy.getBinding().getHandlerChain() : null;
        AxisService axisService =
            (axisProxy.getEndpointDescription() != null) ? axisProxy.getEndpointDescription().getAxisService() : null;

        DescriptionUtils.registerHandlerHeaders(axisService, handlers);

        return proxy;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.