用axis做客户端调用Oracle Application Server里的webservice失败

shenbaise000 2010-06-25 07:21:20
直接调用axis服务端发布的webservice没有问题,但是调用Oracle Application Server里的webservice就抛出异常,请高手解决。

Oracle Application Server里webservice的wsdl文件代码如下:


<?xml version="1.0" encoding="UTF-8" ?>
- <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns0="http://ws.gd.chinamobile.com/types/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://ws.gd.chinamobile.com/" name="ServiceModeService" targetNamespace="http://ws.gd.chinamobile.com/">
- <types>
- <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://ws.gd.chinamobile.com/types/" targetNamespace="http://ws.gd.chinamobile.com/types/" elementFormDefault="qualified">
- <element name="queryElement">
- <complexType>
- <sequence>
<element name="mobile" type="string" nillable="true" />
</sequence>
</complexType>
</element>
- <element name="queryResponseElement">
- <complexType>
- <sequence>
<element name="result" type="int" />
</sequence>
</complexType>
</element>
</schema>
</types>
- <message name="ServiceModeService_query">
<part name="parameters" element="tns0:queryElement" />
</message>
- <message name="ServiceModeService_queryResponse">
<part name="parameters" element="tns0:queryResponseElement" />
</message>
- <portType name="ServiceModeService">
- <operation name="query">
<input message="tns:ServiceModeService_query" />
<output message="tns:ServiceModeService_queryResponse" />
</operation>
</portType>
- <binding name="ServiceModeServiceSoapHttp" type="tns:ServiceModeService">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
- <operation name="query">
<soap:operation soapAction="http://ws.gd.chinamobile.com//query" />
- <input>
<soap:body use="literal" />
</input>
- <output>
<soap:body use="literal" />
</output>
</operation>
</binding>
- <service name="ServiceModeService">
- <port name="ServiceModeServiceSoapHttpPort" binding="tns:ServiceModeServiceSoapHttp">
<soap:address location="http://test1:7777/GMCC-GMCC_WS-context-root/ServiceModeServiceSoapHttpPort" />
</port>
</service>
</definitions>


客户端代码:

Service service = new Service();
Call call = (Call) service.createCall();
String endpoint = "http://test1:7777/GMCC-GMCC_WS-context-root/ServiceModeServiceSoapHttpPort";
call.setTargetEndpointAddress(new java.net.URL(endpoint));
QName getDescQn = new QName(endpoint, "query");
call.setOperationName(getDescQn);
String mobile = "";//手机号码
call.invoke(new Object[] {mobile});

异常信息:

AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client
faultSubcode:
faultString: Caught exception while handling request: unrecognized operation: {http://test1:7777/GMCC-GMCC_WS-context-root/ServiceModeServiceSoapHttpPort}query
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:Caught exception while handling request: unrecognized operation: {http://test1:7777/GMCC-GMCC_WS-context-root/ServiceModeServiceSoapHttpPort}query
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.chinamobile.gd.ws.WebServiceServlet.doService(WebServiceServlet.java:227)
at com.chinamobile.gd.ws.WebServiceServlet.main(WebServiceServlet.java:236)

{http://xml.apache.org/axis/}hostname:cary-pc

Caught exception while handling request: unrecognized operation: {http://test1:7777/GMCC-GMCC_WS-context-root/ServiceModeServiceSoapHttpPort}query
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.chinamobile.gd.ws.WebServiceServlet.doService(WebServiceServlet.java:227)
at com.chinamobile.gd.ws.WebServiceServlet.main(WebServiceServlet.java:236)
...全文
100 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
shenbaise000 2010-06-25
  • 打赏
  • 举报
回复
我顶一个先

12,162

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 Web Services
社区管理员
  • Web Services社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧