Apache CXF Webservice failing on AJAX call

╄→гoц情女王★ 提交于 2019-12-25 06:13:22

问题


We have developed a webservice based on Apache CXF.

This is working fine when accessed normally that is using APIGEE or by using a JaxWsProxyFactoryBean (A clinet for Apache CXF). But when I tried to access this by providing the SOAP Address through AJAX call it is giving me the following exception:

INFO: Interceptor has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: No such operation:  (HTTP GET PATH_INFO: /tata-ws-1.0/TataWeb)
        at org.apache.cxf.interceptor.URIMappingInterceptor.handleMessage(URIMappingInterceptor.java:77)
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
        at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:89)
        ...

This is my AJAX call code happens on click of a button

<a onclick="sendRequest('GET','http://localhost:8080/tata-ws-1.0/services/TataWeb')"href="#">

Get Data:

function sendRequest(method, url)
{
    method == 'POST';
    {
        http.open(method,url,true);
        http.onreadystatechange = handleResponse;
        http.send(null);
    }
}

The URL for WSDL is correct because when i use http://localhost:8080/tata-ws-1.0/services/TataWeb?wsdl it shows the WSDL for that webservice.

Please share your inputs. Thanks.


回答1:


Your need to send a SOAP request rather than a regular HTTP request. Best way would be use something like this: http://archive.plugins.jquery.com/project/jqSOAPClient



来源:https://stackoverflow.com/questions/8502993/apache-cxf-webservice-failing-on-ajax-call

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!