Data Integrity in Web Services 2)-Web_Service development-

Source: Internet
Author: User

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 shoshould 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 shoshould 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. 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;

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.