Details
-
Bug
-
Status: Resolved
-
Blocker
-
Resolution: Fixed
-
1.2
-
None
-
None
-
Windows XP SP2 Tomcat 6.0, JDK 1.6.0, Axis2 1.2, Rampart 1.2
Description
I created a sample for this. I have a getVehicle Method that returns a vehicle.
A Vehicle can be either a Car or a Van. If I return a Van without rampart, everything works fine but when I engage rampart in the services.xml, at the client, I get the exception:
java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement maxload
at sample.SampleSOAP12PortStub.fromOM(SampleSOAP12PortStub.java:392)
at sample.SampleSOAP12PortStub.getVehicle(SampleSOAP12PortStub.java:162)
at sample.Client.main(Client.java:15)
Caused by: java.lang.RuntimeException: Unexpected subelement maxload
at sample.xsd.Vehicle$Factory.parse(Vehicle.java:580)
at sample.messages.xsd.GetVehicleResponse$Factory.parse(GetVehicleResponse.java:374)
at sample.SampleSOAP12PortStub.fromOM(SampleSOAP12PortStub.java:386)
... 2 more
And these are the responses with rampart:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: application/soap+xml; action="urn:getVehicle";charset=UTF-8
Transfer-Encoding: chunked
Date: Thu, 05 Jul 2007 11:45:14 GMT
1ee
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Body>
<ns2:getVehicleResponse xmlns:ns2="http://messages.sample/xsd">
<vehicle xmlns="http://messages.sample/xsd">
<vehicleID xmlns="http://sample/xsd">1</vehicleID>
<weight xmlns="http://sample/xsd">0</weight>
<passengers xmlns="http://sample/xsd">0</passengers>
<maxload xmlns="http://sample/xsd">0</maxload>
</vehicle>
</ns2:getVehicleResponse>
</soapenv:Body>
</soapenv:Envelope>0
and without rampart:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: application/soap+xml; action="urn:getVehicle";charset=UTF-8
Transfer-Encoding: chunked
Date: Thu, 05 Jul 2007 11:46:52 GMT
1e8
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Body>
<ns2:getVehicleResponse xmlns:ns2="http://messages.sample/xsd">
<ns2:vehicle xmlns:s1="http://sample/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="s1:van">
<s1:vehicleID>1</s1:vehicleID>
<s1:weight>0</s1:weight>
<s1:passengers>0</s1:passengers>
<s1:maxload>0</s1:maxload>
</ns2:vehicle>
</ns2:getVehicleResponse>
</soapenv:Body>
</soapenv:Envelope>
0
As you can see, in the first one, which is wrong, there is not the xsi:type="s1:van" attribute that tells which is the correct instance.
Also I could observe one thing. I was trying to debug the server to know what was wrong before realising it was rampart's fault and the execution chain never entered the serialized method of the class getVehicleResponse. Is this the way it's supposed to work???
This issue is maybe the cause of these two other issues I opened some time ago:
https://issues.apache.org/jira/browse/XMLBEANS-329 and
https://issues.apache.org/jira/browse/AXIS2-2578.
Attachments
Attachments
Issue Links
- is blocked by
-
AXIS2-2922 Please fix codegen issues relating to Rampart-29 and Rampart-53
- Resolved