Data Access Worldwide Knowledge Base
Article ID 2254 Article Title INFO: Number type struct members get converted to type Decimal by Clent Web Service Class generator Article URL http://www.dataaccess.com/kbasepublic/KBPrint.asp?ArticleID=2254 KBase Category VDF11 Date Created 10/25/2006 Last Edit Date 11/14/2006
Article Text
QUESTION:
I developed a web service object and one of my functions returns a struct. The struct contains members of multiple data types and one of them is of the DataFlex number type. When I create a cClientWebService class based on the WSDL of my webservice I see the struct uses Decimals instead of Numbers. Why?
Source Struct:
Struct tCust
String sName
Number nProfit
End_Struct
Destination Struct:
Struct tWSCust
String sName
Decimal nProfit
End_Struct
ANSWER:
The conversion is expected. This is due to the mapping of Visual DataFlex data types onto the XML Schema types. The VDF Number and Decimal types are both mapped to the same XML Schema type xs:decimal. So the VDF Number type is mapped to xs:decimal. The range of xs:decimal exceeds the range of Number, so therefore any occurrence of xs:decimal must be mapped back to the VDF Decimal type.
But because Decimal has a higher range than Number, all Number values should fit within Decimal.
Number = 14.8
Decimal = 16.16
Contributed By:
Sonny Falk
Company: Data Access Worldwide
Web Site: http://www.dataaccess.com
Email this Article
Email this Article to a Colleague
Send Feedback on this Article to Data Access Worldwide
Copyright ©2010 Data Access Corporation. All rights reserved.
The information provided in the Data Access Technical Knowledge Base is provided "as is" without warranty of any kind. Data Access Corporation disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Data Access Corporation or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Data Access Corporation or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.