Use C #. NET to call the WebService developed by Java to pass int and double. The value cannot be obtained in java!

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.