axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carlos Martins (JIRA)" <j...@apache.org>
Subject [jira] Created: (AXIS2-4945) Axis2 client Unexpected subelement apple
Date Wed, 02 Feb 2011 17:53:29 GMT
Axis2 client Unexpected subelement apple
----------------------------------------

                 Key: AXIS2-4945
                 URL: https://issues.apache.org/jira/browse/AXIS2-4945
             Project: Axis2
          Issue Type: Bug
    Affects Versions: 1.5.4
         Environment: Axis2 1.5.4, Java 1.6, Tomcat 6
            Reporter: Carlos Martins


I developed both a server and client application using Axis2 version 1.5.4, Java 1.6 and the
server is deployed on tomcat 6.
The services are declared using annotations, so there is no .aar files or anything of that
sort.
The WSDL was created automatically by Axis2
The client was made using the stubs and parameters generated by WSDL2Java using the command:

    %axis2_home%\bin\WSDL2Java -p com.audaxys.leaseclient.servicestub.generic -d adb -Eosv
-s -g -u -uw -or -sp -S src/main/java -R src/main/resources --noBuildXML -uri %baseurl%/AppleFinderService.Rpc?wsdl

When the client app calls the method `public Apple loadApple(String appType)` the server responds
returning one instance of Apple class, but the client is unable to de-serialize the response
and throws this exception.

If you know how to fix this, could you please share it with me?
Any clues would be greatly appreciated, really!

###Full stack trace:###
<code>
org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement
apple<br/>
	at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)<br/>
	at com.audaxys.leaseclient.servicestub.generic.AppleFinderServiceStub.fromOM(AppleFinderServiceStub.java:1015)<br/>
	at com.audaxys.leaseclient.servicestub.generic.AppleFinderServiceStub.loadApple(AppleFinderServiceStub.java:343)<br/>
	at com.audaxys.lease.ws.client.TestDummyServices.testLoadApple(TestDummyServices.java:107)<br/>
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br/>
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br/>
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br/>
	at java.lang.reflect.Method.invoke(Method.java:597)<br/>
	at junit.framework.TestCase.runTest(TestCase.java:154)<br/>
	at junit.framework.TestCase.runBare(TestCase.java:127)<br/>
	at junit.framework.TestResult$1.protect(TestResult.java:106)<br/>
	at junit.framework.TestResult.runProtected(TestResult.java:124)<br/>
	at junit.framework.TestResult.run(TestResult.java:109)<br/>
	at junit.framework.TestCase.run(TestCase.java:118)<br/>
	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)<br/>
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)<br/>
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)<br/>
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)<br/>
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)<br/>
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)<br/>
Caused by: java.lang.Exception: org.apache.axis2.databinding.ADBException: Unexpected subelement
apple<br/>
	at com.audaxys.www.namespaces.leasews.LoadAppleResponse$Factory.parse(LoadAppleResponse.java:454)<br/>
	at com.audaxys.leaseclient.servicestub.generic.AppleFinderServiceStub.fromOM(AppleFinderServiceStub.java:981)<br/>
	... 18 more<br/>
Caused by: org.apache.axis2.databinding.ADBException: Unexpected subelement apple<br/>
	at com.audaxys.www.namespaces.leasews.LoadAppleResponse$Factory.parse(LoadAppleResponse.java:448)<br/>
	... 19 more<br/>
</code>

###ServiceDeclaration###
<code>
package com.audaxys.lease.model.generic;
import .....;

@WebService(name="AppleFinderService", serviceName="AppleFinderService", portName="Rpc", targetNamespace="http://www.audaxys.com/namespaces/leasews")
@SOAPBinding(style = Style.RPC, parameterStyle = ParameterStyle.WRAPPED)
public class AppleFinderImpl {

    @WebResult(name = "apple")
    public Apple loadApple(String appType) {
        Apple a = new Apple();
        a.setAppleType(appType);
        return a;
    }
}
</code>

### Apple class ###
<code>
package com.audaxys.lease.model.generic; <br />
 <br />
import javax.xml.bind.annotation.XmlRootElement; <br />
 <br />
@XmlRootElement(namespace="http://www.audaxys.com/namespaces/leasews") <br />
public class Apple { <br />
 <br />
	private String appleType; <br />
 <br />
	public Apple() { <br />
		super(); <br />
	} <br />
 <br />
	public String getAppleType() { <br />
		return appleType; <br />
	} <br />
	public void setAppleType(String appleType) { <br />
		this.appleType = appleType; <br />
	} <br />
} <br />
</code>

###WSDL###
<code>
  &lt;?xml version="1.0" encoding="UTF-8" ?&gt; <br/>
- &lt;definitions name="AppleFinderService" targetNamespace="http://www.audaxys.com/namespaces/leasews"
xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.audaxys.com/namespaces/leasews"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns1="http://jaxb.dev.java.net/array"&gt;
<br/>
- &lt;types&gt; <br/>
- &lt;xsd:schema&gt; <br/>
  &lt;xsd:import namespace="http://www.audaxys.com/namespaces/leasews" schemaLocation="AppleFinderService.Rpc?xsd=AppleFinderService_schema1.xsd"
/&gt;  <br/>
  &lt;/xsd:schema&gt; <br/>
- &lt;xsd:schema&gt; <br/>
  &lt;xsd:import namespace="http://jaxb.dev.java.net/array" schemaLocation="AppleFinderService.Rpc?xsd=AppleFinderService_schema2.xsd"
/&gt;  <br/>
  &lt;/xsd:schema&gt; <br/>
  &lt;/types&gt; <br/>
- &lt;message name="loadAppleResponse"&gt; <br/>
  &lt;part name="apple" type="tns:apple" /&gt;  <br/>
  &lt;/message&gt; <br/>
- &lt;message name="getAppleArray"&gt; <br/>
  &lt;part name="arg0" type="xsd:string" /&gt;  <br/>
  &lt;/message&gt; <br/>
- &lt;message name="loadApple"&gt; <br/>
  &lt;part name="arg0" type="xsd:string" /&gt;  <br/>
  &lt;/message&gt; <br/>
- &lt;portType name="AppleFinderService"&gt; <br/>
- &lt;operation name="getAppleArray"&gt; <br/>
  &lt;input message="tns:getAppleArray" /&gt;  <br/>
  &lt;output message="tns:getAppleArrayResponse" /&gt;  <br/>
  &lt;/operation&gt; <br/>
- &lt;operation name="loadApple"&gt; <br/>
  &lt;input message="tns:loadApple" /&gt;  <br/>
  &lt;output message="tns:loadAppleResponse" /&gt;  <br/>
  &lt;/operation&gt; <br/>
  &lt;/portType&gt; <br/>
- &lt;binding name="RpcBinding" type="tns:AppleFinderService"&gt; <br/>
  &lt;soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" /&gt;
 <br/>
- &lt;operation name="getAppleArray"&gt; <br/>
  &lt;soap:operation soapAction="" /&gt;  <br/>
- &lt;input&gt; <br/>
  &lt;soap:body use="literal" namespace="http://www.audaxys.com/namespaces/leasews" /&gt;
 <br/>
  &lt;/input&gt; <br/>
- &lt;output&gt; <br/>
  &lt;soap:body use="literal" namespace="http://www.audaxys.com/namespaces/leasews" /&gt;
 <br/>
  &lt;/output&gt; <br/>
  &lt;/operation&gt; <br/>
- &lt;operation name="loadApple"&gt; <br/>
  &lt;soap:operation soapAction="" /&gt;  <br/>
- &lt;input&gt; <br/>
  &lt;soap:body use="literal" namespace="http://www.audaxys.com/namespaces/leasews" /&gt;
 <br/>
  &lt;/input&gt; <br/>
- &lt;output&gt; <br/>
  &lt;soap:body use="literal" namespace="http://www.audaxys.com/namespaces/leasews" /&gt;
 <br/>
  &lt;/output&gt; <br/>
  &lt;/operation&gt; <br/>
  &lt;/binding&gt; <br/>
- &lt;service name="AppleFinderService"&gt; <br/>
- &lt;port name="Rpc" binding="tns:RpcBinding"&gt; <br/>
  &lt;soap:address location="http://10.10.5.25:8080/lease.services/soap/services/AppleFinderService.Rpc/"
/&gt;  <br/>
  &lt;/port&gt; <br/>
  &lt;/service&gt; <br/>
  &lt;/definitions&gt; <br/>
</code>
###XSD###
<code>
- &lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.audaxys.com/namespaces/leasews"
attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://www.audaxys.com/namespaces/leasews"&gt;
<br/>
  &lt;xs:element name="apple" type="tns:apple" /&gt;  <br/>
- &lt;xs:complexType name="apple"&gt; <br/>
- &lt;xs:sequence&gt; <br/>
  &lt;xs:element minOccurs="0" name="appleType" type="xs:string" /&gt;  <br/>
  &lt;/xs:sequence&gt; <br/>
  &lt;/xs:complexType&gt; <br/>
- &lt;xs:complexType final="#all" name="appleArray"&gt; <br/>
- &lt;xs:sequence&gt; <br/>
  &lt;xs:element maxOccurs="unbounded" minOccurs="0" name="item" nillable="true" type="tns:apple"
/&gt;  <br/>
  &lt;/xs:sequence&gt; <br/>
  &lt;/xs:complexType&gt; <br/>
  &lt;/xs:schema&gt; <br/>
<code>
###Request###
<code>
&lt;?xml version='1.0' encoding='UTF-8'?&gt; <br />
&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&gt;
<br />
    &lt;soapenv:Body&gt; <br />
        &lt;loadApple xmlns="http://www.audaxys.com/namespaces/leasews"&gt; <br
/>
	    &lt;arg0&gt;Red&lt;/arg0&gt; <br />
	&lt;/loadApple&gt; <br />
    &lt;/soapenv:Body&gt; <br />
&lt;/soapenv:Envelope&gt; <br />
</code>
###Responsse###
<code>
&lt;?xml version="1.0" encoding="UTF-8"?&gt; <br />
&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&gt;<br
/>
   &lt;soapenv:Body&gt;<br />
      &lt;rpcOp:loadAppleResponse xmlns:rpcOp="http://www.audaxys.com/namespaces/leasews"&gt;<br
/>
         &lt;rpcOp:apple xmlns:ns3="http://com.audaxys.lease/" xmlns=""&gt;<br
/>
	    &lt;appleType&gt;Red&lt;/appleType&gt;<br />
	 &lt;/rpcOp:apple&gt;<br />
      &lt;/rpcOp:loadAppleResponse&gt;<br />
   &lt;/soapenv:Body&gt;<br />
&lt;/soapenv:Envelope&gt;<br />
</code>

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


Mime
View raw message