客户端程序:
String endpoint = "http://192.168.0.124:8081/axis2-web/HelloWorld.jws?wsdl";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpoint));
call.setOperationName("getString");
String getString = (String) call.invoke("getString",new Object[]{});
System.out.println(getString);异常信息:
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXParseException: Content is not allowed in prolog.
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXParseException: Content is not allowed in prolog.
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:225)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:645)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:173)
at org.apache.axis.client.Call.invokeEngine(Call.java:2737)
at org.apache.axis.client.Call.invoke(Call.java:2720)
at org.apache.axis.client.Call.invoke(Call.java:2396)
at org.apache.axis.client.Call.invoke(Call.java:2319)
at org.apache.axis.client.Call.invoke(Call.java:2344)
at webservice.client.Client.main(Client.java:15) {http://xml.apache.org/axis/}hostname:ideal140org.xml.sax.SAXParseException: Content is not allowed in prolog.
at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:650)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:173)
at org.apache.axis.client.Call.invokeEngine(Call.java:2737)
at org.apache.axis.client.Call.invoke(Call.java:2720)
at org.apache.axis.client.Call.invoke(Call.java:2396)
at org.apache.axis.client.Call.invoke(Call.java:2319)
at org.apache.axis.client.Call.invoke(Call.java:2344)
at webservice.client.Client.main(Client.java:15)
Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
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:225)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:645)
... 9 more不知道到为什么,本人出学webservice
String endpoint = "http://192.168.0.124:8081/axis2-web/HelloWorld.jws?wsdl";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpoint));
call.setOperationName("getString");
String getString = (String) call.invoke("getString",new Object[]{});
System.out.println(getString);异常信息:
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXParseException: Content is not allowed in prolog.
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXParseException: Content is not allowed in prolog.
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:225)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:645)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:173)
at org.apache.axis.client.Call.invokeEngine(Call.java:2737)
at org.apache.axis.client.Call.invoke(Call.java:2720)
at org.apache.axis.client.Call.invoke(Call.java:2396)
at org.apache.axis.client.Call.invoke(Call.java:2319)
at org.apache.axis.client.Call.invoke(Call.java:2344)
at webservice.client.Client.main(Client.java:15) {http://xml.apache.org/axis/}hostname:ideal140org.xml.sax.SAXParseException: Content is not allowed in prolog.
at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:650)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:173)
at org.apache.axis.client.Call.invokeEngine(Call.java:2737)
at org.apache.axis.client.Call.invoke(Call.java:2720)
at org.apache.axis.client.Call.invoke(Call.java:2396)
at org.apache.axis.client.Call.invoke(Call.java:2319)
at org.apache.axis.client.Call.invoke(Call.java:2344)
at webservice.client.Client.main(Client.java:15)
Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
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:225)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:645)
... 9 more不知道到为什么,本人出学webservice
解决方案 »
- hibernate配置文件错误 BasUserInfo is not mapped [from BasUserInfo]
- spring opensessioninviewIntercepter
- scriptx费用问题
- Apache Tomcat 6.0版本
- 请教Struts 资源文件中回车的问题?
- XML转化为bean出现错误,急,在线等
- 如何把数据库中的信息取出后按照事先定义好的位置填入word文档中。高分求
- 紧急:JBuilder9下用微软的JDBC驱动连接SQL Server失败????
- 请高人指点,如何用javamail开发的发送邮件程序中发送是否需要回执
- Software caused connection abort: socket write error
- 北京ofbiz沙龙 世纪科贸大厦B座举行
- org.hibernate.hql.ast.QuerySyntaxException 这个异常很奇怪,大家来看看~~很着急啊
String getString = (String) call.invoke("getString", new Object[]{"15000000000"})[0];其中 15000000000 和 0 是你要传进去的参数。