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: http://issues.apache.org/jira/browse/AXIS2-1079
Project: Apache Axis 2.0 (Axis2)
Issue Type: Bug
Affects Versions: 0.92
Environment: Windows XP, java - 1.4.2_11
Reporter: Marius Hugo
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.
-
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]