Call Microsoft's WebService registration service without using the Vs.net integrated development environment

Source: Internet
Author: User
Tags wsdl
web| Microsoft recently opened a WebService registration service in Http://210.77.155.240/regBeta2/regservice.asmx, registering your vs.net Beta2 through it, Have a chance to get a one-legged skateboard on behalf of Microsoft.

It would be easy to write a WebService client call to this service through the Vs.net BETA2 integrated development environment, but the local machine configuration is too low for me to install vs.net, only one. NET Framework SDK Beta2 is installed. I had to try to use the SDK method to call. The specific implementation steps are as follows:

1. In order to invoke WebService on the Web, you must first generate a so-called "proxy class" locally, and in order to generate this proxy class, we need to create a. cs original file, which can be implemented using the SDK tools WSDL.exe. At the command prompt, type:

Wsdl/out:regwebservice.cs Http://210.77.155.240/regBeta2/regservice.asmx

Where RegWebService.cs is the file name of the. cs file that we want to generate.

2. With the original file, we can generate the proxy class component:

Csc/out:regwebservice.dll/t:library/r:system.xml.dll/r:system.web.services.dll RegWebService.cs

Generates the RegWebService.dll proxy class component library.

3. With the component library, we can write a client program that invokes WebService. You can view the RegWebService.cs and write the following code based on the information in the class:

Using System;

Class Regwebservicetest
{
static void Main ()
{
Regservice mregservice = new Regservice ();
Regtype Mregtype = new Regtype ();

Mregtype.scdkey = "Cdkey";
Mregtype.sname = "Name";
Mregtype.sphone = "Phone";
Mregtype.semail = "Mailto:email@email";
Mregtype.scompany = "Company";
mregtype.saddress = "Address";
Mregtype.scitizenid = "Citizenid";

BOOL isregsuccess = Mregservice.register (Mregtype);
Console.WriteLine (Isregsuccess.tostring ());
}
}

Save this piece of code as CallWebService.cs. Verify that the field information you entered is correct.

4. Now we can build the executable program:

Csc/r:regwebservice.dll CallWebService.cs

Generate CallWebService.exe.

5. Run CallWebService.exe, if returned to true, the registration is successful.


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.