Discussion:
Problems array-responses from Axis2 (pure & wsGen)
Sven Abels
2007-07-13 13:19:38 UTC
Permalink
Hello,



we are currently using xFire 1.2.6 to access an (MTOM-enabled) webservice
that is written in Axis. I used wsGen (jaxb bindings) to generate a
webservice client. This works well for some methods but it fails whenever
calling a method that returns an array of objects. I meanwhile also tries
to use the 'simple / manual' method to write a client as described in the
"dynamic client" section of your website.





Here is some details (I also sent those to the user list)
----------------------------------------------



For example, one method looks takes some strings as a parameter and returns
an array of objects. wsGen generated the following header:



public List<QueryTestResult> queryTest(

@WebParam(name = "xmlQueryTest", targetNamespace = "...")

String xmlQueryTest,

@WebParam(name = "transactionID", targetNamespace = "...")

String transactionID,

@WebParam(name = "userID", targetNamespace = "...")

String userID,

@WebParam(name = "securityToken", targetNamespace = "...")

String securityToken) throws Exception;



The QueryTestResult object is rather simple. It was generated like this:



@XmlAccessorType(XmlAccessType.FIELD)

@XmlType(name = "QueryTestResult", propOrder = {

"arrival",

"seemID",

"type"

})

public class QueryTestResult {



@XmlElement(required = true, nillable = true)

protected XMLGregorianCalendar arrival;

@XmlElement(required = true, nillable = true)

protected String seemID;

@XmlElement(required = true, nillable = true)

protected SrrnLayerEnum type;

[. (getters and setters dropped).]





I used soapUI to manually access the method and the response looks like
this:



<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">

<soapenv:Body>

<ns1:getAttachedDocumentsInfosResponse xmlns:ns1="...">

<ns1:return>

<ns1:documentName>testDocument.pdf</ns1:documentName>

<ns1:documentType>PDF</ns1:documentType>

<ns1:seemId>1184231105548</ns1:seemId>

</ns1:return>

</ns1:getAttachedDocumentsInfosResponse>

</soapenv:Body>

</soapenv:Envelope>





When accessing those kinds of methods I either get either an exception or an
array of objects with empty attributes. In this specific method I always
get an array of 3 QueryTestResult elements that always have NULL values for
all attributes.



For me it looks like xFire is 'thinking' that the attributes are
QueryTestResult elements instead of the attributes of ONE QueryTestResult
element. I created a similar webservice with xFire and this one responds
like this:



<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<soap:Body>

<ns1:queryTestResponse xmlns:ns1="...">

<ns1:out>

<ns1:QueryTestResult>

<arrival xmlns="...">2007-07-12T15:59:21.109+02:00</arrival>

<seemID xmlns="...">12342354345</seemID>

<type xmlns="...">DISTRIBUTION</type>

</ns1:QueryTestResult>

</ns1:out>

</ns1:queryTestResponse>

</soap:Body>

</soap:Envelope>



So it looks like this one has one 'hierarchy' more in the soap answer.



Does anyone has an idea why xFire isn't able to parse the Axis2 response and
how I can make xFire to accept the response?



The relevant part of the WSDL file of the original webservice is the
following:



<xs:element name="queryTestResponse">

<xs:complexType>

<xs:sequence>

<xs:element maxOccurs="unbounded" name="return" nillable="true"

type="ns:QueryTestResult"/>

</xs:sequence>

</xs:complexType>

</xs:element>



<xs:element name="QueryTestResult" type="ns:QueryTestResult"/>



<xs:complexType name="QueryTestResult">

<xs:sequence>

<xs:element name="arrival" nillable="true" type="xs:dateTime"/>

<xs:element name="seemID" nillable="true" type="xs:string"/>

<xs:element name="type" nillable="true" type="ns:SrrnLayerEnum"/>

</xs:sequence>

</xs:complexType>









Best greetings,



Sven
Puneet Gupta
2014-05-31 08:36:01 UTC
Permalink
Post by Sven Abels
Hello,
 
we are currently using xFire 1.2.6 to
access an (MTOM-enabled) webservice that is written in Axis. I used wsGen
(jaxb
Post by Sven Abels
bindings) to generate a webservice client. This works well for some
methods but
Post by Sven Abels
it fails whenever calling a method that returns an array of objects.  I
meanwhile
Post by Sven Abels
also tries to use the ‘simple / manual’ method to write a client as
described
Post by Sven Abels
in the “dynamic client” section of your website.
.....
.....  
.....
Best greetings,
 
Sven 
Hello Sven,

You got any solution for the above mentioned problem. I am facing similar
issue.

I am trying to call Apache CXF 2.7.11 service with aegis data binding
from a Axis2 client. My service method takes input an array of type X with
seven properties. At server side it is creating seven objects of type X
and initializing every property with null.

I am in desperate need for solution of this problem. Any help is highly
appreciated.

Regards,
Puneet.



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Loading...