tuscany-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Millies, Sebastian" <Sebastian.Mill...@softwareag.com>
Subject Wrong result type in web service operation
Date Wed, 16 Nov 2011 16:41:33 GMT
Hello there,

I’m facing the situation that a call to web service over a Tuscany service reference
returns an object of the wrong type, meaning it does not return the type of object
that is specified by the service interface as generated from wsimport.


The wsdl (I attach the complete file) contains:

<xsd:element name="BAPI_COSTCENTER_GETLISTResponse">
                <xsd:element name="COSTCENTER_LIST" type="tns:TABLE_OF_BAPI0012_2"/>
            <xsd:element name="RETURN" type="tns:BAPIRETURN"/>

<wsdl:portType name="ZWS_BAPI_COSTCENTER_GETLIST">
    <wsdl:operation name="BAPI_COSTCENTER_GETLIST">
      <wsdl:input message="tns:BAPI_COSTCENTER_GETLIST"/>
      <wsdl:output message="tns:BAPI_COSTCENTER_GETLISTResponse"/>

wsimport generates the following method in an interface ZWSBAPICOSTCENTERGETLIST:

@WebResult(name = "RETURN", targetNamespace = "")
@RequestWrapper(localName = "BAPI_COSTCENTER_GETLIST", targetNamespace = "urn:sap-com:document:sap:rfc:functions",
className = "generated.BAPICOSTCENTERGETLIST")
@ResponseWrapper(localName = "BAPI_COSTCENTER_GETLISTResponse", targetNamespace = "urn:sap-com:document:sap:rfc:functions",
className = "generated.BAPICOSTCENTERGETLISTResponse")

where the return type is chosen to be BAPIRETURN.

However, the operation that is actually used by Tuscany returns the other constituent of BAPI_COSTCENTER_GETLISTResponse,
which is an object of type TABLE_OF_BAPI0012_2.

So my question is threefold:

a)      why does wsimport single out the RETURN parameter? Can I influence that somehow?

b)      why does the Tuscany client proxy not make the same choice as wsimport, leading to
a ClassCastException?

c)       What I’d really like is to simply get back an object of type BAPI_COSTCENTER_GETLISTResponse,
which makes up the body of the SOAP
response, so I have access to both return values. How can I get that?

n  Sebastian

PS: This is with Tuscany 1.6 and Java 6.
IDS Scheer Consulting GmbH
Geschäftsführer/Managing Directors: Kamyar Niroumand, Ivo Totev
Sitz/Registered office: Altenkesseler Straße 17, 66115 Saarbrücken, Germany - Registergericht/Commercial
register: Saarbrücken HRB 19681

View raw message