Win service and Web Service Usage notes

Source: Internet
Author: User
Win Service

    1. Create win Service
    2. Write in onstart and onstopCode
    3. Right-click the win service Form Designer and choose "add installation"
    4. Set the service name and other attributes in the installation file.
    5. Generate the win service EXE file.
    6. Find the installutil.exe file in c: \ windows \ Microsoft. NET \ framework \ v2.0.50727.
    7. Put the installutil.exe and win service EXE files in the same directory
    8. Write and install the batch processing file and uninstall the batch processing:

Installation batch processing:

Installutil.exe winservice.exe

Unmount batch processing:Installutil.exe/u winservice.exe

Web Services

This section describes how to use web services.

1. Use the disco tool to find the Web service address:

Disco/out: mydir http://www.proseware.com

If it cannot be found, it will not be discounted. Generally, any Wen service provided by a website will be published to the customer.
Suppose you have now got the Web service address: http://www.HostName/WebServiceName.asmx

2. Generate the WSDL document:
ADD? Access the WSDL.
Http://www.HostName/WebServiceName.asmx? WSDL;
In IE, select "Save As XML" and change the name suffix to "WSDL. Obtain the webservicename. WSDL document.

3. Generate the Web Service proxy class:
Wsdl.exe tool:

WSDL/L: CS/O: F: \ webservicename. WSDL

The parameter/L represents the language, CS is C #,/o represents the output path, and the last parameter is the WSDL file generated in step 2.
If you ignore step 2, you can directly write the Web Service URL in the third parameter of WSDL. That is:

WSDL/L: Vb/O: C: \ myproxyclass. VB http://www.HostName/WebServiceName.asmx? WSDL

4. The proxy class has been generated. If it is webservicename. CS, you can directly add this CS file to the project.
The usage is as follows:

Webservicename webser = New Webservicename ();
Webser. url = Http://www.HostName/WebServiceName.asmx" ;
Webser. Method ();

 

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.