[
https://issues.apache.org/jira/browse/AXIS2-2352?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Raghu Upadhyayula updated AXIS2-2352:
-------------------------------------
Environment: Linux, JDK 1.5.0_06, JBoss App Server. (was: Windows
XP, JDK 1.4.2_09)
Affects Version/s: (was: 1.2)
1.3
Summary: invoking webservices client from another environment is
getting org.apache.axis2.AxisFault: First Element must contain the local name,
Envelope (was: XMLBeans client getting org.apache.axis2.AxisFault: First
Element must contain the local name, Envelope)
Hi,
I tried this with Axis2 1.3 RC3 release jars.
When I deploy my webservices on my desktop(windows xp) and test it
using a java client, it is working fine.
But when the same webservices project is built & deployed in our
test environment (linux) and tested using java client, I'm getting the below
exception.
This AxisFault is thrown because the SOAP response is a html which
says that there is a NullPointerException in AxisServlet.java : 171
I'm attaching the zip file which contains the client code & the wsdl
file.
org.apache.axis2.AxisFault: First Element must contain the local name, Envelope
First Element must contain the local name, Envelope
org.apache.axis2.AxisFault: First Element must contain the local name, Envelope
at
org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:81)
at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:356)
at
org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
at
com.rsys.ws.client.ResponsysWSServiceStub.login(ResponsysWSServiceStub.java:276)
at com.rsys.ws.samples.TestRILoginCmd.execute(TestRILoginCmd.java:29)
at com.rsys.ws.samples.TestRILoginCmd.execute(TestRILoginCmd.java:16)
at
com.rsys.ws.samples.TestResponsysWSClient.main(TestResponsysWSClient.java:40)
Caused by: org.apache.axiom.soap.SOAPProcessingException: First Element must
contain the local name, Envelope
at
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(StAXSOAPModelBuilder.java:221)
at
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(StAXSOAPModelBuilder.java:179)
at
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:135)
at
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:163)
at
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:111)
at
org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:474)
at
org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:142)
at
org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:77)
... 6 more
I'm using Axis2 deployed in Jboss.
Here is the SOAP request & response to & from the test environment.
SOAP Request
*****************
POST /webservices/services/ResponsysWSService HTTP/1.1
Content-Type: text/xml; charset=UTF-8
SOAPAction: ""
User-Agent: Axis2
Host: flooz.qa.responsys.com:1234
Transfer-Encoding: chunked
119
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns1:login xmlns:ns1="urn:ws.rsys.com">
<ns1:username>raghu</ns1:username>
<ns1:password>raghu</ns1:password>
</ns1:login>
</soapenv:Body>
</soapenv:Envelope>
0
SOAP Response
*******************
HTTP/1.1 500 Internal Server Error
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=utf-8
Content-Length: 1462
Date: Fri, 03 Aug 2007 20:48:18 GMT
Connection: close
<html>
<head>
<title>Apache Tomcat/5.5.20 - Error report</title>
<style>
<!--
H1
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
H2
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
H3
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
BODY
{font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;}
B
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;}
P
{font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}
A {color : black;}A.name {color : black;}HR {color : #525D76;}
-->
</style>
</head>
<body>
<h1>HTTP Status 500 - </h1>
<HR size="1" noshade="noshade">
<p>
<b>type</b>
Exception report
</p>
<p>
<b>message</b>
<u></u>
</p>
<p>
<b>description</b>
<u>The server encountered an internal error () that prevented it
from fulfilling this request.</u>
</p>
<p>
<b>exception</b>
<pre>
java.lang.NullPointerException
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:171)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
</pre>
</p>
<p>
<b>note</b>
<u>The full stack trace of the root cause is available in the
Apache Tomcat/5.5.20 logs.</u>
</p>
<HR size="1" noshade="noshade">
<h3>Apache Tomcat/5.5.20</h3>
</body>
</html>
Thanks
Raghu
> invoking webservices client from another environment is getting
> org.apache.axis2.AxisFault: First Element must contain the local name,
> Envelope
> -----------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: AXIS2-2352
> URL: https://issues.apache.org/jira/browse/AXIS2-2352
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Components: client-api, codegen, wsdl
> Affects Versions: 1.3
> Environment: Linux, JDK 1.5.0_06, JBoss App Server.
> Reporter: Raghu
> Assignee: Amila Chinthaka Suriarachchi
> Priority: Blocker
> Fix For: 1.3
>
> Attachments: axis2.log, TestWS.zip
>
>
> This does not seem to be related to the REST problem mentioned in some of
> the other issues. since on the server side (a non-Axis server) I see the
> following:
> POST / HTTP/1.1
> SOAPAction: "bookstore.echoMe"
> User-Agent: Axis2
> Host: localhost:4444
> Transfer-Encoding: chunked
> Content-Type: text/xml; charset=UTF-8
> [Fatal Error] :-1:-1: Premature end of file.
> This is the process I followed:
> I installed the said version of Axis2 today.
> I have my own wsdl (produced below).
> I set up JAVA_HOME, AXIS2_HOME.
> Then I ran:
> c:\axis2-1.1.1\bin\wsdl2java.bat -f -d xmlbeans -uri c:\wsdl\bookstore.wsdl
> which produced dirs/files under my current directory.
> Then I wrote a client class to invoke the operation (produced below).
> When I run it I get this exception on the client side I get the following
> exception.
> org.apache.axis2.AxisFault: First Element must contain the local name,
> Envelope; nested exception is:
> org.apache.axiom.soap.SOAPProcessingException: First Element must
> contain the local name, Envelope
> at
> org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:126)
> at
> org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:67)
> at
> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:252)
> at
> org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:202)
> at bookstore.BookstoreStub.echoMe(BookstoreStub.java:141)
> at client_pkg.MyAxisClient.thisEchoMe(MyAxisClient.java:43)
> at client_pkg.MyAxisClient.main(MyAxisClient.java:22)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
> Caused by: org.apache.axiom.soap.SOAPProcessingException: First Element must
> contain the local name, Envelope
> at
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(StAXSOAPModelBuilder.java:217)
> at
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(StAXSOAPModelBuilder.java:175)
> at
> org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:120)
> at
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:159)
> at
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.identifySOAPVersion(StAXSOAPModelBuilder.java:133)
> at
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:108)
> at
> org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:120)
> ... 11 more
> Here is the wsdl file:
> <definitions name="bookstoredefinitions" targetNamespace="bookstore"
> xmlns:tns="bookstore" xmlns="http://schemas.xmlsoap.org/wsdl/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
> <types>
> <xsd:schema targetNamespace="bookstore" elementFormDefault="qualified"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="bookstore">
> <xsd:element name="echoMe">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="AuthorName">
> <xsd:complexType>
> <xsd:attribute name="Value" type="xsd:string"/>
>
> </xsd:complexType>
> </xsd:element>
> <xsd:element name="BookName">
> <xsd:complexType>
> <xsd:attribute name="Value" type="xsd:string"/>
> </xsd:complexType>
> </xsd:element>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> <xsd:element name="echoMeResponse">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="AuthorName">
> <xsd:complexType>
> <xsd:attribute name="Value" type="xsd:string"/>
>
> </xsd:complexType>
> </xsd:element>
> <xsd:element name="BookName">
> <xsd:complexType>
> <xsd:attribute name="Value" type="xsd:string"/>
> </xsd:complexType>
> </xsd:element>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> </xsd:schema>
> </types>
> <message name="echoMe">
> <part name="parameters" element="tns:echoMe"/>
> </message>
> <message name="echoMeResponse">
> <part name="parameters" element="tns:echoMeResponse"/>
> </message>
> <portType name="bookstoreportType">
> <operation name="echoMe">
> <input message="tns:echoMe" />
> <output message="tns:echoMeResponse" />
> </operation>
> </portType>
> <binding name="bookstorebinding" type="tns:bookstoreportType">
> <soap:binding style="document"
> transport="http://schemas.xmlsoap.org/soap/http"/>
> <operation name="echoMe">
> <soap:operation soapAction="bookstore.echoMe"/>
> <input>
> <soap:body use="literal"/>
> </input>
> <output>
> <soap:body use="literal"/>
> </output>
> </operation>
> </binding>
> <service name="bookstore">
> <port binding="tns:bookstorebinding" name="bookstoreport">
> <soap:address location="http://localhost:4444"/>
> </port>
> </service>
> </definitions>
> Is there a way I can include all the generated files?
> Here is the client code:
> package client_pkg;
> import bookstore.BookstoreStub;
> import bookstore.EchoMeDocument;
> import bookstore.EchoMeResponseDocument;
> import bookstore.impl.EchoMeDocumentImpl;
> import org.apache.xmlbeans.XmlOptions;
> public class MyAxisClient
> {
> public static void main( String args[] ) throws Exception
> {
> BookstoreStub stub = new BookstoreStub();
>
> thisEchoMe(stub);
> }
>
> public static void thisEchoMe(BookstoreStub stub)
> {
> try {
> EchoMeDocument reqDoc = EchoMeDocument.Factory.newInstance();
> EchoMeDocument.EchoMe req = reqDoc.addNewEchoMe();
>
> EchoMeDocument.EchoMe.AuthorName aname = req.addNewAuthorName();
> aname.setValue("AuthorZ");
>
> EchoMeDocument.EchoMe.BookName bname = req.addNewBookName();
> bname.setValue("BookZ");
>
> stub.echoMe(reqDoc);
>
> }
> catch (Exception e)
> {
> e.printStackTrace();
> System.out.println("\n\n\n");
> }
> }
>
> }
> Please let me know if you need to know anything else.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]