. NET call Java WebService Save a workaround for null datetime type data

Source: Internet
Author: User

Problem Description:
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)

Cause of the problem:
vs encapsulates WebService reference, if WebService publishes an object consisting of a base data type, it generates two properties for the object's non-string property, typically such as "attribute 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

Workaround:
1. First ensure that the date field of the bean in the webservice must be of type java.util.date, not the java.sql.date type,
2. In. NET, after the proxy class is generated, for the date type property, in addition to setting the value of the "Property xx", also set the value of "property xxspecified" to true.

. NET call Java WebService Save a workaround for null datetime type data

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.