[ 
https://issues.apache.org/jira/browse/AXIS2-2352?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12510499
 ] 

Jay Howard commented on AXIS2-2352:
-----------------------------------

I'm seeing the same thing with a client generated via wsdl2java.  Client code 
is run on OSX w/ Java 1.5.  The remote service uses Axis2 1.2 inside Tomcat 5.5 
on Linux w/ Java 6.

> XMLBeans client 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.2
>         Environment: Windows XP, JDK 1.4.2_09
>            Reporter: Raghu
>            Assignee: Davanum Srinivas
>            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]

Reply via email to