C # Remote Call Technology WebService Practice Manual

Source: Internet
Author: User
Tags soapui wsdl

I. Introduction of the Course

A great lecturer once said a word: the existence of things is reasonable! It means that anything that exists has its reasons, that everything that exists can find its reason for existence, and that we should focus on the nature of causal correlation. So before this sharing session, we have to "Yexiaoyu" not to talk about the following several "serious" and "sensitive" topics: WebService is outdated, learn what it does!  Why use WebService instead of using the current popular restful ASP. NET WebAPI? The answer to the above question is simple: because it is it, not the same fireworks webservice!

In this sharing session, you will learn about the following dry knowledge:

1), WebService technical call schematic diagram.

2), C # WebService commonly used several methods of invocation.

3), C # WebService debugging tips and develop the necessary tools to share.

4), the actual combat drills how to make webservice calls in an elegant way. Excellent not elegant, you see it, we as far as possible write less does more! (highly recommended)

In this slot a hard ad: Next sharing course a stupid plan will bring you the "C # Remote Call technology WebService Sunflower Treasure Book", the course will share the focus of "C # WebService two different reference usage", "WebService how to use asynchronous call" and "About C # WebService how to make the client call in a safe way, several commonly used solutions," and so on. A stupid try to bring you some dry share!

If you are interested in this sharing lesson, then please study with AH-stupid. Needless to say, directly on dry goods, we do not produce dry goods, we are just dry goods porter.


Hi everyone, my name is webservice!. Ii. explanation of the meaning of concept name

2.1. What is the remote call technology (RPC technology)?

One system remotely invokes the service of another system to obtain business data for the remote system.

2.2, why use RPC technology?

Based on security considerations, the general enterprise will not open its own database, only using remote call technology.

2.3. What is SOAP?

SOAP: Simple Object access Protocol protocol. Soap was originally a solution for RPC; SOAP is the specification of calling methods in the form of XML documents.

2.4. What is WebService?

WebService is a remote invocation technique for SOAP protocols that are transmitted using HTTP.

2.5. What communication protocol is used by webservice?

The basic communication protocol used by WebService is soap, which is the exchange of information in a decentralized or distributed environment, and its XML-based protocol enables different projects, locations, and even offsite calls to applications through the SOAP protocol.

2.6, why say WebService is cross-platform?

In fact, the main goal of WebService is cross-platform interoperability. To achieve this goal, WebService is based entirely on platform-independent, software-vendor-specific standards, such as XML (Extensible Markup Language), XSD (XmlSchema), and is a new platform for creating interoperable, distributed applications.

2.7, WebService realization contains those three elements?

WSDL function: WebService the service side of the user manual. (Web Service Description Language)

Soap role: Canonical XML tags.

UDDI: Provides search and registration capabilities on the WebService server.

2.8. What are the advantages of webservice?

1), operable distributed applications.

Communication between different applications and applications developed on different system platforms can be implemented.

2), universality, using HTTP and XML for communication.

Any device that supports HTTP and XML technology can own and access the Web service, and different development languages of different platforms can still invoke our published Web service.

3), Web Service can even cross firewalls, real free communication.

The Web server that is typically accessed and the client to which the Web service is to be accessed is likely to be behind the firewall, and the HTTP port is developed by default for other ports, and Web service is HTTP-based, so it can traverse firewalls.

4), interoperability between heterogeneous platforms.

The biggest advantage of Web Service is that it provides a seamless approach to the technology of heterogeneous platform. As different users use different hardware platforms, different platforms, different operating systems, different software, and different protocol communications, this creates the need for mutual communication. Web Service enables any two applications to communicate with each other as long as they can read and write XML. Remote calls are implemented through the SOAP protocol.

Summary:

A little bit of language interpretation is in the current C #, JAVA, PHP and other languages can use the standard WebService technology to achieve communication between different languages of the application, that is, call each other.

Third, webservice technical call schematic diagram
WebService working principle diagram one


WebService working principle Diagram II

3.1, WebService is how to implement remote call? The role of three elements in webservice?

(1) WebService principle: WebService is a remote invocation technique for data that uses the SOAP protocol transmitted by HTTP.

(2) WSDL function: WebService the service end of the user manual. (Web Service Description Language)

(3) SOAP role: Canonical XML tags.

(4) UDDI: Provides search and registration functions on the WebService server.

3.2, WebService key principle explanation:

Service provider: The publisher needs to deploy the WebService service application.

Caller: The client needs to refer to the user manual (WSDL) of the WebService server for invocation.

Four, C # WebService commonly used several methods of invocation

4.1. C # Dynamically calls WebService through dynamic.

In fact, as with the manual creation of the Add Reference step, just here to manually become automatic, dynamically generated proxy classes, using reflection to dynamically invoke the method. For details, please refer to: [C # dynamic call Webservice.pdf] document through the dynamics.

4.2. C # calls WebService by simulating the HTTP request protocol get and Post methods. (Used according to individual project conditions)

For more information, see: [C # invokes the Webservice.pdf] document by simulating HTTP request protocol get, post.

4.3. Call by manually generating the client WSDL proxy class. (Used according to individual project conditions)

Use the Wsdl.exe tool provided by Microsoft to generate the WSDL local proxy class.

4. Call through the SOAP Protocol Manual reference method. (Microsoft highly recommended)

Five, C # WebService debugging tips and development of the necessary tools to share

5.1. C # How to debug the WebService service and debug the Remote Web service.

For more information, see [C # WebService how to debug remotely. pdf]

5.2, WebService Debugging tool

1.. NET WebService Studio provided by Microsoft

: http://webservicestudio.codeplex.com/

2. Storm (recommended)

: http://storm.codeplex.com/, incidentally, the tool also has a "brothers" called WCF Storm Oh.

3, SOAPUI (highly recommended)

: https://www.soapui.org/downloads/latest-release.html

Vi. How to make webservice calls in an elegant way

Unified Portal Gets the WebService service instance of the specified T type


client callers will be accessed using a unified portal

C # Remote Call Technology WebService Practice Manual

Related Article

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.