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.

Example:

The wsdl (I attach the complete file) contains:

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

<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"/>
    </wsdl:operation>
  </wsdl:portType>

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")
public BAPIRETURN bapiCOSTCENTERGETLIST(...) {...}

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
http://www.softwareag.com

Attachment: zws_bapi_costcenter_getlist.wsdl
Description: zws_bapi_costcenter_getlist.wsdl

Reply via email to