问题
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