Web Service and C # basic learning notes

Source: Internet
Author: User

VC # coding is divided into two parts: one is from program code to Il (intermediate language)
The second is from the intermediate language to the machine language (JIT compiler)
Compile Parameters
CSC. EXE spoofs VC # program code into il files
@ Specify the response File
/Debug sends debugging information
/Debug + creates a PDB file to write debugging information to the file.
/Debug-do not create PDB files, default options
/DOC comments the processed document as an XML file
/Out batch output file
/Reference: Import metadata from files that contain collections
/Target specifies the output file format
/Target: EXE creates a console application that can execute (.exe)
/Target: libarary create a code library DLL
/Target: Create a Windows program (.exe) by winexe)
/Target: modeule to create a module (DLL)
Value Type
C # There are two types of language data: Value Type and reference type.
Value types are classified into three types: simple type, structure type, and enumeration type.
Simple types include Boolean (true and false), data types include INTEGER (sbyte, byte, short, ushort, Int, uint, long, ulong, char), floating point (float, double), decimal is mainly used in financial currencies and other computer environments with high precision requirements.
Structure Type Keyword: struct
Enumeration type Keyword: Enum
Reference data type:
C # provides the following reference types:
Open object class
Class type
Interface
Representative yuan
String type
Array
 
String type: the string class is directly derived from the object and the objective existence is sealed.
Define the number to the new type [,]
Packing and unpacking
In the C # type system, any value type \ reference type and object type can be converted (bound to a connection ), in this way, we can regard any type as the object type.
Packing: it means that any value type is implicitly converted to an object type. The reverse is that the object is converted to the corresponding data type.

Variables and constants
In C #, the variable name is different from C ++. You can add the prefix "@" before the variable name. In this case, you can use the prefix "@", the keyword is used as the name of the variable. This is mainly used for interaction with other languages, but "@" is not recommended when C # is used for programming separately "@", as part of the variable name.

A constant is a fixed amount. From the data type perspective, the constant type can be any value type or reference type.

Process Control
Different from C/C ++, the expression after if can be a bool expression.
If there is no break. C # In swithch, an error is returned.
In the loop, the foreach is introduced in C #.
Conditional compilation
C # There are two methods for encoding: preprocessing usage and condition attributes.
 
Chapter 2 object-oriented C #
Class and Object
Constructor and destructor
Method
Domain and attribute
Representative
Inheritance

Class: C # is a type of data structure that includes data members, function members, and other types. Data members can be constants or fields. Function members can be methods, attributes, indexers, events, operators, instance builders, static builders, and destructor.
Modifier
Public can be accessed as needed. Access to this class is not restricted.
Protected can only be accessed by the class and its derived subclass.
Internal can only be accessed by its class
Protected internal is the only combination restriction modifier that can be accessed only by its class and its derived subclass.
Private can only be accessed by applications or libraries contained in. net.
Abstract is used to modify the abstract class, indicating that the class is only difficult to be used as its class for inheritance, rather than Object Instantiation. Abstract classes can contain abstract members but are not mandatory. Abstract cannot be used together with new.
Object Class instantiation
This keyword
This is used to reference variables only in the instance method. This keyword references members of the current object instance. This can be omitted in the instance method body.
The constructor is used to initialize an instance of the execution class. Each class has a constructor. Before the methods, attributes, or any other things of the struct class, and a statement executed contains constructor of the corresponding class, you do not even need to write a constructor yourself, A default constructor is provided.
Destructor: when the class instance is out of the range, it is often expected to call back the storage space it occupies.
Method
Modifiers and keywords include:
New public protected internal Private Static Virtual sealed override adbstract extern
63
Method Parameters
Pass value: if you do not need a modifier
Address: The address passing parameter requires the modifier ref
Output parameters: the output parameters must be modifier out.
Array parameters: the array parameters must be modifier Params.
Note that the rewrite (new) method is different from the override method. In essence, the rewrite method is bound at compile time, and the override method is bound at runtime. The UV method cannot be a static method. In other words, the static and virual methods cannot be used to modify a single-person method, which is determined by its runtime type analysis. Override must be used together with virtual. Of course, it cannot be used together with static.
External Method
C # introduce the extern modifier to represent external methods, methods implemented in languages other than external methods, such as Win32 API functions
 
Domain and attribute
Static domain and non-static domain, where the declaration of static domain is static and other domain are non-static domain. If a class is declared as a static domain, when the first instance of this class is created, the domain is initialized, and the class will not be initialized later.
Read-Only domain. C # introduces the readonly modifier to represent the read-only domain. It can be modified only in the definition of the domain and the constructor of its class.
Inheritance
83
C # Advanced Programming
The namespace Declaration makes it the namespace subject after the keyword namespace, and then a semicolon can be followed.

Handle errors and exceptions
Exception Handling
The Code contained in the try block is the normal operation part of the program, but some serious errors may occur.
The Code contained in the Catch Block handles various errors
Finally contains code to clear resources or execute other operations to be performed at the end of the try Block
 
Chapter 2 WebService Basics
Web Service Architecture: Web Service is a self-contained modular gossip program, which can be described, published, checked, and called in the network.
Advantages of Web Service
Enhanced interoperability
Real-Time Integration
Reduce complexity by encapsulating
Brings new life to legacy systems
Web Serivce System
Bu Shu
Release
Return
Web Service has the following three components:
Service Provider
Service Proxy
Service Requestor
108
Web Service has the following three operations:
Publish or not
Found
Bind

Web Service Architecture Description
The so-called Web Service is composed of Enterprises
Web service platform components
The most basic web service platform is XML and HTTP
The comprehensive web service platform is XML + HTTP + soap + WSDL + UDDI. At a higher level, it is possible to add some unwidely accepted technologies such as XAML, XLANG, XKMS, and XFS.
Soap is a Simple Object Access Protocol) defines the unified Universal Description discovery and integration when passing XML-ed data. It provides a framework for describing and discovering commercial services on the web.

Basic Steps for using UDDI
When writing a program that calls a remote web service, the programmer uses the UDDI commercial registration center to locate the businessEntity information, which is registered by the enterprise that provides the web service.
Programmers can further obtain more detailed businessService information or obtain a complete businesstity structure. Because the businessEntity structure contains all information about the deployed Web Service, the programmer simply needs to select a bindingTemplate and save it for future use.
Tmode based on Web Service in bindingTemplate
L provides information related to the call specification. The programmer can compile the program according to the call specification of the web service.
At runtime, the program can use the information serervice of the saved bindingTemplate as needed
112
WSDL: Web Service Definition Language
WSDL is an XML language used to describe network services or terminals. It is used to define web services and how to call them. The WSDL document can be used to dynamically search for deployed Web Services and bind Web Services
WSDL provides the service provider with a method to describe the basic format of Web Service requests over different protocols or encoding methods. WSDL is used to describe what a web service can do, where it is located, and how to call it.

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.