国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發(fā) > 綜合 > 正文

Data Integrity in Web Services (轉(zhuǎn)二)

2024-07-21 02:25:02
字體:
供稿:網(wǎng)友
although you can create any client you desire for the web service, in this example i have chosen to create a windows application. to do so, simply go to file->new project and choose windows application. drag and drop the items on the form to look something like the figure below.


now choose project->add web referance and in the bottom left of this dialog box choose "web referances on loacal web server". choose the web service we created in step one, then click on ok.

below is the event handler code for the two buttons of the application. the rest of the code required for the application should be autogenerated by the form builder. also note you'll need to include the namespace of the web service in order to use the wrapper objects. it should look something like "using windowsapplication1.localhost;", but you can find out the exact namespace from the class view->localhost->personservice. look at the top of this code file and see what namespace vs.net gave this wrapper.


private void getterbutton_click(object sender, system.eventargs e)
{
    persondata pd = ps.getpersondata();
    firstnamefield.text = pd.firstname;
    lastnamefield.text = pd.lastname;
    yearsexperiencefield.text = ""+ pd.yearsexperience;
}

private void setterbutton_click(object sender, system.eventargs e)
{
    persondata pd = new persondata();
    pd.firstname = firstnamefield.text;
    pd.lastname = lastnamefield.text;
    pd.yearsexperience = int32.parse(yearsexperiencefield.text);
    try
    {
        ps.setpersondata(pd);
        messagebox.show("person set");
    }
    catch(exception exx) { messagebox.show("error setting data:"+ exx); }
}



to drive the point home as to what vs.net is doing with the web service, double click on the persondata struct in the classview of your application.


taking a look around inside the class viewer is an excellent way to find out exactly what kinds of wrappers vs.net is creating for differant things you might be doing and will generally give you an excellent idea of what to expect from your remote objects.


web services are one of the hottest technologies going right now but there are a number of pitfalls that any programmer must be aware of. data integrity is important for any object's proper functioning and must be assured or it could corroupt a larger program and generate a very difficult to trace error. by using the techniques in this article you can keep your objects safe and your data assured.

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 寿宁县| 化州市| 天气| 靖宇县| 慈溪市| 虹口区| 利津县| 秭归县| 崇信县| 精河县| 如东县| 永泰县| 江西省| 晋城| 黄骅市| 武威市| 长武县| 灵山县| 怀宁县| 万年县| 延庆县| 平潭县| 平安县| 霸州市| 鹿邑县| 子洲县| 天全县| 固原市| 襄汾县| 枣强县| 定远县| 鄂伦春自治旗| 建水县| 肇庆市| 清流县| 宾川县| 北海市| 呼和浩特市| 堆龙德庆县| 香河县| 志丹县|