axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Torstein Talleraas (Ekstern konsulent)" <torstein.taller...@Braathens.no>
Subject Problems with SOAP request element ordering
Date Wed, 08 May 2002 08:48:46 GMT
The problem: My Java SOAP client (generated by Axis WSDL2Java) produces a
SOAP/XML message with elements *not* ordered as defined by the WSDL.

I am using Axis beta-2, xerces 2.0.1, JDK 1.3.1_01 on a Win 2000 PC,
building both a "pure" Java test program and EJB's to be deployed on WLS 6.1
(SP2).  The problem occurs both in the Java program and the EJB on running
on WLS.

It seems to me that that the problem is located to the serializing logic:
(ref org.apache.axis.enoding.ser.BeanSerializer::serialize() and
org.apache.axis.utils.BeanUtils::processPropertyDescriptors() ).
The methods appearently decide the sequence of the XML elements by using the
ordering of the bean's methods as given by the reflection API.  At least in
my case, this is *not* the same ordering as given by the source code.

Have anyone seen this problem (or better: the solution :-)? Perhaps the
metadata for the generated wrappers should include explicitly state the
sequence?

With regards,
Torstein Talleraas

--- Details of the client follows ----------------------------

The SOAP client is used to access a SOAP server on a "legacy system".  The
SOAP server requires the elements of the call to be ordered as defined by
the WSDL file provided (the ordering is defined by using the xsd:sequence
tag).

The Axis WSDL2Java utility produced a set of Java classes with get/set
methods in the correct sequence.  Some minor modifications had to be done to
adhere to the servers requirements:

1) The following was added to the generated stub invoker method:
      call.setOption(org.apache.axis.AxisEngine.PROP_DOMULTIREFS,
Boolean.FALSE);
      call.setOption(org.apache.axis.AxisEngine.PROP_SEND_XSI,
Boolean.FALSE);

2) The namespace URI's in the QName constructors where replaced with the
empty string "" in *all* the generated Java-classes. (My SOAP server does
not like the namespace prefixes ...)

3) (BUG or FEATURE?) WSDL elements with names like "b_e_id_no" had to be
renamed for the parser to work:
        field.setFieldName("BEIdNo"); // WSDL2Java produced "bEIdNo"

--- end description

Mime
View raw message