[ http://issues.apache.org/jira/browse/AXISCPP-862?page=all ]

nadir amra closed AXISCPP-862.
------------------------------

    Fix Version/s:  1.6 Beta
       Resolution: Fixed

Basically the wsdl2ws tool was not handling the generation of nested anonymous 
types correctly.  The code that attempted to externalize anonymous types was 
flawed.

The code has 3 routines that attempts to find types that need to be 
externalized.  First routine, exposeReferenceTypes(), attempts to expose 
referenced types for non-anonymous types. The second routine, 
exposeMessagePartsThatAreAnonymousTypes(), attempts to go through the web 
service methods, looking for types in the parameter list and externalizing 
those types.  The third routine, exposeNestedTypesThatAreAnonymousTypes(), 
attempted to expose nested types for non-anonymous types, only selecting nested 
anonymous types (e.g. >>Arguments>Argument) as a candidate for externalization.

There was a bug in exposeMessagePartsThatAreAnonymousTypes() in that it did not 
catch all parameter types, specifically one a type is nested withing another 
type.

For exposeNestedTypesThatAreAnonymousTypes(), it just did not catch all the 
types that needed to be externalized.  I rewrote the routine.  Just to confirm 
my logic with the developers-at-large...

I changed the Type class so that it keeps track of related Type objects.  
"Related" means those Type objects that are created after a Type object has 
been created and added to the TypeMap hash table (for example, once a Type has 
been added to the hash table ,we then go and process the attributes and 
elements associated with the created Type object).  Then, when 
exposeNestedTypesThatAreAnonymousTypes() is called, it goes through the TypeMap 
hash table, looking for entries that have been externalized.  The code then 
goes through the related types vector and externalizes those types if they have 
not been already externalized.  Recursion is used to externalize the related 
type's related vector. 

Tests all work.  

> '>' symbol in front of type and some output parameters is not being removed 
> by WSDL2Ws from type, prototypes/signatures or class defintion and the header 
> filename as an unnecessary '_' prefix character.
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: AXISCPP-862
>                 URL: http://issues.apache.org/jira/browse/AXISCPP-862
>             Project: Axis-C++
>          Issue Type: Bug
>          Components: WSDL processing - Doc
>         Environment: n/a
>            Reporter: Fred Preston
>         Assigned To: nadir amra
>             Fix For:  1.6 Beta
>
>
> The created client stub for the following WSDL is incorrect
> <?xml version="1.0" encoding="UTF-8"?>
> <definitions xmlns="http://schemas.xmlsoap.org/wsdl/";
>             xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
>                  xmlns:xs="http://www.w3.org/2001/XMLSchema";
>                xmlns:tns="http://webservices.com/CommerceService";
> targetNamespace="http://webservices.com/CommerceService";>
>   <types>
>     <xs:schema targetNamespace="http://webservices.com/CommerceService"; 
>                                             
> xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
>                                           
> xmlns:tns="http://webservices.com/CommerceService";
>                       elementFormDefault="qualified">
>       <xs:element name="ItemSearch">
>         <xs:complexType>
>           <xs:sequence>
>             <xs:element name="SubscriptionId" type="xs:string" minOccurs="0"/>
>             <xs:element name="AssociateTag" type="xs:string" minOccurs="0"/>
>             <xs:element name="XMLEscaping" type="xs:string" minOccurs="0"/>
>             <xs:element name="Validate" type="xs:string" minOccurs="0"/>
>             <xs:element name="Shared" type="tns:ItemSearchRequest" 
> minOccurs="0"/>
>             <xs:element name="Request" type="tns:ItemSearchRequest" 
> minOccurs="0" maxOccurs="unbounded"/>
>           </xs:sequence>
>         </xs:complexType>
>       </xs:element>
>         
>       <xs:complexType name="ItemSearchRequest">
>         <xs:sequence>
>           <xs:element name="Keywords" type="xs:string" minOccurs="0"/>
>           <xs:element name="SearchIndex" type="xs:string" minOccurs="0"/>
>         </xs:sequence>
>       </xs:complexType>
>         
>       <xs:element name="ItemSearchResponse">
>         <xs:complexType>
>           <xs:sequence>
>             <xs:element ref="tns:OperationRequest" minOccurs="0"/>
>             <xs:element ref="tns:Items" minOccurs="0" maxOccurs="unbounded"/>
>           </xs:sequence>
>         </xs:complexType>
>       </xs:element>
>         
>       <xs:element name="OperationRequest">
>         <xs:complexType>
>          <xs:sequence>
>             <xs:element ref="tns:HTTPHeaders" minOccurs="0"/>
>             <xs:element name="RequestId" type="xs:string" minOccurs="0"/>
>             <xs:element ref="tns:Arguments" minOccurs="0"/>
>             <xs:element ref="tns:Errors" minOccurs="0"/>
>             <xs:element name="RequestProcessingTime" type="xs:float" 
> minOccurs="0" maxOccurs="1"/>
>           </xs:sequence>
>         </xs:complexType>
>       </xs:element>
>         
>       <xs:element name="Request">
>         <xs:complexType>
>           <xs:sequence>
>             <xs:element name="IsValid" type="xs:string" minOccurs="0"/>
>             <xs:element name="ItemSearchRequest" type="tns:ItemSearchRequest" 
> minOccurs="0"/>
>             <xs:element ref="tns:Errors" minOccurs="0"/>
>           </xs:sequence>
>         </xs:complexType>
>       </xs:element>
>         
>       <xs:element name="Arguments">
>         <xs:complexType>
>           <xs:sequence>
>             <xs:element name="Argument" maxOccurs="unbounded">
>             <xs:complexType>
>               <xs:attribute name="Name" type="xs:string" use="required"/>
>               <xs:attribute name="Value" type="xs:string" use="required"/>
>             </xs:complexType>
>           </xs:element>
>         </xs:sequence>
>       </xs:complexType>
>     </xs:element>
>         
>     <xs:element name="HTTPHeaders">
>       <xs:complexType>
>         <xs:sequence>
>           <xs:element name="Header" minOccurs="0" maxOccurs="unbounded">
>             <xs:complexType>
>               <xs:attribute name="Name" type="xs:string" use="required"/>
>               <xs:attribute name="Value" type="xs:string" use="required"/>
>             </xs:complexType>
>           </xs:element>
>         </xs:sequence>
>       </xs:complexType>
>     </xs:element>
>         
>     <xs:element name="Items">
>       <xs:complexType>
>         <xs:sequence>
>           <xs:element ref="tns:Request" minOccurs="0"/>
>           <xs:element ref="tns:CorrectedQuery" minOccurs="0"/>
>           <xs:element name="TotalResults" type="xs:nonNegativeInteger" 
> minOccurs="0"/>
>           <xs:element name="TotalPages" type="xs:nonNegativeInteger" 
> minOccurs="0"/>
>           <xs:element ref="tns:Item" minOccurs="0" maxOccurs="unbounded"/>
>         </xs:sequence>
>       </xs:complexType>
>     </xs:element>
>         
>     <xs:element name="CorrectedQuery">
>       <xs:complexType>
>         <xs:sequence>
>           <xs:element name="Keywords" type="xs:string" minOccurs="0"/>
>           <xs:element name="Message" type="xs:string" minOccurs="0"/>
>         </xs:sequence>
>       </xs:complexType>
>     </xs:element>
>         
>     <xs:element name="Item">
>       <xs:complexType>
>         <xs:sequence>
>           <xs:element name="ASIN" type="xs:string"/>
>           <xs:element ref="tns:Errors" minOccurs="0"/>
>           <xs:element name="DetailPageURL" type="xs:string" minOccurs="0"/>
>           <xs:element ref="tns:ItemAttributes" minOccurs="0"/>
>         </xs:sequence>
>       </xs:complexType>
>     </xs:element>
>         
>     <xs:element name="ItemAttributes">
>       <xs:complexType>
>         <xs:sequence>
>           <xs:element name="Author" type="xs:string" minOccurs="0" 
> maxOccurs="unbounded"/>
>           <xs:element name="ProductGroup" type="xs:string" minOccurs="0"/>
>           <xs:element name="Title" type="xs:string" minOccurs="0"/>
>         </xs:sequence>
>       </xs:complexType>
>     </xs:element>
>   </xs:schema>
> </types>
>     
>   <message name="ItemSearchRequestMsg">
>     <part name="body" element="tns:ItemSearch"/>
>   </message>
>     
>   <message name="ItemSearchResponseMsg">
>     <part name="body" element="tns:ItemSearchResponse"/>
>   </message>
>     
>   <portType name="CommerceServicePortType">
>     <operation name="ItemSearch">
>       <input message="tns:ItemSearchRequestMsg"/>
>      <output message="tns:ItemSearchResponseMsg"/>
>     </operation>
>   </portType>
>     
>   <binding name="CommerceServiceBinding" type="tns:CommerceServicePortType">
>     <soap:binding style="document" 
> transport="http://schemas.xmlsoap.org/soap/http"/>
>       <operation name="ItemSearch">
>         <soap:operation soapAction="http://soap.com"/>
>         <input>
>           <soap:body use="literal"/>
>         </input>
>         <output>
>           <soap:body use="literal"/>
>         </output>
>       </operation>
>     </binding>
>     
>   <service name="CommerceService">
>     <port name="CommerceServicePort" binding="tns:CommerceServiceBinding">
>       <soap:address 
> location="http://soap.com/onca/soap?Service=CommerceService"/>
>     </port>
>   </service>
> </definitions>
> Produces the following header files:-
> --------------------------------------------------
> _Items_Array.hpp
> ==============
> /*
>  * Copyright 2003-2004 The Apache Software Foundation.
>  */
> #if !defined(___ITEMS_ARRAY_ARRAY_H__INCLUDED_)
> #define ___ITEMS_ARRAY_ARRAY_H__INCLUDED_
> class >Items;
> typedef struct _Items_ArrayTag
> {
>       >Items* m_Array;
>       int m_Size;
> } _Items_Array;
> #endif /* !defined(___ITEMS_ARRAY_ARRAY_H__INCLUDED_)*/
> CommerceServicePortType.hpp
> =========================
> STORAGE_CLASS_INFO void ItemSearch(xsd__string Value0, xsd__string Value1, 
> xsd__string Value2, xsd__string Value3, ItemSearchRequest* Value4, 
> ItemSearchRequest_Array Value5, AXIS_OUT_PARAM >OperationRequest* *OutValue0, 
> AXIS_OUT_PARAM _Items_Array *OutValue1);
> CommerceServicePortType.cpp
> =========================
> void AWSECommerceServicePortType::ItemSearch(xsd__string Value0, xsd__string 
> Value1, xsd__string Value2, xsd__string Value3, ItemSearchRequest* Value4, 
> ItemSearchRequest_Array Value5, AXIS_OUT_PARAM  OperationRequest** OutValue0, 
> AXIS_OUT_PARAM  _Items_Array* OutValue1)
> {
> :
> *OutValue0 = (>OperationRequest*)m_pCall->getCmplxObject((void*) 
> Axis_DeSerialize_>OperationRequest, (void*) Axis_Create_>OperationRequest, 
> (void*) Axis_Delete_>OperationRequest,"OperationRequest", 0);
> There are five or more problems with the generated files:-
> 1. The type 'Items' is prefixed with a '>' character.
> 2. The class name should not be prefixed with a '>' character (see 
> _Items_Array.hpp).
> 3. The filename should not be prefixed with a '_' character.
> 4. Some of the output parameters are prefixed with a '>' character (see 
> CommerceServicePortType.hpp and CommerceServicePortType.cpp).
> 5. Also, in CommerceServicePortType.cpp, the name of the 
> serialiser/deserialiser also has an embedded '>' character.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to