WEB Service Development Guide

Source: Internet
Author: User
Tags interface reference wsdl
web| Development Guide Development Description:
1. Create a Web Service and compile:
Development methods, like the development of ordinary dynamic libraries, are just the attributes of a method that describes the behavior, such as: [WebMethod (description= "Insert Data")]
public string InsertData (string strName) {
...... function function
}
2. Test by IE:
Directly in IE through the URL call can be, such as Http://localhost/DBOperWS/DBOper.asmx
If correct, the following interface is displayed, listing the interface provided by the Web service, and the description, and clicking the appropriate function, you can test the function
·
3. Create a customer for a Web service and save the WSDL file:
Build a Web service customer, let it get the services you provide, save the WSDL file to display intelligent help at development time, enter the. NET DOS interface, and type the command statement:
Syntax: disco/o: WSDL file holds the URL of the path service, as
DISCO/O: D:\DBOper.wsdl//localhost/webservice1/service1.asmx? Wsdl
4. Generate proxy class CS files
Also executes in DOS as
Wsdl/out:d:\mywebservice1.cs Http://localhost/WebService1/Service1.asmx
The statement complete
5. Compile proxy class, build DLL dynamic library
Execute a statement like the following to complete
Csc/out:d:\mywebservice1.dll/t:library/r:system.xml.dll/r:system.web.services.dll MyWebService1.cs
6. Service Release:
Put the services generated above Dll,wsdl,discomap three files in one of the virtual directories you want to reference.
7. Example: see Example Engineering DBOPERWS
Instructions for use:
Vs. NET Invoke Service
1. Add Reference:
Add a Web reference, find the service to be referenced on the network, and given a name, such as "Mydbservice", the service automatically has the namespace of the local class, such as Testwebservice.mydbservice
TestWebService is our test engineering namespace.
2. Call:
Calls in your code do not differ from ordinary DLL calls, as if you were using a local class. Such as:
Mydbservice.dboper m_dbo = new TestWebService.MyDBService.DBOper ();
Result.text = m_dbo. GetName (this. Textbox1.text,this. TextBox2.Text);
3. Example: see Example Engineering TestWebService
Http://www.manbu.net/Lib/Class9/Sub14/2/3.asp


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.