Response from Web service using Apache CXF shows “No binding operation info..”

后端 未结 5 1859
故里飘歌
故里飘歌 2021-02-07 10:46

The problem description might be long. Please be patient and provide any kind of help since I am new to the web services.

What I have done: I have creat

5条回答
  •  忘了有多久
    2021-02-07 11:35

    Yes already answered you can't directly access the service in a browser url. You need a client code like this

    import org.apache.cxf.interceptor.LoggingInInterceptor;
    import org.apache.cxf.interceptor.LoggingOutInterceptor;
    import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
    import org.junit.Test;
    
    
    @Test
    public void testWhatIsTheAnswer() {
    
        JaxWsProxyFactoryBean factoryBean = new JaxWsProxyFactoryBean();
    
        factoryBean.getInInterceptors().add(new LoggingInInterceptor());
        factoryBean.getOutInterceptors().add(new LoggingOutInterceptor());
        factoryBean.setServiceClass(DeepThought.class);
        factoryBean.setAddress("http://localhost:8084/DeepThoughtWS/services/DeepThoughtPort");
    
        DeepThought service = (DeepThought) factoryBean.create();
    
        service.whatIsTheAnswer("some answer");
    
    }
    

提交回复
热议问题