最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Data Integrity in Web Services (转一)-Web_Service开发-
时间:2022-07-02 11:17:15 编辑:袖梨 来源:一聚教程网
Abstract
Web Services bring with them great possibilities and with these possibilities are some pitfalls. One such pitfall is passing complex data types to and from Web Services without losing data integrity. The clearest thing to keep in mind when passing objects to Web Services is the data is passed for your object's fields, but the code is not.
What happens when I have an object that my web service passes as a return value?
WSDL does some magic when a programmer creates a referance to your web service. Visual Studio.NET creates wrapper objects around foreign data types.
The struct you create inside your Web Service looks like this:
public struct PersonData
{
private int yearsExperience;
public int YearsExperience
{
get { return yearsExperience; }
set
{
if(value<2) { throw new Exception("You're unemployable!"); }
yearsExperience = value;
}
}
public String FirstName;
public String LastName;
}
...Which then gets translated into WSDL which looks like this:
Web Services bring with them great possibilities and with these possibilities are some pitfalls. One such pitfall is passing complex data types to and from Web Services without losing data integrity. The clearest thing to keep in mind when passing objects to Web Services is the data is passed for your object's fields, but the code is not.
What happens when I have an object that my web service passes as a return value?
WSDL does some magic when a programmer creates a referance to your web service. Visual Studio.NET creates wrapper objects around foreign data types.
The struct you create inside your Web Service looks like this:
public struct PersonData
{
private int yearsExperience;
public int YearsExperience
{
get { return yearsExperience; }
set
{
if(value<2) { throw new Exception("You're unemployable!"); }
yearsExperience = value;
}
}
public String FirstName;
public String LastName;
}
...Which then gets translated into WSDL which looks like this:
相关文章
- 《潜行者2:切尔诺贝利之心》使用手电筒方法介绍 11-21
- 《潜行者2:切尔诺贝利之心》回声探测器使用攻略分享 11-21
- 《潜行者2:切尔诺贝利之心》人工制品奖励获得方法介绍 11-21
- 《潜行者2:切尔诺贝利之心》奇美拉嵌合体打法技巧分享 11-21
- 《潜行者2:切尔诺贝利之心》风衣怪打法技巧分享 11-21
- 《潜行者2:切尔诺贝利之心》变异狗打法技巧分享 11-21