Use C #. NET calls the WebService developed by Java, first encapsulate the object with the int attribute on the client. When the object is uploaded to the server, the server can obtain the string type attribute value, however, the int, double, and DateTime values cannot be obtained (all values obtained on the server are null). Solution: VS2005 encapsulates WebService references.
Use C #. NET calls the WebService developed by Java, first encapsulate the object with the int attribute on the client. When the object is uploaded to the server, the server can obtain the string type attribute value, however, values of the int, double, and DateTime types cannot be obtained (all values obtained on the server are null)
Solution:
When VS2005 encapsulates the WebService reference, if the WebService publishes an object consisting of basic data types, two attributes are generated for the non-string attribute of the object at the same time, this is generally the "Property **," Property ** Specified ". "Attribute name Specified" is a bool type. Only when this attribute is set to true will the value of "attribute ××" be serialized into xml for transmission.
In the same way, use. NET provides WebService for JAVA calls. If it is an object composed of basic data types, two attributes are generated for non-string attributes of the object at the same time, this is generally the "Property **," Property ** Specified ". If you do not set "attribute ××specified" to true, the data obtained by the server will be null. The solution is to set "attribute ** Specified" to true or delete "attribute ** Specified.
MATERIALS: http://msdn.microsoft.com/zh-cn/library/system.xml.xmlattribute.specified (VS.80). aspx
. NET Framework class library
XmlAttribute. Specified attributes
Gets a value indicating whether the property value is explicitly set.
Namespace: System. Xml
Assembly: System. Xml (in system. xml. dll)
Attribute Value
If a value is explicitly specified for this attribute in the original Instance document, the value is true; otherwise, the value is false. The value of false indicates that the attribute value comes from the DTD.
Remarks
The implementation is responsible for this attribute, not the user. If you change the value of this attribute (even if it is the same as the default/fixed value at the end), the Specified flag is automatically converted to true. To specify this attribute as the default/fixed value in the DTD, you must delete this attribute. Then, the implementation provides a new property with its Specified set to false and has a default/fixed value (if any ).
Abstract:
If the property has the allocation value in the document, Specified is true and the value is the allocation value.
If the property has no assigned value in the document and has the default/fixed value in the DTD, Specified is false, which is the default/fixed value in the DTD.
Otherwise, this attribute does not appear in the structure model of the document.