Java 8 RespectBindingFeature - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 RespectBindingFeature class.

This code example shows how to use the following methods:
    @Test
    public void testRespectBindingFeature() throws Exception {
        startServers("/wsdl_systest/cxf2006.wsdl"); 
         
        try { 
            GreeterRPCLit greeter = service.getPort(portName, GreeterRPCLit.class,
                                                    new RespectBindingFeature(true));
            updateAddressPort(greeter, PORT);
            greeter.greetMe("hello");
            fail("WebServiceException is expected"); 
        } catch (Exception ex) {
            assertTrue("WebServiceException is expected", ex instanceof javax.xml.ws.WebServiceException);
            assertTrue("RespectBindingFeature message is expected: " + ex.getMessage(),
                       ex.getMessage().indexOf("extension with required=true attribute") > -1);
        } 
    } 
     
    @Test
    public void testOperationRespectBindingFeature() throws Exception {
        startServers("/wsdl_systest/cxf_operation_respectbing.wsdl"); 
5
CodeRank
This code example shows how to use the following methods:isEnabled
         
        if (respectBindingFeature == null) {
            throw ExceptionFactory.makeWebServiceException( 
                 Messages.getMessage("respectBindingNotSpecified")); 
        } 
        boolean isEnabled = respectBindingFeature.isEnabled();
        if(isEnabled){
            if(bnd instanceof SOAPBinding){
                ((SOAPBinding)bnd).setRespectBindingEnabled(isEnabled);
            } 
            //Get the wsdl document location, if wsdl is not found throw a WebservicesException. 
            //If wsdl is found, look for wsdl extensions. 
            EndpointDescription endpointDescription = provider.getEndpointDescription();
            endpointDescription.setRespectBinding(isEnabled);
            WSDLExtensionUtils.processExtensions(endpointDescription);
             
            //We have build up set of extensions from wsdl 
            //let go ahead and validate these extensions now. 
            EndpointDescriptionValidator endpointValidator = new EndpointDescriptionValidator(endpointDescription);
              
4
CodeRank
This code example shows how to use the following methods:
        this.enabled = enabled;
    } 
 
    @Override 
    public WebServiceFeature getWebServiceFeature() {
        return new RespectBindingFeature(enabled);
    } 
 
    public boolean isEnabled() { 
        return enabled;
    } 
 
    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    } 
 
    @Override 
    public String toString() {
        return "RespectBindingFeatureInfo [enabled=" + enabled + "]";
    } 
4
CodeRank
This code example shows how to use the following methods:
    private Dispatch<SOAPMessage> createDispatchWithRespectBinding() throws Exception {
        URL wsdlURL = getWsdl();
        assertNotNull(wsdlURL);
        Service svc = Service.create(wsdlURL, serviceName);
         
        WebServiceFeature[] wsf = {new AddressingFeature(true), new RespectBindingFeature(true)};
         
        Dispatch<SOAPMessage> dispatch =
            svc.createDispatch(portName, SOAPMessage.class, Service.Mode.MESSAGE, wsf);
         
        return dispatch;
    } 
     
    private URL getWsdl() throws Exception {
        String wsdlLocation = "/test/org/apache/axis2/jaxws/provider/addressing/META-INF/AddressingProvider.wsdl";
        String baseDir = new File(System.getProperty("basedir",".")).getCanonicalPath();
        wsdlLocation = new File(baseDir + wsdlLocation).getAbsolutePath();    
        File file = new File(wsdlLocation);
        return file.toURL();
    } 
4
CodeRank
See Code Examples for Java 8 RespectBindingFeature Methods: