ws-kandula-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Herwig David (JIRA)" <j...@apache.org>
Subject [jira] Commented: (AXIS2-4446) Serviceclient problem invoking operations which have extended classes as parameters
Date Tue, 20 Apr 2010 12:49:50 GMT

    [ https://issues.apache.org/jira/browse/AXIS2-4446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12858859#action_12858859
] 

Herwig David commented on AXIS2-4446:
-------------------------------------

Hi Andreas,

I've a similar issue with Axis2 1.5.1.

I call the method getList of my web service WSAssortmentOrder. In the request the parameter
of type AssortmentListRequest has an element of type AuthenticationV0100 as displayed in the
soap request. 
AuthenticationV0100 is defined as a sub class of class Authentication.

The WSDL file contains both definitions of complex type Authentication and AuthenticationV0100.

However when I call the Web Service the extended class is not instantiated.

I'd expected that from the definitions in the WSDL file and the "type" attribute in the soap
request the correct instantiation of AuthenticationV0100 could be done.

Thanks 
Herwig
------------------------

Request:
<?xml version="1.0" encoding="UTF-8"?>
   <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
      <soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
         <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
soapenv:mustUnderstand="true">
...
         </wsse:Security>
         <wsa:MessageID>urn:uuid:8122BF649CC38AC52E1271764530001</wsa:MessageID>
         <wsa:Action>urn:getList</wsa:Action>
      </soapenv:Header>
      <soapenv:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
wsu:Id="id-3">
         <ns1:getList xmlns:ns1="http://ws.xy.com/">
            <ns1:AssortmentListRequest>
               <ns1:authentication xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="ns1:AuthenticationV0100">
                  <ns1:account xsi:type="ns1:AccountKeyV0100">
                     <ns1:custId>33996</ns1:custId>
                     <ns1:userId>1083</ns1:userId>
                  </ns1:account>
                  <ns1:password>N0ySHi65zz5jXOkZMJCYydkvndS</ns1:password>
               </ns1:authentication>
               <ns1:data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:AssortmentListRequestDataV0100"></ns1:data>
            </ns1:AssortmentListRequest>
         </ns1:getList>
      </soapenv:Body>
   </soapenv:Envelope>

-----------------------------------

@WebService
public class WSAssortmentOrder
{
  static Logger log = Logger.getLogger(WSAssortmentOrder.class);

  @WebMethod
  public AssortmentListResponse getList(@WebParam(name="AssortmentListRequest") AssortmentListRequest
request) {

    String version = "";
    Authentication auth = request.getAuthentication();

    if (auth instanceof AuthenticationV0100) {
      version = "V0100";
    }
    log.debug(METHODE + "Version = " + version);
...
  }

---------------------------------------------------

WSDL file for web service:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:tns="http://ws.xy.com/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
targetNamespace="http://ws.xy.com/">
    <wsdl:types>
        <xsd:schema attributeFormDefault="unqualified" elementFormDefault="unqualified">
            <xsd:import namespace="http://ws.xy.com/" schemaLocation="./WSAssortmentOrderService_schema1.xsd"/>
        </xsd:schema>
    </wsdl:types>
    <wsdl:message name="getList">
        <wsdl:part name="parameters" element="tns:getList"/>
    </wsdl:message>
    <wsdl:message name="getListResponse">
        <wsdl:part name="parameters" element="tns:getListResponse"/>
    </wsdl:message>
    <wsdl:portType xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" name="WSAssortmentOrderPortType"
wsp:PolicyURIs="#WSAssortmentOrder">
        <wsdl:operation name="getList">
            <wsdl:input message="tns:getList" wsaw:Action="urn:getList"/>
            <wsdl:output message="tns:getListResponse" wsaw:Action="http://ws.xy.com/WSAssortmentOrder/getListResponse"/>
        </wsdl:operation>
        <wsdl:operation name="genClassesUsedForVersionV0100">
            <wsdl:input message="tns:genClassesUsedForVersionV0100" wsaw:Action="http://ws.xy.com/WSAssortmentOrder/genClassesUsedForVersionV0100Request"/>
            <wsdl:output message="tns:genClassesUsedForVersionV0100Response" wsaw:Action="http://ws.xy.com/WSAssortmentOrder/genClassesUsedForVersionV0100Response"/>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="WSAssortmentOrderPortBinding" type="tns:WSAssortmentOrderPortType">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
        <wsdl:operation name="getList">
            <soap:operation soapAction="urn:getList" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="WSAssortmentOrder">
        <wsdl:port name="WSAssortmentOrderPort" binding="tns:WSAssortmentOrderPortBinding">
            <soap:address location="http://localhost:8080/axis2/services/WSAssortmentOrder.WSAssortmentOrderPort/"/>
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>

-------------------------------------
XSD file ./WSAssortmentOrderService_schema1.xsd:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://ws.xy.com/" attributeFormDefault="unqualified"
elementFormDefault="qualified" targetNamespace="http://ws.xy.com/">

<xs:element name="getList" type="tns:getList"/>

<xs:element name="getListResponse" type="tns:getListResponse"/>

<xs:complexType name="getList">
  <xs:sequence>
    <xs:element minOccurs="0" name="AssortmentListRequest" type="tns:AssortmentListRequest"/>
  </xs:sequence>
</xs:complexType>

<xs:complexType name="AssortmentListRequest">
  <xs:sequence>
    <xs:element name="authentication" type="tns:Authentication"/>
    <xs:element name="data" type="tns:AssortmentListRequestData"/>
  </xs:sequence>
</xs:complexType>

<xs:complexType name="Authentication">
  <xs:sequence>
  ...
  </xs:sequence>
</xs:complexType>

<xs:complexType name="AuthenticationV0100">
  <xs:complexContent>
    <xs:extension base="tns:Authentication">
      <xs:sequence>
        <xs:element name="password" type="xs:string"/>
      </xs:sequence>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

<xs:complexType name="AssortmentListRequestData">
  <xs:sequence/>
</xs:complexType>



> Serviceclient problem invoking operations which have extended classes as parameters
> -----------------------------------------------------------------------------------
>
>                 Key: AXIS2-4446
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4446
>             Project: Axis2
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.4.1
>         Environment: Windows
>            Reporter: Banu Maheswari
>
> Hi,
> When I try to invoke a webservice which takes as argument, an extended class, then it
is returning the following error.
> org.apache.axiom.om.OMException: java.lang.NullPointerException
>             at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:249)
>             at org.apache.axiom.om.impl.llom.OMNodeImpl.build(OMNodeImpl.java:327)
>             at org.apache.axiom.om.impl.llom.OMElementImpl.build(OMElementImpl.java:706)
>             at org.apache.axiom.om.impl.llom.OMElementImpl.detach(OMElementImpl.java:675)
>             at org.apache.axiom.om.impl.llom.OMNodeImpl.setParent(OMNodeImpl.java:124)
>             at org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:274)
>             at org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:203)
>             at org.apache.axiom.soap.impl.llom.SOAPBodyImpl.addChild(SOAPBodyImpl.java:231)
>             at org.apache.axis2.client.ServiceClient.fillSOAPEnvelope(ServiceClient.java:713)
>             at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:545)
>             at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:528)
>             at org.apache.axis2.rpc.client.RPCServiceClient.invokeBlocking(RPCServiceClient.java:102)
> I have a User class {username, password} and a Master class which extends User class
{ address, accountType} in my webservice app.
> In my client application when i call serviceClient.invokeBlocking(operation, args.toArray(),
returnTypes), where I pass Master class object as one of args, then I get the above error.
> However when I remove the "extends User" from Master class and put all fields in Master
class directly, when I invoke the same operation it works fine without any issue.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


Mime
View raw message