初次运行调用axis2的webservice出错问题,,请高手,急需!!谢谢

胡三刀 发布于 2011/04/12 16:26
阅读 6K+
收藏 1

我写了个helloworld的类 直接传到POJO文件夹里 然后直接在页面上就能看到这个webservice ,也可以直接在页面上直接去

加上方法名?参数值去调用

 

但是我写客户端去调用的时候就出问题了

我客户端代码是这样写的

public class TestInvoke {

 

public static void main(String[] args) throws AxisFault {

RPCServiceClient client = new RPCServiceClient();

Options options = client.getOptions();

String address = "http://localhost:8080/axis2/services/HelloWorldService";

EndpointReference epf = new EndpointReference(address);

options.setTo(epf);

QName qname = new QName("http://ws.apache.org/axis2", "sayHello");

Object[] result = client.invokeBlocking(qname, new Object[] { "jack" }, new Class[] { String.class });

System.out.println(result[0]);

}

}

 

运行后报这样的错误

- OMException in getSOAPBuilder

org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '"' (code 34) in DOCTYPE declaration; expected a space between public and system identifiers

 at [row,col {unknown-source}]: [1,50]

at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:293)

at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:204)

at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:154)

at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:140)

at org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:686)

at org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:215)

at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:145)

at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:108)

at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:67)

at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:354)

at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417)

at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)

at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)

at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:540)

at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:521)

at org.apache.axis2.rpc.client.RPCServiceClient.invokeBlocking(RPCServiceClient.java:102)

at hx.test.TestInvoke.main(TestInvoke.java:29)

Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '"' (code 34) in DOCTYPE declaration; expected a space between public and system identifiers

 at [row,col {unknown-source}]: [1,50]

at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:648)

at com.ctc.wstx.sr.BasicStreamReader.startDTD(BasicStreamReader.java:2482)

at com.ctc.wstx.sr.BasicStreamReader.nextFromPrologBang(BasicStreamReader.java:2398)

at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2058)

at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)

at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStreamReaderWrapper.java:225)

at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:672)

at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214)

... 16 more

- Remaining input stream :[]

Exception in thread "main" org.apache.axis2.AxisFault: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '"' (code 34) in DOCTYPE declaration; expected a space between public and system identifiers

 at [row,col {unknown-source}]: [1,50]

at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)

at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:123)

at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:67)

at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:354)

at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417)

at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)

at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)

at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:540)

at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:521)

at org.apache.axis2.rpc.client.RPCServiceClient.invokeBlocking(RPCServiceClient.java:102)

at hx.test.TestInvoke.main(TestInvoke.java:29)

Caused by: org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '"' (code 34) in DOCTYPE declaration; expected a space between public and system identifiers

 at [row,col {unknown-source}]: [1,50]

at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:293)

at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:204)

at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:154)

at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:140)

at org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:686)

at org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:215)

at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:145)

at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:108)

... 9 more

Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '"' (code 34) in DOCTYPE declaration; expected a space between public and system identifiers

 at [row,col {unknown-source}]: [1,50]

at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:648)

at com.ctc.wstx.sr.BasicStreamReader.startDTD(BasicStreamReader.java:2482)

at com.ctc.wstx.sr.BasicStreamReader.nextFromPrologBang(BasicStreamReader.java:2398)

at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2058)

at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)

at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStreamReaderWrapper.java:225)

at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:672)

at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214)

... 16 more

Process exited with exit code 1.

 

请高手解决 急需啊

谢谢各位了

加载中
返回顶部
顶部