You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org> on 2007/10/18 09:12:51 UTC

[jira] Resolved: (AXIS2-1079) WSDL2Java issue: Problem creating methods to access type in generated document, restrictions placed on simpleType is not enforced in code, simpleType declared as long, but accessed as int in document

     [ https://issues.apache.org/jira/browse/AXIS2-1079?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Amila Chinthaka Suriarachchi resolved AXIS2-1079.
-------------------------------------------------

    Resolution: Won't Fix

the problems you have mentioned are problems with the xmlbeans generated code. So please have a look at by generating code directly with the scomp command.

> WSDL2Java issue: Problem creating methods to access type in generated document, restrictions placed on simpleType is not enforced in code, simpleType declared as long, but accessed as int in document
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-1079
>                 URL: https://issues.apache.org/jira/browse/AXIS2-1079
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: databinding
>    Affects Versions: 0.92
>         Environment: Windows XP, java - 1.4.2_11
>            Reporter: Marius Hugo
>            Assignee: Amila Chinthaka Suriarachchi
>         Attachments: MerchantCatalogRequest.xsd, TradeRootMerchantTypes.xsd, TradeRootPayment.wsdl
>
>
> When I try and generate the code using WSDL2java, I get an extra set of methods in the generated documents.  These are the methods that are there to access fields stored in the request.
>  
> As an example, I declared a simpleType, SessionId, of type long with minInclusive and maxInclusive restrictions.  It generates the code for the SessionId type and that type is used in the requests and responses.  
> Also, I do not see these restrictions imposed in the code.  As another example: I restrict the length that a string can take on, but there is no such restriction in the code. Enumeration seems to work fine for strings though and the code is present for those kinds of restrictions.  
> WSDL2Java generates, as an example, a set of methods for a document as follows:
>         - int getSessionId();
>         - com.company.product.webservice.types.SessionId xgetSessionId();
> There are 2 pairs (one preceded with an "x") in the generated document for any form of simpleTypes.  Another issue to note, is that SessionId is declared as type long, but it can be accessed as an int. The first method, should not be there in my opinion.  I have no idea which one to use and which value would be put in the SOAP message.  If, for instance, I were to put different values in both??? 
> In summary:
>  - Generates two sets of methods for each simpleType that has been declared to be used in a request/response.- 
>  - Changed the type for SessionId from long to int in one of the methods.
>  - Restrictions are only enforced in the code for restrictions of type enumaration, although I'm not too sure on the standard
>    protocol or use for restrictions, as I am new to xml and axis.
> I have attached 3 files to provide all the necessary information. I used the following command to execute the WSDL2Java
> ./WSDL2Java.sh -uri c:/test_folder/wsdl/TradeRootPayment.wsdl -ss -sd -g -o c:/test_folder/final_test -p com.traderoot.merchant.webservice -ns2p urn:traderoot:names:tc:merchant:1.0:payment=com.traderoot.merchant.webservice,urn:traderoot:names:tc:merchant:1.0:core=com.traderoot.merchant.webservice.types -ssi -u -d xmlbeans

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org