AxisFault:javax.xml.stream.XMLStreamException

时间:2012-07-12 05:48:27

标签: soap wsdl axis2 soap-client wsdl2java

我们正在使用drupal soap服务进行Web服务。当我们尝试调用soap服务时,它会返回结果,但是axis2会抛出以下错误......

org.apache.axis2.AxisFault: javax.xml.stream.XMLStreamException: element text content may not contain START_ELEMENT 
 at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430) 
 at com.chm.api.login.client.DrupalSoapStub.fromOM(DrupalSoapStub.java:12249) 
 at com.chm.api.login.client.DrupalSoapStub.userLogin(DrupalSoapStub.java:1408) 
 at SocketClient.main(SocketClient.java:144) 
Caused by: java.lang.Exception: javax.xml.stream.XMLStreamException: element text content may not contain START_ELEMENT 
 at com.chm.api.login.client.DrupalSoapStub$UserLoginResponse$Factory.parse(DrupalSoapStub.java:59804) 
 at com.chm.api.login.client.DrupalSoapStub.fromOM(DrupalSoapStub.java:11473) 
 ... 2 more 
Caused by: javax.xml.stream.XMLStreamException: element text content may not contain START_ELEMENT 
 at org.apache.axiom.om.impl.SwitchingWrapper.getElementText(SwitchingWrapper.java:981) 
 at javax.xml.stream.util.StreamReaderDelegate.getElementText(StreamReaderDelegate.java:100) 
 at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.getElementText(XMLStreamReaderWrapper.java:100) 
 at org.apache.axiom.util.stax.debug.XMLStreamReaderValidator.getElementText(XMLStreamReaderValidator.java:76) 
 at com.chm.api.login.client.DrupalSoapStub$UserLoginResponse$Factory.parse(DrupalSoapStub.java:59770)

1 个答案:

答案 0 :(得分:0)

我遇到过类似的问题,但与你面对的问题并不完全相同。我通过在类路径中添加以下依赖项来解决该问题:

<dependency>
   <groupId>com.sun.xml.ws</groupId>
   <artifactId>jaxws-rt</artifactId>
   <version>2.1.5</version>
</dependency>

我不确定它是否适用于您的问题,但您可以尝试一下。