aspose file tools*
The moose likes Web Services and the fly likes Axis Fault Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Axis Fault" Watch "Axis Fault" New topic
Author

Axis Fault

visu Nekk
Ranch Hand

Joined: Sep 06, 2005
Posts: 122
Hi,

Why am I getting this exception? I am unable to figure it out?


AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client
faultSubcode:
faultString: SOAP request Body contains more than one body element - this service requires that all SOAP requests contain at most one body element.
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:SOAP request Body contains more than one body element - this service requires that all SOAP requests contain at most one body element.
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 com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:633)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(XMLNSDocumentScannerImpl.java:719)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
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.transport.http.HTTPSender.readFromSocket(HTTPSender.java:796)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
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.symantec.www.wsrf.sim.service.access.incident.IncidentAccessSoapHttpBindingStub.subscribe(IncidentAccessSoapHttpBindingStub.java:1133)
at com.symantec.www.wsrf.sim.service.access.incident.SimpleServlet.service(SimpleServlet.java:98)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42908
    
  69
Have you verified that the SOAP request is well-formed by visually inspecting it? The message indicates that that is not the case.
visu Nekk
Ranch Hand

Joined: Sep 06, 2005
Posts: 122
Thanks Ulf,

I have generated the java from wsdl using the wsdl2java tool and developed a client program to access the web service. Hence, I am just calling the method of the web service rather than constructing the whole message. Please suggest me any other options.

Thanks in advance,
Visu Nekk
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42908
    
  69
I'm not sure what you mean by "other options". You're trying to track down a problem. In doing so it is helpful to know if the error being reported is in fact what is going wrong. That can be ascertained by visually inspecting the SOAP that is being transmitted. A tool like tcpmon -which ships with Apache Axis, but can be used independently of it- can help greatly with this.
visu Nekk
Ranch Hand

Joined: Sep 06, 2005
Posts: 122
Thanks Ulf,

I have used tcpmon and figured out that an element that is supposed to part of the request isn't figured and is the cause of the exception. Below is the SOAP envelope.

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<soapenv:Header>

<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soapenv:mustUnderstand="1">
<wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="UsernameToken-20287235">
<wsse:Username>administrator</wsse:Username>
<wsse assword Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">password</wsse assword></wsse:UsernameToken>
</wsse:Security>
<ns1:ResourceIdentifier xmlns:ns1="http://www.xyz.com/wsrf/incident" soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0">0</ns1:ResourceIdentifier>
<ns2:Action xmlns:ns2="http://schemas.xmlsoap.org/ws/2004/03/addressing" soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0">http://www.xyz.com//IncidentAccessPortType/Subscribe</ns2:Action>
<ns3:To xmlns:ns3="http://schemas.xmlsoap.org/ws/2004/03/addressing" soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0">https://xyz.com/services/IncidentAccess</ns3:To>
</soapenv:Header>

<soapenv:Body>
<ConsumerReference xmlns="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd">
<ns4:Address xmlns:ns4="http://schemas.xmlsoap.org/ws/2003/03/addressing">http://localhost:8080/NS</ns4:Address></ConsumerReference>
<TopicExpression xmlns="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd" Dialect="http://docs.oasis-open.org/wsn/2004/06/TopicExpression/Simple">simice:ResourceCreation</TopicExpression>
<UseNotify xmlns="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd">true</UseNotify>
</soapenv:Body>

</soapenv:Envelope>


The actual envelope should be:


<?xml version="1.0" encoding="UTF-8"?>
<Envelope
xmlns="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing"
xmlns:wsnt="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd"
xmlns:simicea="http://xyz.com/wsrf/access/incident"
xmlns:simice="http://xyz.com/wsrf/schema/incident"
xmlns:tns="http://ws.apache.org/notification/base/service/SubscriptionManager"
xmlns:wsrl="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd"
xmlns:wsrlw="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.wsdl">

<Header xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing">

<wsse:Security mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken>
<wsse:Username>administrator</wsse:Username>
<wsse assword Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">password</wsse assword>
</wsse:UsernameToken>
</wsse:Security>

<wsa:To mustUnderstand="1"> subscriptionServer </wsa:To>

<wsa:Action mustUnderstand="1">http://www.xyz.com/wsrf/service/access/incident/IncidentAccessPortType/Subscribe</wsa:Action>

<!-- ResourceIdentifier is required -->
<simicea:ResourceIdentifier mustUnderstand="1">0</simicea:ResourceIdentifier>

</Header>

<Body>

<wsnt:Subscribe>

<wsnt:ConsumerReference>
<wsa:Address> subscriptionClient </wsa:Address>
</wsnt:ConsumerReference>

<wsnt:TopicExpression Dialect="http://docs.oasis-open.org/wsn/2004/06/TopicExpression/Simple">simice:ResourceCreation</wsnt:TopicExpression>

<wsnt:UseNotify>true</wsnt:UseNotify>

</wsnt:Subscribe>

</Body>

</Envelope>

The subscribe elemnent is missing in the SOAP request. What am I supposed to do now? Does it have something to do with the generated code or is it a bug of axis1.4. Please help me out.

Thanks in advance,
visu
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Axis Fault