Java does not have the built-in DataSet class of DotNet and cannot be parsed. Although some DataSet classes similar to Java on the internet can solve this problem, it is best to use the standard method.
Solution:
The WebService function returns an xml string, and the xml string generated by DataSet is declared using the anonymous schema type.
Therefore, you must use a simple data type or an array of simple data types.
There are three solutions to minimize changes to the original code.
1. The server returns a string and the content is an xml string. You can use the DataSet. GetXml () method.
The number of server changes is small.
The corresponding client needs to read the xml string by itself.
2. The returned result is an array of classes containing simple data types. However, the server must map all fields in the DataSet to an array.
The client can easily read data.
The number of changes made by the server is slightly larger. If there are many fields, it will be troublesome.
3. When the server returns a large amount of data DataSet, the compression technology can be used to return the Byt [] binary array and compress the data for transmission.
Summary:
When the WebService transmits data, the parameter type is preferably a simple data type or an xml string.
This avoids compatibility issues (cross-language) between systems ).