In C #. NET calls Java development WebService delivery int,double problem, Java cannot get the value!

Source: Internet
Author: User

Https://www.cnblogs.com/zhbsh/archive/2013/04/22/3035477.html

In C #. NET calls Java developed WebService, the object with the INT attribute is first encapsulated in the client, and when the object is uploaded to the server side, the server side can get the value of String Type property, but cannot get int type, Double and datetime values (null on the server) Workaround: VS2005 Package WebService Reference

In C #. NET calls Java developed WebService, the object with the INT attribute is first encapsulated in the client, and when the object is uploaded to the server side, the server side can get the value of String Type property, but cannot get int type, Values for double and datetime types (NULL is obtained on the server side)

Workaround:

When VS2005 encapsulates a webservice reference, if WebService publishes an object that consists of a basic data type, it generates two properties for the object's non-string property, typically such as "Property xx", "Property xxspecified". The property name specified is a bool type, and the value of "attribute xx" is serialized into XML when only this property is set to true.

Similarly, when using. NET to provide WebService to Java calls, if it is an object consisting of a basic data type, it will generate two properties for the object's non-string property, typically such as "attribute XX", "Property xxspecified". If you do not set property xxspecified to True, the data obtained by the server will be null. The solution is to set "attribute Xxspecified" to True or "attribute xxspecified" to remove.

Information: http://msdn.microsoft.com/zh-cn/library/system.xml.xmlattribute.specified (vs.80). aspx

. NET Framework Class Libraries

Xmlattribute.specified Property

Gets a value that indicates whether the property value is explicitly set.

Namespaces: System.Xml

Assembly: System.Xml (in System.Xml.dll)

Property value

True if a value is explicitly given to the property in the original instance document, otherwise false. A value of FALSE indicates that the value of the property is from the DTD.

Note

The attribute is implemented by the implementation rather than the user. If the user changes the value of the property (even if it finally has the same value as the default/fixed value), the Specified flag automatically turns true. To re-specify this property as the default/fixed value in the DTD, the user must delete the property. The implementation then provides a new property whose Specified is set to False and has a default/fixed value, if one exists.

Summary:

If the attribute has an assigned value in the document, Specified is true and the value is an assigned value.

If the property does not have an assigned value in the document and has a default/fixed value in the DTD, Specified is false, which is the default/fixed value in the DTD.

Otherwise, the attribute is not present in the document's structure model

In C #. NET calls Java development WebService delivery int,double problem, Java cannot get the value!

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.