C# Class Thinktecture.Tools.Web.Services.ServiceDescription.ServiceDescriptionEngine

Provides static methods for WSDL generation.
This class could not be inherited.
Datei anzeigen Open project: WSCF/WSCF

Public Methods

Method Description
GenerateWsdl ( InterfaceContract serviceInterfaceContract, string wsdlSaveLocation, string xmlComment ) : string

Generates the WSDL file for specified InterfaceContract.

GenerateWsdl ( InterfaceContract serviceInterfaceContract, string wsdlSaveLocation, string xmlComment, string wsdlLocation ) : string

Generates the WSDL file for a specified InterfaceContract.

This methods loads the information, it receive in a InterfaceContract to a System.Web.Services.Description.ServiceDescription class, which is later used to generate the WSDL file. The loading process takes place in several steps.

1. Load the basic meta data from InterfaceContract.

2. Load the schema imports in the SchemaImports collection.

3. Load the messages in OperationsCollection.

4. Create the WSDL Port Type.

5. Add each operation and it's corresponding in/out messages to the Port Type.

6. Create a WSDL Binding section and add OperationBinding for each operation.

7. Generate the WSDL 'service' tags if required.

8. Finally write the file to the output stream.

This method generates WsdlGenerationException exception, if it fails to create the WSDL file. If a file is specified to overwrite with the new file, the original file is restored in case of a failure.

GetInterfaceContract ( string wsdlFileName ) : InterfaceContract

Creates an InterfaceContract object by loading the contents in a specified WSDL file.

This method first loads the content of the WSDL file to an instance of System.Web.Services.Description.ServiceDescription class. Then it creates an instance of InterfaceContract class by loading the data from that. This method throws WsdlLoadException in case of a failure to load the WSDL file.

GetIntrinsicSimpleTypesNames ( ) : ArrayList

GetSchemasFromXsd ( string schemaFile, string &schemaNamespace ) : ArrayList

Reads a XML schema file and returns the information found in that.

Private Methods

Method Description
GetDefaultEndpoint ( System binding, string serviceName ) : string
GetFaultBodyBinding ( System binding ) : System.Web.Services.Description.SoapFaultBinding
GetSchemaElements ( System.Xml.Serialization.XmlSchemas schemas, string tns ) : SchemaElements

Extracts the elements from a given schemas.

GetSoapBinding ( System binding ) : object
GetSoapBodyBinding ( System binding ) : object
GetSoapHeaderBinding ( System binding, string message, string ns ) : object
GetSoapOperationBinding ( System binding, string action ) : object
GetTransport ( System binding ) : string
ServiceDescriptionEngine ( ) : System

Initializes a new instance of ServiceDescriptionEngine class.

ValidateWsdl ( System serviceDescription, bool &isHttpBinding ) : bool

Validates a specified instance of ServiceDescription class for the round tripping feature.

Method Details

GenerateWsdl() public static method

Generates the WSDL file for specified InterfaceContract.
public static GenerateWsdl ( InterfaceContract serviceInterfaceContract, string wsdlSaveLocation, string xmlComment ) : string
serviceInterfaceContract InterfaceContract /// to use for the WSDL generation. ///
wsdlSaveLocation string Location to save the generated WSDL file.
xmlComment string XML comment to add to the top of the WSDL file.
return string

GenerateWsdl() public static method

Generates the WSDL file for a specified InterfaceContract.
This methods loads the information, it receive in a InterfaceContract to a System.Web.Services.Description.ServiceDescription class, which is later used to generate the WSDL file. The loading process takes place in several steps.

1. Load the basic meta data from InterfaceContract.

2. Load the schema imports in the SchemaImports collection.

3. Load the messages in OperationsCollection.

4. Create the WSDL Port Type.

5. Add each operation and it's corresponding in/out messages to the Port Type.

6. Create a WSDL Binding section and add OperationBinding for each operation.

7. Generate the WSDL 'service' tags if required.

8. Finally write the file to the output stream.

This method generates WsdlGenerationException exception, if it fails to create the WSDL file. If a file is specified to overwrite with the new file, the original file is restored in case of a failure.
public static GenerateWsdl ( InterfaceContract serviceInterfaceContract, string wsdlSaveLocation, string xmlComment, string wsdlLocation ) : string
serviceInterfaceContract InterfaceContract /// to use for the WSDL generation. ///
wsdlSaveLocation string Location to save the generated WSDL file.
xmlComment string XML comment to add to the top of the WSDL file.
wsdlLocation string Path of an existing WSDL file to overwrite with the generated /// WSDL file.
return string

GetInterfaceContract() public static method

Creates an InterfaceContract object by loading the contents in a specified WSDL file.
This method first loads the content of the WSDL file to an instance of System.Web.Services.Description.ServiceDescription class. Then it creates an instance of InterfaceContract class by loading the data from that. This method throws WsdlLoadException in case of a failure to load the WSDL file.
public static GetInterfaceContract ( string wsdlFileName ) : InterfaceContract
wsdlFileName string Path of the WSDL file to load the information from.
return InterfaceContract

GetIntrinsicSimpleTypesNames() public static method

public static GetIntrinsicSimpleTypesNames ( ) : ArrayList
return System.Collections.ArrayList

GetSchemasFromXsd() public static method

Reads a XML schema file and returns the information found in that.
public static GetSchemasFromXsd ( string schemaFile, string &schemaNamespace ) : ArrayList
schemaFile string The XML schema file to read information from.
schemaNamespace string Ouput parameter which returns the namespace of the specified XML schema file.
return System.Collections.ArrayList