diff --git a/snippets/cpp/VS_Snippets_Remoting/BindingCollectionSample2/CPP/bindingcollectionsample2.cpp b/snippets/cpp/VS_Snippets_Remoting/BindingCollectionSample2/CPP/bindingcollectionsample2.cpp deleted file mode 100644 index 6bc8503b66d..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/BindingCollectionSample2/CPP/bindingcollectionsample2.cpp +++ /dev/null @@ -1,170 +0,0 @@ -// System.Web.Services.Description.Binding.Binding();System.Web.Services.Description.Binding.Name; -// System.Web.Services.Description.Binding.Type;System.Web.Services.Description.Binding.Extensions;System.Web.Services.Description.Binding.Operations; -// System.Web.Services.Description.BindingCollection.Insert; -// System.Web.Services.Description.Binding.ServiceDescription; - -// Grouping Clause : Snippet5 and Snippet8 go together. - -/* The following example demonstrates the constructor 'Binding()' and properties 'Extensions','Name','Operations', - 'ServiceDescription' and 'Type' property of 'Binding' class AND method 'Insert' of 'BindingCollection' class. - The input to the program is a WSDL file 'MathService_input.wsdl' with all information related to SOAP protocol - removed from it. In a way, it tries to simulate a scenario wherein a service initially did not support a protocol, however later - on happen to support it. - In this example, the WSDL file is modified to insert a new Binding for SOAP. The binding is populated based on - WSDL document structure defined in WSDL specification. The ServiceDescription instance is loaded with values - for 'Messages', 'PortTypes','Bindings', and 'Port'. The instance is then written to an external file 'MathService_new.wsdl'. - * */ - -#using -#using -#using - -using namespace System; -using namespace System::Collections; -using namespace System::Web::Services::Description; -using namespace System::Xml; - -ref class MyClass -{ -public: - // Creates a Message with name ="messageName" having one MessagePart with name = "partName". - static Message^ CreateMessage( String^ messageName, String^ partName, String^ element, String^ targetNamespace ) - { - Message^ myMessage = gcnew Message; - myMessage->Name = messageName; - MessagePart^ myMessagePart = gcnew MessagePart; - myMessagePart->Name = partName; - myMessagePart->Element = gcnew XmlQualifiedName( element,targetNamespace ); - myMessage->Parts->Add( myMessagePart ); - return myMessage; - } - - // Used to create Operations under PortType. - static Operation^ CreateOperation( String^ operationName, String^ inputMessage, String^ outputMessage, String^ targetNamespace ) - { - Operation^ myOperation = gcnew Operation; - myOperation->Name = operationName; - OperationMessage^ input = (OperationMessage^)( gcnew OperationInput ); - input->Message = gcnew XmlQualifiedName( inputMessage,targetNamespace ); - OperationMessage^ output = (OperationMessage^)( gcnew OperationOutput ); - output->Message = gcnew XmlQualifiedName( outputMessage,targetNamespace ); - myOperation->Messages->Add( input ); - myOperation->Messages->Add( output ); - return myOperation; - } - -// - // Used to create OperationBinding instances within 'Binding'. -public: - static OperationBinding^ CreateOperationBinding( String^ operation, String^ targetNamespace ) - { - // Create OperationBinding instance for operation. - OperationBinding^ myOperationBinding = gcnew OperationBinding; - myOperationBinding->Name = operation; - // Create InputBinding for operation. - InputBinding^ myInputBinding = gcnew InputBinding; - SoapBodyBinding^ mySoapBodyBinding = gcnew SoapBodyBinding; - mySoapBodyBinding->Use = SoapBindingUse::Literal; - myInputBinding->Extensions->Add( mySoapBodyBinding ); - // Create OutputBinding for operation. - OutputBinding^ myOutputBinding = gcnew OutputBinding; - myOutputBinding->Extensions->Add( mySoapBodyBinding ); - // Add 'InputBinding' and 'OutputBinding' to 'OperationBinding'. - myOperationBinding->Input = myInputBinding; - myOperationBinding->Output = myOutputBinding; - // Create extensibility element for 'SoapOperationBinding'. - SoapOperationBinding^ mySoapOperationBinding = gcnew SoapOperationBinding; - mySoapOperationBinding->Style = SoapBindingStyle::Document; - mySoapOperationBinding->SoapAction = String::Concat( targetNamespace, operation ); - // Add extensibility element 'SoapOperationBinding' to 'OperationBinding'. - myOperationBinding->Extensions->Add( mySoapOperationBinding ); - return myOperationBinding; - } -// - - static void Main() - { - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MathService_input.wsdl" ); - // Create SOAP Messages. - myServiceDescription->Messages->Add( CreateMessage( "AddSoapIn", "parameters", "Add", myServiceDescription->TargetNamespace ) ); - myServiceDescription->Messages->Add( CreateMessage( "AddSoapOut", "parameters", "AddResponse", myServiceDescription->TargetNamespace ) ); - myServiceDescription->Messages->Add( CreateMessage( "SubtractSoapIn", "parameters", "Subtract", myServiceDescription->TargetNamespace ) ); - myServiceDescription->Messages->Add( CreateMessage( "SubtractSoapOut", "parameters", "SubtractResponse", myServiceDescription->TargetNamespace ) ); - myServiceDescription->Messages->Add( CreateMessage( "MultiplySoapIn", "parameters", "Multiply", myServiceDescription->TargetNamespace ) ); - myServiceDescription->Messages->Add( CreateMessage( "MultiplySoapOut", "parameters", "MultiplyResponse", myServiceDescription->TargetNamespace ) ); - myServiceDescription->Messages->Add( CreateMessage( "DivideSoapIn", "parameters", "Divide", myServiceDescription->TargetNamespace ) ); - myServiceDescription->Messages->Add( CreateMessage( "DivideSoapOut", "parameters", "DivideResponse", myServiceDescription->TargetNamespace ) ); - - // Create a new PortType. - PortType^ soapPortType = gcnew PortType; - soapPortType->Name = "MathServiceSoap"; - soapPortType->Operations->Add( CreateOperation( "Add", "AddSoapIn", "AddSoapOut", myServiceDescription->TargetNamespace ) ); - soapPortType->Operations->Add( CreateOperation( "Subtract", "SubtractSoapIn", "SubtractSoapOut", myServiceDescription->TargetNamespace ) ); - soapPortType->Operations->Add( CreateOperation( "Multiply", "MultiplySoapIn", "MultiplySoapOut", myServiceDescription->TargetNamespace ) ); - soapPortType->Operations->Add( CreateOperation( "Divide", "DivideSoapIn", "DivideSoapOut", myServiceDescription->TargetNamespace ) ); - myServiceDescription->PortTypes->Add( soapPortType ); - -// -// -// - // Create a new Binding for SOAP Protocol. - Binding^ myBinding = gcnew Binding; - myBinding->Name = String::Concat( myServiceDescription->Services->default[ 0 ]->Name, "Soap" ); -// - -// - // Pass the name of the existing porttype 'MathServiceSoap' and the Xml targetNamespace attribute of the Descriptions tag. - myBinding->Type = gcnew XmlQualifiedName( "MathServiceSoap",myServiceDescription->TargetNamespace ); -// - -// - // Create SOAP Extensibility element. - SoapBinding^ mySoapBinding = gcnew SoapBinding; - // SOAP over HTTP. - mySoapBinding->Transport = "http://schemas.xmlsoap.org/soap/http"; - mySoapBinding->Style = SoapBindingStyle::Document; - // Add tag soap:binding as an extensibility element. - myBinding->Extensions->Add( mySoapBinding ); -// - -// - // Create OperationBindings for each of the operations defined in asmx file. - OperationBinding^ addOperationBinding = CreateOperationBinding( "Add", myServiceDescription->TargetNamespace ); - myBinding->Operations->Add( addOperationBinding ); - OperationBinding^ subtractOperationBinding = CreateOperationBinding( "Subtract", myServiceDescription->TargetNamespace ); - myBinding->Operations->Add( subtractOperationBinding ); - OperationBinding^ multiplyOperationBinding = CreateOperationBinding( "Multiply", myServiceDescription->TargetNamespace ); - myBinding->Operations->Add( multiplyOperationBinding ); - OperationBinding^ divideOperationBinding = CreateOperationBinding( "Divide", myServiceDescription->TargetNamespace ); - myBinding->Operations->Add( divideOperationBinding ); -// - - myServiceDescription->Bindings->Insert( 0, myBinding ); -// -// - -// - Console::WriteLine( "\nTarget Namespace of the Service Description to which the binding was added is:{0}", myServiceDescription->Bindings->default[ 0 ]->ServiceDescription->TargetNamespace ); -// - - // Create Port. - Port^ soapPort = gcnew Port; - soapPort->Name = "MathServiceSoap"; - soapPort->Binding = gcnew XmlQualifiedName( myBinding->Name,myServiceDescription->TargetNamespace ); - // Create SoapAddress extensibility element to add to port. - SoapAddressBinding^ mySoapAddressBinding = gcnew SoapAddressBinding; - mySoapAddressBinding->Location = "http://localhost/BindingCollectionSample/MathService.asmx"; - soapPort->Extensions->Add( mySoapAddressBinding ); - // Add port to the MathService which is the first service in the Service Collection. - myServiceDescription->Services->default[ 0 ]->Ports->Add( soapPort ); - // Save the ServiceDescription instance to an external file. - myServiceDescription->Write( "MathService_new.wsdl" ); - Console::WriteLine( "\nSuccessfully added bindings for SOAP protocol and saved results in file MathService_new.wsdl" ); - Console::WriteLine( "\n This file should be passed to wsdl tool as input to generate proxy" ); - } -}; - -int main() -{ - MyClass::Main(); -} diff --git a/snippets/cpp/VS_Snippets_Remoting/BindingCollectionsample1/CPP/bindingcollectionsample1.cpp b/snippets/cpp/VS_Snippets_Remoting/BindingCollectionsample1/CPP/bindingcollectionsample1.cpp deleted file mode 100644 index 1e66ce14ccb..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/BindingCollectionsample1/CPP/bindingcollectionsample1.cpp +++ /dev/null @@ -1,62 +0,0 @@ - - -// System::Web::Services::Description.BindingCollection;System::Web::Services::Description.BindingCollection::Item->Item[Int32]; -// System::Web::Services::Description.BindingCollection::Item->Item[String];System::Web::Services::Description.BindingCollection::CopyTo -/* The program reads a wsdl document S"MathService::wsdl" and instantiates a -// ServiceDescription instance from the WSDL document.A BindingCollection instance -// is then retrieved from this ServiceDescription instance and it's members are demonstrated. -*/ -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Collections; -using namespace System::Xml; - -int main() -{ - Binding^ myBinding; - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MathService_input.wsdl" ); - Console::WriteLine( "Total Number of bindings : {0}", myServiceDescription->Bindings->Count ); - - // - for ( int i = 0; i < myServiceDescription->Bindings->Count; ++i ) - { - Console::WriteLine( "\nBinding {0}", i ); - - // Get Binding at index i. - myBinding = myServiceDescription->Bindings[ i ]; - Console::WriteLine( "\t Name : {0}", myBinding->Name ); - Console::WriteLine( "\t Type : {0}", myBinding->Type ); - } - // - - // - array^myBindings = gcnew array(myServiceDescription->Bindings->Count); - - // Copy BindingCollection to an Array. - myServiceDescription->Bindings->CopyTo( myBindings, 0 ); - Console::WriteLine( "\n\n Displaying array copied from BindingCollection" ); - for ( int i = 0; i < myServiceDescription->Bindings->Count; ++i ) - { - Console::WriteLine( "\nBinding {0}", i ); - Console::WriteLine( "\t Name : {0}", myBindings[ i ]->Name ); - Console::WriteLine( "\t Type : {0}", myBindings[ i ]->Type ); - } - // - - // - // Get Binding Name = S"MathServiceSoap". - myBinding = myServiceDescription->Bindings[ "MathServiceHttpGet" ]; - if ( myBinding != nullptr ) - { - Console::WriteLine( "\n\nName : {0}", myBinding->Name ); - Console::WriteLine( "Type : {0}", myBinding->Type ); - } - // - - myServiceDescription = nullptr; - myBinding = nullptr; -} diff --git a/snippets/cpp/VS_Snippets_Remoting/BindingCollectionsample3/CPP/bindingcollectionsample3.cpp b/snippets/cpp/VS_Snippets_Remoting/BindingCollectionsample3/CPP/bindingcollectionsample3.cpp deleted file mode 100644 index 3be2280b84d..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/BindingCollectionsample3/CPP/bindingcollectionsample3.cpp +++ /dev/null @@ -1,51 +0,0 @@ - - -// System::Web::Services::Description.BindingCollection;System::Web::Services::Description.Remove;System::Web::Services::Description.Add; -// System::Web::Services::Description.Contains;System::Web::Services::Description.IndexOf -/*The following example reads the contents of a file 'MathService::wsdl' into a ServiceDescription instance. -Removes first binding in the BindingCollection of the ServiceDescription instance and writes the current -'ServiceDescription' instance into a temporary file. -Adds the same binding back again into the instance and writes to another temporary file. -*/ -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; - -int main() -{ - Binding^ myBinding; - - // - // - // - // - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MathService_input.wsdl" ); - Console::WriteLine( "Total Number of bindings defined are: {0}", myServiceDescription->Bindings->Count ); - myBinding = myServiceDescription->Bindings[ 0 ]; - - // Remove the first binding in the collection. - myServiceDescription->Bindings->Remove( myBinding ); - Console::WriteLine( "Successfully removed binding {0}", myBinding->Name ); - Console::WriteLine( "Total Number of bindings defined now are: {0}", myServiceDescription->Bindings->Count ); - myServiceDescription->Write( "MathService_temp.wsdl" ); - // - - // Add binding to the ServiceDescription instance. - myServiceDescription->Bindings->Add( myBinding ); - // - - if ( myServiceDescription->Bindings->Contains( myBinding ) ) - Console::WriteLine( "Successfully added binding {0}", myBinding->Name ); - // - - Console::WriteLine( "Binding was added at index {0}", myServiceDescription->Bindings->IndexOf( myBinding ) ); - Console::WriteLine( "Total Number of bindings defined now are: {0}", myServiceDescription->Bindings->Count ); - myServiceDescription->Write( "MathService_temp1.wsdl" ); - // - * myServiceDescription = 0; - - myBinding = nullptr; -} diff --git a/snippets/cpp/VS_Snippets_Remoting/DescriptionNamespaceSample1/CPP/MathService_input_cpp.wsdl b/snippets/cpp/VS_Snippets_Remoting/DescriptionNamespaceSample1/CPP/MathService_input_cpp.wsdl deleted file mode 100644 index 556e7526dd4..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/DescriptionNamespaceSample1/CPP/MathService_input_cpp.wsdl +++ /dev/null @@ -1,491 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/cpp/VS_Snippets_Remoting/DescriptionNamespaceSample1/CPP/descriptionnamespacesample1.cpp b/snippets/cpp/VS_Snippets_Remoting/DescriptionNamespaceSample1/CPP/descriptionnamespacesample1.cpp deleted file mode 100644 index 94ef69ae84a..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/DescriptionNamespaceSample1/CPP/descriptionnamespacesample1.cpp +++ /dev/null @@ -1,213 +0,0 @@ -// System.Web.Services.Description.InputBinding.InputBinding(); -// System.Web.Services.Description.InputBinding.Extensions -// System.Web.Services.Description.InputBinding -// System.Web.Services.Description.Message.Message(); -// System.Web.Services.Description.Message.Name; -// System.Web.Services.Description.Message.Parts; -// System.Web.Services.Description.MessageCollection.Add; -// System.Web.Services.Description.MessageCollection.Insert; -// System.Web.Services.Description.MessageCollection; -// System.Web.Services.Description.MessagePart.MessagePart(); -// System.Web.Services.Description.MessagePart.Element; -// System.Web.Services.Description.MessagePart.Name; -// System.Web.Services.Description.MessagePart; -// System.Web.Services.Description.MessagePartCollection.Add; -// System.Web.Services.Description.MessagePartCollection.Insert; - -/* - The following program takes input a WSDL file 'MathService_input.wsdl' with all information related to SOAP protocol - removed from it.In a way it tries to simulate a scenario wherein a service initially did not support a protocol, however later - on happen to support it. - In this example, the WSDL file is modified to insert a new Binding for SOAP. The binding is populated based on - WSDL document structure defined in WSDL specification. The ServiceDescription instance is loaded with values - for 'Messages', 'PortTypes','Bindings', and 'Port'. The instance is then written to an external file 'MathService_new.wsdl'. -*/ - -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Collections; -using namespace System::Xml; - -ref class MyClass1 -{ - // - // Creates a Message with name = messageName having one MessagePart - // with name = partName. -public: - static Message^ CreateMessage( String^ messageName, String^ partName, String^ element, String^ targetNamespace ) - { - // - // - Message^ myMessage = gcnew Message; - myMessage->Name = messageName; - // - // - // - // - // - MessagePart^ myMessagePart = gcnew MessagePart; - myMessagePart->Name = partName; - myMessagePart->Element = gcnew XmlQualifiedName( element,targetNamespace ); - myMessage->Parts->Add( myMessagePart ); - // - // - // - // - // - return myMessage; - } - // - - // - // Used to create OperationBinding instances within 'Binding'. - static OperationBinding^ CreateOperationBinding( String^ operation, String^ targetNamespace ) - { - // Create OperationBinding for operation. - OperationBinding^ myOperationBinding = gcnew OperationBinding; - myOperationBinding->Name = operation; - - // - // - // Create InputBinding for operation. - InputBinding^ myInputBinding = gcnew InputBinding; - SoapBodyBinding^ mySoapBodyBinding = gcnew SoapBodyBinding; - mySoapBodyBinding->Use = SoapBindingUse::Literal; - myInputBinding->Extensions->Add( mySoapBodyBinding ); - - // - // - // Create OutputBinding for operation. - OutputBinding^ myOutputBinding = gcnew OutputBinding; - myOutputBinding->Extensions->Add( mySoapBodyBinding ); - - // Add InputBinding and OutputBinding to OperationBinding. - myOperationBinding->Input = myInputBinding; - myOperationBinding->Output = myOutputBinding; - - // Create an extensibility element for SoapOperationBinding. - SoapOperationBinding^ mySoapOperationBinding = gcnew SoapOperationBinding; - mySoapOperationBinding->Style = SoapBindingStyle::Document; - mySoapOperationBinding->SoapAction = String::Concat( targetNamespace, operation ); - - // Add the extensibility element SoapOperationBinding to OperationBinding. - myOperationBinding->Extensions->Add( mySoapOperationBinding ); - return myOperationBinding; - } - // - - // Used to create Operations under PortType. - static Operation^ CreateOperation( String^ operationName, String^ inputMessage, String^ outputMessage, String^ targetNamespace ) - { - Operation^ myOperation = gcnew Operation; - myOperation->Name = operationName; - OperationMessage^ input = dynamic_cast(gcnew OperationInput); - input->Message = gcnew XmlQualifiedName( inputMessage,targetNamespace ); - OperationMessage^ output = dynamic_cast(gcnew OperationOutput); - output->Message = gcnew XmlQualifiedName( outputMessage,targetNamespace ); - myOperation->Messages->Add( input ); - myOperation->Messages->Add( output ); - return myOperation; - } - - static void main() - { - // - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MathService_input_cpp.wsdl" ); - // Create SOAP messages. - // - Message^ myMessage = gcnew Message; - myMessage->Name = "AddSoapOut"; - // - MessagePart^ myMessagePart = gcnew MessagePart; - myMessagePart->Name = "parameters"; - myMessagePart->Element = gcnew XmlQualifiedName( "AddResponse",myServiceDescription->TargetNamespace ); - myMessage->Parts->Add( myMessagePart ); - // - myServiceDescription->Messages->Add( myMessage ); - // - // - // - Message^ myMessage1 = gcnew Message; - myMessage1->Name = "AddSoapIn"; - // - MessagePart^ myMessagePart1 = gcnew MessagePart; - myMessagePart1->Name = "parameters"; - myMessagePart1->Element = gcnew XmlQualifiedName( "Add",myServiceDescription->TargetNamespace ); - myMessage1->Parts->Insert( 0, myMessagePart1 ); - // - myServiceDescription->Messages->Insert( 16, myMessage1 ); - // - myServiceDescription->Messages->Add( CreateMessage( "SubtractSoapIn", "parameters", "Subtract", myServiceDescription->TargetNamespace ) ); - myServiceDescription->Messages->Add( CreateMessage( "SubtractSoapOut", "parameters", "SubtractResponse", myServiceDescription->TargetNamespace ) ); - myServiceDescription->Messages->Add( CreateMessage( "MultiplySoapIn", "parameters", "Multiply", myServiceDescription->TargetNamespace ) ); - myServiceDescription->Messages->Add( CreateMessage( "MultiplySoapOut", "parameters", "MultiplyResponse", myServiceDescription->TargetNamespace ) ); - myServiceDescription->Messages->Add( CreateMessage( "DivideSoapIn", "parameters", "Divide", myServiceDescription->TargetNamespace ) ); - myServiceDescription->Messages->Add( CreateMessage( "DivideSoapOut", "parameters", "DivideResponse", myServiceDescription->TargetNamespace ) ); - - // Create a new PortType. - PortType^ soapPortType = gcnew PortType; - soapPortType->Name = "MathServiceSoap"; - soapPortType->Operations->Add( CreateOperation( "Add", "AddSoapIn", "AddSoapOut", myServiceDescription->TargetNamespace ) ); - soapPortType->Operations->Add( CreateOperation( "Subtract", "SubtractSoapIn", "SubtractSoapOut", myServiceDescription->TargetNamespace ) ); - soapPortType->Operations->Add( CreateOperation( "Multiply", "MultiplySoapIn", "MultiplySoapOut", myServiceDescription->TargetNamespace ) ); - soapPortType->Operations->Add( CreateOperation( "Divide", "DivideSoapIn", "DivideSoapOut", myServiceDescription->TargetNamespace ) ); - myServiceDescription->PortTypes->Add( soapPortType ); - - // Create a new Binding for the SOAP protocol. - Binding^ myBinding = gcnew Binding; - myBinding->Name = String::Concat( myServiceDescription->Services[ 0 ]->Name, "Soap" ); - - // Pass the name of the existing PortType MathServiceSoap and the - // Xml TargetNamespace attribute of the Descriptions tag. - myBinding->Type = gcnew XmlQualifiedName( "MathServiceSoap",myServiceDescription->TargetNamespace ); - - // Create a SOAP extensibility element. - SoapBinding^ mySoapBinding = gcnew SoapBinding; - mySoapBinding->Transport = "http://schemas.xmlsoap.org/soap/http"; - mySoapBinding->Style = SoapBindingStyle::Document; - - // Add tag soap:binding as an extensibility element. - myBinding->Extensions->Add( mySoapBinding ); - - // Create OperationBindings for each of the operations defined - // in the .asmx file. - OperationBinding^ addOperationBinding = CreateOperationBinding( "Add", myServiceDescription->TargetNamespace ); - myBinding->Operations->Add( addOperationBinding ); - OperationBinding^ subtractOperationBinding = CreateOperationBinding( "Subtract", myServiceDescription->TargetNamespace ); - myBinding->Operations->Add( subtractOperationBinding ); - OperationBinding^ multiplyOperationBinding = CreateOperationBinding( "Multiply", myServiceDescription->TargetNamespace ); - myBinding->Operations->Add( multiplyOperationBinding ); - OperationBinding^ divideOperationBinding = CreateOperationBinding( "Divide", myServiceDescription->TargetNamespace ); - myBinding->Operations->Add( divideOperationBinding ); - myServiceDescription->Bindings->Insert( 0, myBinding ); - Console::WriteLine( "\nTarget namespace of the service description to which the binding was added is: {0}", myServiceDescription->Bindings[ 0 ]->ServiceDescription->TargetNamespace ); - - // Create a Port. - Port^ soapPort = gcnew Port; - soapPort->Name = "MathServiceSoap"; - soapPort->Binding = gcnew XmlQualifiedName( myBinding->Name,myServiceDescription->TargetNamespace ); - - // Create a SoapAddress extensibility element to add to the port. - SoapAddressBinding^ mySoapAddressBinding = gcnew SoapAddressBinding; - mySoapAddressBinding->Location = "http://localhost/MathService.cs.asmx"; - soapPort->Extensions->Add( mySoapAddressBinding ); - - // Add the port to the MathService, which is the first service in - // the service collection. - myServiceDescription->Services[ 0 ]->Ports->Add( soapPort ); - - // Save the ServiceDescription to an external file. - myServiceDescription->Write( "MathService_new.wsdl" ); - Console::WriteLine( "\nSuccessfully added bindings for SOAP protocol and saved results in the file MathService_new.wsdl" ); - Console::WriteLine( "\n This file should be passed to the WSDL tool as input to generate the proxy" ); - } -}; - -int main() -{ - MyClass1::main(); -} diff --git a/snippets/cpp/VS_Snippets_Remoting/DocumentableItemsample/CPP/MathService_cpp.wsdl b/snippets/cpp/VS_Snippets_Remoting/DocumentableItemsample/CPP/MathService_cpp.wsdl deleted file mode 100644 index 9aa220c7ed2..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/DocumentableItemsample/CPP/MathService_cpp.wsdl +++ /dev/null @@ -1,352 +0,0 @@ - - - - - All types have been defined here - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Port Type "MathServiceHttpGet" is defined here - - - - - - - - - - - - - - - - - - - - - Port Type "MathServiceHttpPost" is defined here - - - - - - - - - - - - - - - - - - - - - Port Type "MathServiceSoap" is defined here - - - - - - - - - - - - - - - - - - - - - Binding "MathServiceSoap" is defined here - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Binding "MathServiceHttpGet" is defined here - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Binding "MathServiceHttpPost" is defined here - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/cpp/VS_Snippets_Remoting/DocumentableItemsample/CPP/documentableitemsample.cpp b/snippets/cpp/VS_Snippets_Remoting/DocumentableItemsample/CPP/documentableitemsample.cpp deleted file mode 100644 index 16ae3564724..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/DocumentableItemsample/CPP/documentableitemsample.cpp +++ /dev/null @@ -1,48 +0,0 @@ - - -// System::Web::Services::Description.DocumentableItem::Documentation; -/* -The following program demonstrates the property 'Documentation' of abstract class 'DocumentableItem' -The program reads a wsdl document S"MathService::wsdl" and instantiates a ServiceDescription instance -from the WSDL document. -This program demonstrates a generic utility function which can accept any of Types, PortType and Binding -classes as parameters. -*/ -// -#using -#using -#using - -using namespace System; -using namespace System::Xml; -using namespace System::Web::Services::Description; -using namespace System::Collections; - -// Prints documentation associated with a wsdl element. -void PrintDocumentation( DocumentableItem^ myItem ) -{ - Console::WriteLine( "\t {0}", myItem->Documentation ); -} - -int main() -{ - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MathService_cpp.wsdl" ); - Console::WriteLine( "Documentation Element for type is " ); - PrintDocumentation( myServiceDescription->Types ); - IEnumerator^ myEnum = myServiceDescription->PortTypes->GetEnumerator(); - while ( myEnum->MoveNext() ) - { - PortType^ myPortType = safe_cast(myEnum->Current); - Console::WriteLine( "Documentation Element for Port Type {0} is ", myPortType->Name ); - PrintDocumentation( myPortType ); - } - - myEnum = myServiceDescription->Bindings->GetEnumerator(); - while ( myEnum->MoveNext() ) - { - Binding^ myBinding = safe_cast(myEnum->Current); - Console::WriteLine( "Documentation Element for Port Type {0} is ", myBinding->Name ); - PrintDocumentation( myBinding ); - } -} -// diff --git a/snippets/cpp/VS_Snippets_Remoting/FaultBindingCollection_Add/CPP/faultbindingcollection_add.cpp b/snippets/cpp/VS_Snippets_Remoting/FaultBindingCollection_Add/CPP/faultbindingcollection_add.cpp deleted file mode 100644 index fbcca70719e..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/FaultBindingCollection_Add/CPP/faultbindingcollection_add.cpp +++ /dev/null @@ -1,217 +0,0 @@ -/* The following example demonstrates the 'Add' method of the 'FaultBindingCollection' class -* and constructor and 'Extensions' property of 'FaultBinding'class and 'Documentation' -* property of 'DocumentableItem' class. -* -* This program generates a WSDL file for a service called StockQuote. The StockQuote service -* provides one method called 'GetTradePrice'. The 'GetTradePrice' method takes two arguments, -* a 'tickerSymbol' and 'time' strings. The 'tickerSymbol' is a unique representation of a -* stock and 'time' is the time for which the trading price is to be returned for the stock -* specified. The WSDL file generated for the service supports the SOAP protocol only. -*/ - -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Xml; -using namespace System::Xml::Schema; -using namespace System::Xml::Serialization; - -XmlSchemaElement^ CreateComplexTypeXmlElement( String^ minoccurs, String^ maxoccurs, String^ name, bool isNillable, XmlQualifiedName^ schemaTypeName ) -{ - XmlSchemaElement^ myXmlSchemaElement = gcnew XmlSchemaElement; - myXmlSchemaElement->MinOccursString = minoccurs; - myXmlSchemaElement->MaxOccursString = maxoccurs; - myXmlSchemaElement->Name = name; - myXmlSchemaElement->IsNillable = true; - myXmlSchemaElement->SchemaTypeName = schemaTypeName; - return myXmlSchemaElement; -} - -XmlSchemaElement^ CreateOtherXmlElement( String^ name, XmlQualifiedName^ SchemaTypeName ) -{ - XmlSchemaElement^ myXmlSchemaElement = gcnew XmlSchemaElement; - myXmlSchemaElement->Name = name; - myXmlSchemaElement->SchemaTypeName = SchemaTypeName; - return myXmlSchemaElement; -} - -// Creates a Message with name =S"messageName" having one MessagePart with name = S"partName". -Message^ CreateMessage( String^ messageName, String^ partName, String^ element, String^ targetNamespace ) -{ - Message^ myMessage = gcnew Message; - myMessage->Name = messageName; - MessagePart^ myMessagePart = gcnew MessagePart; - myMessagePart->Name = partName; - myMessagePart->Element = gcnew XmlQualifiedName( element,targetNamespace ); - myMessage->Parts->Add( myMessagePart ); - return myMessage; -} - -int main() -{ - ServiceDescription^ myServiceDescription = gcnew ServiceDescription; - myServiceDescription->Name = "StockQuote"; - myServiceDescription->TargetNamespace = "http://www.contoso.com/stockquote.wsdl"; - - // Generate the 'Types' element. - XmlSchema^ myXmlSchema = gcnew XmlSchema; - myXmlSchema->AttributeFormDefault = XmlSchemaForm::Qualified; - myXmlSchema->ElementFormDefault = XmlSchemaForm::Qualified; - myXmlSchema->TargetNamespace = "http://www.contoso.com/stockquote.wsdl"; - - //XmlSchemaElement myXmlSchemaElement; - XmlSchemaComplexType^ myXmlSchemaComplexType = gcnew XmlSchemaComplexType; - myXmlSchemaComplexType->Name = "GetTradePriceInputType"; - XmlSchemaSequence^ myXmlSchemaSequence = gcnew XmlSchemaSequence; - myXmlSchemaSequence->Items->Add( CreateComplexTypeXmlElement( "1", "1", "tickerSymbol", true, gcnew XmlQualifiedName( "s:string" ) ) ); - myXmlSchemaSequence->Items->Add( CreateComplexTypeXmlElement( "1", "1", "time", true, gcnew XmlQualifiedName( "s:string" ) ) ); - myXmlSchemaComplexType->Particle = myXmlSchemaSequence; - myXmlSchema->Items->Add( myXmlSchemaComplexType ); - - myXmlSchemaComplexType = gcnew XmlSchemaComplexType; - myXmlSchemaComplexType->Name = "GetTradePriceOutputType"; - myXmlSchemaSequence = gcnew XmlSchemaSequence; - myXmlSchemaSequence->Items->Add( CreateComplexTypeXmlElement( "1", "1", "result", true, gcnew XmlQualifiedName( "s:string" ) ) ); - myXmlSchemaComplexType->Particle = myXmlSchemaSequence; - myXmlSchema->Items->Add( myXmlSchemaComplexType ); - - myXmlSchemaComplexType = gcnew XmlSchemaComplexType; - myXmlSchemaComplexType->Name = "GetTradePriceStringFaultType"; - myXmlSchemaSequence = gcnew XmlSchemaSequence; - myXmlSchemaSequence->Items->Add( CreateComplexTypeXmlElement( "1", "1", "error", true, gcnew XmlQualifiedName( "s:string" ) ) ); - myXmlSchemaComplexType->Particle = myXmlSchemaSequence; - myXmlSchema->Items->Add( myXmlSchemaComplexType ); - - myXmlSchemaComplexType = gcnew XmlSchemaComplexType; - myXmlSchemaComplexType->Name = "GetTradePriceStringIntType"; - myXmlSchemaSequence = gcnew XmlSchemaSequence; - myXmlSchemaSequence->Items->Add( CreateComplexTypeXmlElement( "1", "1", "error", true, gcnew XmlQualifiedName( "s:int" ) ) ); - myXmlSchemaComplexType->Particle = myXmlSchemaSequence; - myXmlSchema->Items->Add( myXmlSchemaComplexType ); - - myXmlSchema->Items->Add( CreateOtherXmlElement( "GetTradePriceSoapIn", gcnew XmlQualifiedName( "s0:GetTradePriceInputType" ) ) ); - myXmlSchema->Items->Add( CreateOtherXmlElement( "GetTradePriceSoapOut", gcnew XmlQualifiedName( "s0:GetTradePriceOutputType" ) ) ); - myXmlSchema->Items->Add( CreateOtherXmlElement( "GetTradePriceSoapStringFault", gcnew XmlQualifiedName( "s0:GetTradePriceStringFaultType" ) ) ); - myXmlSchema->Items->Add( CreateOtherXmlElement( "GetTradePriceSoapIntFault", gcnew XmlQualifiedName( "s0:GetTradePriceIntFaultType" ) ) ); - - myServiceDescription->Types->Schemas->Add( myXmlSchema ); - - // Generate the 'Message' element. - MessageCollection^ myMessageCollection = myServiceDescription->Messages; - myMessageCollection->Add( CreateMessage( "GetTradePriceInput", "parameters", "GetTradePriceSoapIn", myServiceDescription->TargetNamespace ) ); - myMessageCollection->Add( CreateMessage( "GetTradePriceOutput", "parameters", "GetTradePriceSoapOut", myServiceDescription->TargetNamespace ) ); - myMessageCollection->Add( CreateMessage( "GetTradePriceStringFault", "parameters", "GetTradePriceStringSoapFault", myServiceDescription->TargetNamespace ) ); - myMessageCollection->Add( CreateMessage( "GetTradePriceIntFault", "parameters", "GetTradePriceIntSoapFault", myServiceDescription->TargetNamespace ) ); - - // Generate the 'Port Type' element. - PortTypeCollection^ myPortTypeCollection = myServiceDescription->PortTypes; - PortType^ myPortType = gcnew PortType; - myPortType->Name = "StockQuotePortType"; - OperationCollection^ myOperationCollection = myPortType->Operations; - Operation^ myOperation = gcnew Operation; - myOperation->Name = "GetTradePrice"; - OperationMessage^ myOperationMessage; - OperationMessageCollection^ myOperationMessageCollection = myOperation->Messages; - myOperationMessage = dynamic_cast(gcnew OperationInput); - myOperationMessage->Message = gcnew XmlQualifiedName( "s0:GetTradePriceInput" ); - myOperationMessageCollection->Add( myOperationMessage ); - myOperationMessage = dynamic_cast(gcnew OperationOutput); - myOperationMessage->Message = gcnew XmlQualifiedName( "s0:GetTradePriceOutput" ); - myOperationMessageCollection->Add( myOperationMessage ); - OperationFault^ myOperationFault = gcnew OperationFault; - myOperationFault->Name = "ErrorString"; - myOperationFault->Message = gcnew XmlQualifiedName( "s0:GetTradePriceStringFault" ); - myOperation->Faults->Add( myOperationFault ); - myOperationFault = gcnew OperationFault; - myOperationFault->Name = "ErrorInt"; - myOperationFault->Message = gcnew XmlQualifiedName( "s0:GetTradePriceIntFault" ); - myOperation->Faults->Add( myOperationFault ); - myOperationCollection->Add( myOperation ); - myPortTypeCollection->Add( myPortType ); - - // Generate the 'Binding' element. - ServiceDescriptionFormatExtensionCollection^ myExtensions; - BindingCollection^ myBindingCollection = myServiceDescription->Bindings; - Binding^ myBinding = gcnew Binding; - myBinding->Name = "StockQuoteSoapBinding"; - myBinding->Type = gcnew XmlQualifiedName( "s0:StockQuotePortType" ); - myExtensions = myBinding->Extensions; - SoapBinding^ mySoapBinding = gcnew SoapBinding; - mySoapBinding->Style = SoapBindingStyle::Document; - mySoapBinding->Transport = "http://schemas.xmlsoap.org/soap/http"; - myExtensions->Add( mySoapBinding ); - OperationBindingCollection^ myOperationBindingCollection = myBinding->Operations; - OperationBinding^ myOperationBinding = gcnew OperationBinding; - myExtensions = myOperationBinding->Extensions; - SoapOperationBinding^ mySoapBindingOperation = gcnew SoapOperationBinding; - mySoapBindingOperation->SoapAction = "http://www.contoso.com/GetTradePrice"; - myExtensions->Add( mySoapBindingOperation ); - myOperationBinding->Name = "GetTradePrice"; - myOperationBinding->Input = gcnew InputBinding; - myExtensions = myOperationBinding->Input->Extensions; - SoapBodyBinding^ mySoapBodyBinding = gcnew SoapBodyBinding; - mySoapBodyBinding->Use = SoapBindingUse::Literal; - mySoapBodyBinding->Namespace = "http://www.contoso.com/stockquote"; - myExtensions->Add( mySoapBodyBinding ); - myOperationBinding->Output = gcnew OutputBinding; - myExtensions = myOperationBinding->Output->Extensions; - mySoapBodyBinding = gcnew SoapBodyBinding; - mySoapBodyBinding->Use = SoapBindingUse::Literal; - mySoapBodyBinding->Namespace = "http://www.contoso.com/stockquote"; - myExtensions->Add( mySoapBodyBinding ); - -// -// -// - FaultBindingCollection^ myFaultBindingCollection = myOperationBinding->Faults; - FaultBinding^ myFaultBinding = gcnew FaultBinding; - myFaultBinding->Name = "ErrorString"; - // Associate SOAP fault binding to the fault binding of the operation. - myExtensions = myFaultBinding->Extensions; - SoapFaultBinding^ mySoapFaultBinding = gcnew SoapFaultBinding; - mySoapFaultBinding->Use = SoapBindingUse::Literal; - mySoapFaultBinding->Namespace = "http://www.contoso.com/stockquote"; - myExtensions->Add( mySoapFaultBinding ); - myFaultBindingCollection->Add( myFaultBinding ); -// -// -// - - myFaultBinding = gcnew FaultBinding; - myFaultBinding->Name = "ErrorInt"; - // Associate SOAP fault binding to the fault binding of the operation. - myExtensions = myFaultBinding->Extensions; - mySoapFaultBinding = gcnew SoapFaultBinding; - mySoapFaultBinding->Use = SoapBindingUse::Literal; - mySoapFaultBinding->Namespace = "http://www.contoso.com/stockquote"; - myExtensions->Add( mySoapFaultBinding ); - myFaultBindingCollection->Add( myFaultBinding ); - myOperationBindingCollection->Add( myOperationBinding ); - myBindingCollection->Add( myBinding ); - - // Generate the 'Service' element. - ServiceCollection^ myServiceCollection = myServiceDescription->Services; - -// - Service^ myService = gcnew Service; - // Add a simple documentation for the service to ease the readability of the generated WSDL file. - myService->Documentation = "A Simple Stock Quote Service"; - myService->Name = "StockQuoteService"; - PortCollection^ myPortCollection = myService->Ports; - Port^ myPort = gcnew Port; - myPort->Name = "StockQuotePort"; - myPort->Binding = gcnew XmlQualifiedName( "s0:StockQuoteSoapBinding" ); - myExtensions = myPort->Extensions; - SoapAddressBinding^ mySoapAddressBinding = gcnew SoapAddressBinding; - mySoapAddressBinding->Location = "http://www.contoso.com/stockquote"; - myExtensions->Add( mySoapAddressBinding ); - myPortCollection->Add( myPort ); - // - myServiceCollection->Add( myService ); - - // Display the WSDL generated to the console. - myServiceDescription->Write( Console::Out ); -} diff --git a/snippets/cpp/VS_Snippets_Remoting/FaultBindingCollection_Item/CPP/faultbindingcollection_item.cpp b/snippets/cpp/VS_Snippets_Remoting/FaultBindingCollection_Item/CPP/faultbindingcollection_item.cpp deleted file mode 100644 index 5084e6fa169..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/FaultBindingCollection_Item/CPP/faultbindingcollection_item.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* -* The following example demonstrates the 'Item[String*]' property of -FaultBindingCollection class -* The program removes a fault binding with the name 'ErrorString' -from the WSDL file. It also removes a operation fault with the name -'ErrorString' and displays the resultant WSDL file to the console. -* -*/ - -#using -#using -#using - -using namespace System; -using namespace System::Xml; -using namespace System::Web::Services::Description; - -int main() -{ - - // Read the 'StockQuote::wsdl' file as input. - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "StockQuote.wsdl" ); - - // Get the operation fault collection and remove the operation fault with the name 'ErrorString'. - PortTypeCollection^ myPortTypeCollection = myServiceDescription->PortTypes; - PortType^ myPortType = myPortTypeCollection[ 0 ]; - OperationCollection^ myOperationCollection = myPortType->Operations; - Operation^ myOperation = myOperationCollection[ 0 ]; - OperationFaultCollection^ myOperationFaultCollection = myOperation->Faults; - if ( myOperationFaultCollection->Contains( myOperationFaultCollection[ "ErrorString" ] ) ) - myOperationFaultCollection->Remove( myOperationFaultCollection[ "ErrorString" ] ); - - - // Get the fault binding collection and remove the fault binding with the name 'ErrorString'. - // - BindingCollection^ myBindingCollection = myServiceDescription->Bindings; - Binding^ myBinding = myBindingCollection[ 0 ]; - OperationBindingCollection^ myOperationBindingCollection = myBinding->Operations; - OperationBinding^ myOperationBinding = myOperationBindingCollection[ 0 ]; - FaultBindingCollection^ myFaultBindingCollection = myOperationBinding->Faults; - if ( myFaultBindingCollection->Contains( myFaultBindingCollection[ "ErrorString" ] ) ) - myFaultBindingCollection->Remove( myFaultBindingCollection[ "ErrorString" ] ); - - - // - myServiceDescription->Write( Console::Out ); -} diff --git a/snippets/cpp/VS_Snippets_Remoting/FaultBindingCollection_Remove/CPP/faultbindingcollection_remove.cpp b/snippets/cpp/VS_Snippets_Remoting/FaultBindingCollection_Remove/CPP/faultbindingcollection_remove.cpp deleted file mode 100644 index 5d0f962f077..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/FaultBindingCollection_Remove/CPP/faultbindingcollection_remove.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/* -* The following example demonstrates the 'Remove', 'CopyTo', 'Insert', -'Contains', 'IndexOf' method and 'Item[int]' property of FaultBindingCollection -class -The program reverses the fault bindings that appear in the WSDL file. -It also reverses the operation faults and displays the resultant WSDL file -to the console. -*/ - -#using -#using -#using - -using namespace System; -using namespace System::Xml; -using namespace System::Web::Services::Description; - -int main() -{ - - // Read the 'StockQuote::wsdl' file as input. - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "StockQuote.wsdl" ); - PortTypeCollection^ myPortTypeCollection = myServiceDescription->PortTypes; - PortType^ myPortType = myPortTypeCollection[ 0 ]; - OperationCollection^ myOperationCollection = myPortType->Operations; - Operation^ myOperation = myOperationCollection[ 0 ]; - OperationFaultCollection^ myOperationFaultCollection = myOperation->Faults; - - // Reverse the operation fault order. - if ( myOperationFaultCollection->Count > 1 ) - { - array^myOperationFaultArray = gcnew array(myOperationFaultCollection->Count); - - // Copy the operation fault to a temporary array. - myOperationFaultCollection->CopyTo( myOperationFaultArray, 0 ); - - // Remove all the operation fault instances in the fault binding collection. - for ( int i = 0; i < myOperationFaultArray->Length; i++ ) - myOperationFaultCollection->Remove( myOperationFaultArray[ i ] ); - - // Insert the operation fault instance in the reverse order. - for ( int i = 0,j = (myOperationFaultArray->Length - 1); i < myOperationFaultArray->Length; i++,j-- ) - myOperationFaultCollection->Insert( i, myOperationFaultArray[ j ] ); - } - - // - // - // - // - // - // - BindingCollection^ myBindingCollection = myServiceDescription->Bindings; - Binding^ myBinding = myBindingCollection[ 0 ]; - OperationBindingCollection^ myOperationBindingCollection = myBinding->Operations; - OperationBinding^ myOperationBinding = myOperationBindingCollection[ 0 ]; - FaultBindingCollection^ myFaultBindingCollection = myOperationBinding->Faults; - - // Reverse the fault bindings order. - if ( myFaultBindingCollection->Count > 1 ) - { - FaultBinding^ myFaultBinding = myFaultBindingCollection[ 0 ]; - array^myFaultBindingArray = gcnew array(myFaultBindingCollection->Count); - - // Copy the fault bindings to a temporary array. - myFaultBindingCollection->CopyTo( myFaultBindingArray, 0 ); - - // Remove all the fault binding instances in the fault binding collection. - for ( int i = 0; i < myFaultBindingArray->Length; i++ ) - myFaultBindingCollection->Remove( myFaultBindingArray[ i ] ); - - // Insert the fault binding instance in the reverse order. - for ( int i = 0,j = (myFaultBindingArray->Length - 1); i < myFaultBindingArray->Length; i++,j-- ) - myFaultBindingCollection->Insert( i, myFaultBindingArray[ j ] ); - - // Check if the first element in the collection before the reversal is now the last element. - if ( myFaultBindingCollection->Contains( myFaultBinding ) && myFaultBindingCollection->IndexOf( myFaultBinding ) == (myFaultBindingCollection->Count - 1) ) - - // Display the WSDL generated to the console. - myServiceDescription->Write( Console::Out ); - else - Console::WriteLine( "Error while reversing" ); - } - // - // - // - // - // - // -} diff --git a/snippets/cpp/VS_Snippets_Remoting/HttpBinding_HttpBinding/CPP/HttpBinding_ctor_Input_CPP.wsdl b/snippets/cpp/VS_Snippets_Remoting/HttpBinding_HttpBinding/CPP/HttpBinding_ctor_Input_CPP.wsdl deleted file mode 100644 index 5adc74e5609..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/HttpBinding_HttpBinding/CPP/HttpBinding_ctor_Input_CPP.wsdl +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/cpp/VS_Snippets_Remoting/HttpBinding_HttpBinding/CPP/httpbinding_ctor.cpp b/snippets/cpp/VS_Snippets_Remoting/HttpBinding_HttpBinding/CPP/httpbinding_ctor.cpp deleted file mode 100644 index 6e09ece8126..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/HttpBinding_HttpBinding/CPP/httpbinding_ctor.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// System.Web.Services.Description.HttpBinding.HttpBinding() -// System.Web.Services.Description.HttpBinding.Namespace -// System.Web.Services.Description.HttpAddressBinding.HttpAddressBinding() - -/* The following program demonstrates the constructor, field 'Namespace' of - class 'HttpBinding' and constructor of class 'HttpAddressBinding'. This program writes all 'HttpPost' binding related information to the input wsdl file and genrates an output file which is later on compiled using wsdl tool. -*/ - -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Collections; -using namespace System::Xml; - -int main() -{ - ServiceDescription^ myDescription = ServiceDescription::Read( "HttpBinding_ctor_Input_CPP.wsdl" ); - - // - // - // Create 'Binding' object. - Binding^ myBinding = gcnew Binding; - myBinding->Name = "MyHttpBindingServiceHttpPost"; - XmlQualifiedName^ qualifiedName = gcnew XmlQualifiedName( "s0:MyHttpBindingServiceHttpPost" ); - myBinding->Type = qualifiedName; - - // Create 'HttpBinding' object. - HttpBinding^ myHttpBinding = gcnew HttpBinding; - myHttpBinding->Verb = "POST"; - Console::WriteLine( "HttpBinding Namespace : {0}", HttpBinding::Namespace ); - // - - // Add 'HttpBinding' to 'Binding'. - myBinding->Extensions->Add( myHttpBinding ); - // - - // Create 'OperationBinding' object. - OperationBinding^ myOperationBinding = gcnew OperationBinding; - myOperationBinding->Name = "AddNumbers"; - HttpOperationBinding^ myOperation = gcnew HttpOperationBinding; - myOperation->Location = "/AddNumbers"; - - // Add 'HttpOperationBinding' to 'OperationBinding'. - myOperationBinding->Extensions->Add( myOperation ); - - // Create 'InputBinding' object. - InputBinding^ myInput = gcnew InputBinding; - MimeContentBinding^ postMimeContentbinding = gcnew MimeContentBinding; - postMimeContentbinding->Type = "application/x-www-form-urlencoded"; - myInput->Extensions->Add( postMimeContentbinding ); - - // Add 'InputBinding' to 'OperationBinding'. - myOperationBinding->Input = myInput; - - // Create 'OutputBinding' object. - OutputBinding^ myOutput = gcnew OutputBinding; - MimeXmlBinding^ postMimeXmlbinding = gcnew MimeXmlBinding; - postMimeXmlbinding->Part = "Body"; - myOutput->Extensions->Add( postMimeXmlbinding ); - - // Add 'OutPutBinding' to 'OperationBinding'. - myOperationBinding->Output = myOutput; - - // Add 'OperationBinding' to 'Binding'. - myBinding->Operations->Add( myOperationBinding ); - - // Add 'Binding' to 'BindingCollection' of 'ServiceDescription'. - myDescription->Bindings->Add( myBinding ); - - // - // Create a 'Port' object. - Port^ postPort = gcnew Port; - postPort->Name = "MyHttpBindingServiceHttpPost"; - postPort->Binding = gcnew XmlQualifiedName( "s0:MyHttpBindingServiceHttpPost" ); - - // Create 'HttpAddressBinding' object. - HttpAddressBinding^ postAddressBinding = gcnew HttpAddressBinding; - postAddressBinding->Location = "http://localhost/HttpBinding_ctor/HttpBinding_ctor_Service.cs.asmx"; - - // Add 'HttpAddressBinding' to 'Port'. - postPort->Extensions->Add( postAddressBinding ); - // - - // Add 'Port' to 'PortCollection' of 'ServiceDescription'. - myDescription->Services[ 0 ]->Ports->Add( postPort ); - - // Write 'ServiceDescription' as a WSDL file. - myDescription->Write( "HttpBinding_ctor_Output_CPP.wsdl" ); - Console::WriteLine( "WSDL file with name 'HttpBinding_ctor_Output_CPP.wsdl' file created Successfully" ); -} diff --git a/snippets/cpp/VS_Snippets_Remoting/ImportCollection_6/CPP/StockQuoteService_cpp.wsdl b/snippets/cpp/VS_Snippets_Remoting/ImportCollection_6/CPP/StockQuoteService_cpp.wsdl deleted file mode 100644 index ba2aaa247d1..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/ImportCollection_6/CPP/StockQuoteService_cpp.wsdl +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - My first service - - - - - \ No newline at end of file diff --git a/snippets/cpp/VS_Snippets_Remoting/ImportCollection_6/CPP/importcollection_6.cpp b/snippets/cpp/VS_Snippets_Remoting/ImportCollection_6/CPP/importcollection_6.cpp deleted file mode 100644 index a896ff5bdcf..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/ImportCollection_6/CPP/importcollection_6.cpp +++ /dev/null @@ -1,71 +0,0 @@ -// System::Web::Services::Description.ImportCollection -// System::Web::Services::Description.ImportCollection::Item -// System::Web::Services::Description.ImportCollection::CopyTo -// System::Web::Services::Description.ImportCollection::Contains -// System::Web::Services::Description.ImportCollection::IndexOf -// System::Web::Services::Description.ImportCollection::Remove - -/* The following program demonstrates the methods 'CopyTo', 'Contains', 'IndexOf', 'Remove' -and property 'Item' of class 'ImportCollection'. -The program reads a 'WSDL' document and gets a 'ServiceDescription' instance -An 'ImportCollection' instance is then retrieved from this 'ServiceDescription' -instance and its members have been demonstrated. -*/ - -// -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Xml; -int main() -{ - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "StockQuoteService_cpp.wsdl" ); - Console::WriteLine( " ImportCollection Sample " ); - - // - // Get Import Collection. - ImportCollection^ myImportCollection = myServiceDescription->Imports; - Console::WriteLine( "Total Imports in the document = {0}", myServiceDescription->Imports->Count ); - - // Print 'Import' properties to console. - for ( int i = 0; i < myImportCollection->Count; ++i ) - Console::WriteLine( "\tImport Namespace : {0} Import Location : {1} ", - myImportCollection[ i ]->Namespace, myImportCollection[ i ]->Location ); - // - - // - array^myImports = gcnew array(myServiceDescription->Imports->Count); - - // Copy 'ImportCollection' to an array. - myServiceDescription->Imports->CopyTo( myImports, 0 ); - Console::WriteLine( "Imports that are copied to Importarray ..." ); - for ( int i = 0; i < myImports->Length; ++i ) - Console::WriteLine( "\tImport Namespace : {0} Import Location : {1} ", - myImports[ i ]->Namespace, myImports[ i ]->Location ); - // - - // - // - // - // Get Import by Index. - Import^ myImport = myServiceDescription->Imports[ myServiceDescription->Imports->Count - 1 ]; - Console::WriteLine( "Import by Index..." ); - if ( myImportCollection->Contains( myImport ) ) - { - Console::WriteLine( "Import Namespace ' {0} ' is found in 'ImportCollection'.", myImport->Namespace ); - Console::WriteLine( "Index of '{0}' in 'ImportCollection' = {1}", - myImport->Namespace, myImportCollection->IndexOf( myImport ) ); - Console::WriteLine( "Deleting Import from 'ImportCollection'..." ); - myImportCollection->Remove( myImport ); - if ( myImportCollection->IndexOf( myImport ) == -1 ) - Console::WriteLine( "Import is successfully removed from Import Collection." ); - } - // - // - // -} - -// diff --git a/snippets/cpp/VS_Snippets_Remoting/Importsample/CPP/importsample.cpp b/snippets/cpp/VS_Snippets_Remoting/Importsample/CPP/importsample.cpp deleted file mode 100644 index 84b92d63c6b..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/Importsample/CPP/importsample.cpp +++ /dev/null @@ -1,88 +0,0 @@ -// System::Web::Services::Description.ImportCollection->Add; -// System::Web::Services::Description.ImportCollection::Insert; -// System::Web::Services::Description.Import::Import(); -// System::Web::Services::Description.Import::Location; -// System::Web::Services::Description.Import::Namespace; -// System::Web::Services::Description.Import::ServiceDescription; -// System::Web::Services::Description.Import; - -/* The following example demonstrates the constructor 'Import()' and properties 'Namespace', 'Location', 'Namespace', -'ServiceDescription' of Import Class. Methods 'Add' and 'Insert' of Class 'ImportCollection' are also demonstrated. -This example uses a sample provided in WSDL specification to explain Import and ImportCollection. -It adds import instances to ImportCollection as suggested in the specification sample and enumerates the same to the console. -Note: This is an illustrative sample using an example from WSDL specification. The real world web service has been assumed. -*/ - -// -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Collections; -using namespace System::Xml; - -// -// -// -// Creates an Import object with namespace and location. -Import^ CreateImport( String^ targetNamespace, String^ targetlocation ) -{ - Import^ myImport = gcnew Import; - myImport->Location = targetlocation; - myImport->Namespace = targetNamespace; - return myImport; -} -// -// -// - -// -void PrintImportCollection( String^ fileName_wsdl ) -{ - // Read import collection properties from generated WSDL file. - ServiceDescription^ myServiceDescription1 = ServiceDescription::Read( fileName_wsdl ); - ImportCollection^ myImportCollection = myServiceDescription1->Imports; - Console::WriteLine( "Enumerating Import Collection for file ' {0}'...", fileName_wsdl ); - - // Print Import properties to console. - for ( int i = 0; i < myImportCollection->Count; ++i ) - { - Console::WriteLine( "Namespace : {0}", myImportCollection[ i ]->Namespace ); - Console::WriteLine( "Location : {0}", myImportCollection[ i ]->Location ); - Console::WriteLine( "ServiceDescription : {0}", myImportCollection[ i ]->ServiceDescription->Name ); - } -} -// - -int main() -{ - Console::WriteLine( "Import Sample" ); - - // - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "StockQuote_cpp.wsdl" ); - myServiceDescription->Imports->Add( CreateImport( "http://localhost/stockquote/schemas", "http://localhost/stockquote/stockquote_cpp.xsd" ) ); - // - - // Save the ServiceDescripition to an external file. - myServiceDescription->Write( "StockQuote_cpp.wsdl" ); - Console::WriteLine( "document 'StockQuote_cpp.wsdl'" ); - - // Print the import collection to the console. - PrintImportCollection( "StockQuote_cpp.wsdl" ); - - // - myServiceDescription = ServiceDescription::Read( "StockQuoteService_cpp.wsdl" ); - myServiceDescription->Imports->Insert( 0, CreateImport( "http://localhost/stockquote/definitions", "http://localhost/stockquote/stockquote_cpp.wsdl" ) ); - // - - // Save the ServiceDescripition to an external file. - myServiceDescription->Write( "StockQuoteService_cs::wsdl" ); - Console::WriteLine( "" ); - Console::WriteLine( "document 'StockQuoteService_cpp.wsdl'" ); - - //Print the import collection to the console. - PrintImportCollection( "StockQuoteService_cpp.wsdl" ); -} -// diff --git a/snippets/cpp/VS_Snippets_Remoting/MessageBinding_sample/CPP/messagebinding_sample.cpp b/snippets/cpp/VS_Snippets_Remoting/MessageBinding_sample/CPP/messagebinding_sample.cpp deleted file mode 100644 index 5210e7417e5..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/MessageBinding_sample/CPP/messagebinding_sample.cpp +++ /dev/null @@ -1,85 +0,0 @@ - - -// System::Web::Services::Description.MessageBinding::MessageBinding(); -// System::Web::Services::Description.MessageBinding::Extensions; -// System::Web::Services::Description.MessageBinding::Name; -/* The following program demonstrates the abstract class 'MessageBinding', it's constructor MessageBinding() -and properties 'Extensions' and 'Name'. -'MessageBinding' is an abstract class from which 'InputBinding' , 'OutputBinding' are derived. -The program contains a utility function which could be used to create either an InputBinding or OutputBinding. -This generic nature is achieved by returning an instance of 'MessageBinding'. -*/ -// -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -MessageBinding^ CreateInputOutputBinding( String^ myBindName, bool isInputBinding ) -{ - - // - // Value isInputBinding = true ---> return type = InputBinding. - // Value isInputBinding = false --> return type = OutputBinding. - // - // - MessageBinding^ myMessageBinding = nullptr; - switch ( isInputBinding ) - { - case true: - myMessageBinding = gcnew InputBinding; - Console::WriteLine( "Added an InputBinding" ); - break; - - case false: - myMessageBinding = gcnew OutputBinding; - Console::WriteLine( "Added an OutputBinding" ); - break; - } - // - myMessageBinding->Name = myBindName; - SoapBodyBinding^ mySoapBodyBinding = gcnew SoapBodyBinding; - mySoapBodyBinding->Use = SoapBindingUse::Literal; - myMessageBinding->Extensions->Add( mySoapBodyBinding ); - Console::WriteLine( "Added extensibility element of type : {0}", mySoapBodyBinding->GetType() ); - // - // - - return myMessageBinding; -} - - -// Used to create OperationBinding instances within Binding. -OperationBinding^ CreateOperationBinding( String^ myOperation, String^ targetNamespace ) -{ - // Create OperationBinding for Operation. - OperationBinding^ myOperationBinding = gcnew OperationBinding; - myOperationBinding->Name = myOperation; - - // Create InputBinding for operation. - InputBinding^ myInputBinding = dynamic_cast(CreateInputOutputBinding( nullptr, true )); - - // Create OutputBinding for operation. - OutputBinding^ myOutputBinding = dynamic_cast(CreateInputOutputBinding( nullptr, false )); - - // Add InputBinding and OutputBinding to OperationBinding. - myOperationBinding->Input = myInputBinding; - myOperationBinding->Output = myOutputBinding; - - // Create an extensibility element for SoapOperationBinding. - SoapOperationBinding^ mySoapOperationBinding = gcnew SoapOperationBinding; - mySoapOperationBinding->Style = SoapBindingStyle::Document; - mySoapOperationBinding->SoapAction = String::Concat( targetNamespace, myOperation ); - - // Add the extensibility element SoapOperationBinding to OperationBinding. - myOperationBinding->Extensions->Add( mySoapOperationBinding ); - return myOperationBinding; -} - -int main() -{ - /* OperationBinding* addOperationBinding = */ - CreateOperationBinding( "Add", "http://tempuri.org/" ); -} -// diff --git a/snippets/cpp/VS_Snippets_Remoting/MessageCollection/CPP/messagecollection.cpp b/snippets/cpp/VS_Snippets_Remoting/MessageCollection/CPP/messagecollection.cpp deleted file mode 100644 index 078f4450a48..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/MessageCollection/CPP/messagecollection.cpp +++ /dev/null @@ -1,80 +0,0 @@ -// System::Web::Services::Description.MessageCollection::CopyTo; -// System::Web::Services::Description.MessageCollection::Item Property(Int32); -// System::Web::Services::Description.MessageCollection::Item Property (String); -// System::Web::Services::Description.MessageCollection::Contains; -// System::Web::Services::Description.MessageCollection::IndexOf; -// System::Web::Services::Description.MessageCollection::Remove; - -/* The program reads a WSDL document S"MathService::wsdl" and gets a ServiceDescription instance. -A MessageCollection instance is then retrieved from this ServiceDescription instance and it's -members are demonstrated. -*/ - -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Collections; -using namespace System::Xml; - -int main() -{ - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MathService_1.wsdl" ); - Console::WriteLine( "" ); - Console::WriteLine( "MessageCollection Sample" ); - Console::WriteLine( "========================" ); - Console::WriteLine( "" ); - - // - // Get Message Collection. - MessageCollection^ myMessageCollection = myServiceDescription->Messages; - Console::WriteLine( "Total Messages in the document = {0}", myServiceDescription->Messages->Count ); - Console::WriteLine( "" ); - Console::WriteLine( "Enumerating Messages..." ); - Console::WriteLine( "" ); - - // Print messages to console. - for ( int i = 0; i < myMessageCollection->Count; ++i ) - Console::WriteLine( "Message Name : {0}", myMessageCollection[ i ]->Name ); - // - - // - // Create a Message Array. - array^myMessages = gcnew array(myServiceDescription->Messages->Count); - - // Copy MessageCollection to an array. - myServiceDescription->Messages->CopyTo( myMessages, 0 ); - Console::WriteLine( "" ); - Console::WriteLine( "Displaying Messages that were copied to Messagearray ..." ); - Console::WriteLine( "" ); - for ( int i = 0; i < myServiceDescription->Messages->Count; ++i ) - Console::WriteLine( "Message Name : {0}", myMessages[ i ]->Name ); - // - - // - // - // - // - // Get Message by Name = S"AddSoapIn". - Message^ myMessage = myServiceDescription->Messages[ "AddSoapIn" ]; - Console::WriteLine( "" ); - Console::WriteLine( "Getting Message = 'AddSoapIn' {by Name}" ); - if ( myMessageCollection->Contains( myMessage ) ) - { - Console::WriteLine( "" ); - - // Get Message Name = S"AddSoapIn" Index. - Console::WriteLine( "Message 'AddSoapIn' was found in Message Collection." ); - Console::WriteLine( "Index of 'AddSoapIn' in Message Collection = {0}", myMessageCollection->IndexOf( myMessage ) ); - Console::WriteLine( "Deleting Message from Message Collection..." ); - myMessageCollection->Remove( myMessage ); - if ( myMessageCollection->IndexOf( myMessage ) == -1 ) - Console::WriteLine( "Message 'AddSoapIn' was successfully removed from Message Collection." ); - } - // - // - // - // -} diff --git a/snippets/cpp/VS_Snippets_Remoting/MessagePartCollection/CPP/messagepartcollection.cpp b/snippets/cpp/VS_Snippets_Remoting/MessagePartCollection/CPP/messagepartcollection.cpp deleted file mode 100644 index 1b626e5d6ee..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/MessagePartCollection/CPP/messagepartcollection.cpp +++ /dev/null @@ -1,106 +0,0 @@ -// System::Web::Services::Description.MessagePartCollection::Item Property(Int32); -// System::Web::Services::Description.MessagePart::Message; -// System::Web::Services::Description.MessagePartCollection::CopyTo; -// System::Web::Services::Description.MessagePartCollection::Item Property (String); -// System::Web::Services::Description.MessagePartCollection::Contains; -// System::Web::Services::Description.MessagePartCollection::IndexOf; -// System::Web::Services::Description.MessagePartCollection::Remove; -// System::Web::Services::Description.MessagePartCollection; - -/* The program reads a wsdl document S"MathService::wsdl" and gets ServiceDescription instance. -A MessagePartCollection instance is then retrieved from each Message and it's members are demonstrated. -*/ - -// -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Collections; -using namespace System::Xml; -int main() -{ - Console::WriteLine( "" ); - Console::WriteLine( "MessagePartCollection Sample" ); - Console::WriteLine( "============================" ); - Console::WriteLine( "" ); - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MathService.wsdl" ); - - // Get the message collection. - MessageCollection^ myMessageCollection = myServiceDescription->Messages; - Console::WriteLine( "Total Messages in the document = {0}", myServiceDescription->Messages->Count ); - Console::WriteLine( "" ); - Console::WriteLine( "Enumerating PartCollection for each message..." ); - Console::WriteLine( "" ); - - // - // - // Get the message part collection for each message. - for ( int i = 0; i < myMessageCollection->Count; ++i ) - { - Console::WriteLine( "Message : {0}", myMessageCollection[ i ]->Name ); - - // Get the message part collection. - MessagePartCollection^ myMessagePartCollection = myMessageCollection[ i ]->Parts; - - // Display the part collection. - for ( int k = 0; k < myMessagePartCollection->Count; k++ ) - { - Console::WriteLine( "\t Part Name : {0}", myMessagePartCollection[ k ]->Name ); - Console::WriteLine( "\t Message Name : {0}", myMessagePartCollection[ k ]->Message->Name ); - } - Console::WriteLine( "" ); - } - // - // - - Console::WriteLine( "MessagePartCollection for the message AddHttpGetIn." ); - // - // - Message^ myLocalMessage = myServiceDescription->Messages[ "AddHttpPostOut" ]; - if ( myMessageCollection->Contains( myLocalMessage ) ) - { - Console::WriteLine( "Message : {0}", myLocalMessage->Name ); - - // Get the message part collection. - MessagePartCollection^ myMessagePartCollection = myLocalMessage->Parts; - array^myMessagePart = gcnew array(myMessagePartCollection->Count); - - // Copy the MessagePartCollection to an array. - myMessagePartCollection->CopyTo( myMessagePart, 0 ); - for ( int k = 0; k < myMessagePart->Length; k++ ) - Console::WriteLine( "\t Part Name : {0}", myMessagePartCollection[ k ]->Name ); - Console::WriteLine( "" ); - } - // - // - - // - // - // - Console::WriteLine( "Checking if message is AddHttpPostOut..." ); - Message^ myMessage = myServiceDescription->Messages[ "AddHttpPostOut" ]; - if ( myMessageCollection->Contains( myMessage ) ) - { - // Get the mssage part collection. - MessagePartCollection^ myMessagePartCollection = myMessage->Parts; - - // Get the part named Body. - MessagePart^ myMessagePart = myMessage->Parts[ "Body" ]; - if ( myMessagePartCollection->Contains( myMessagePart ) ) - { - // Get the part named Body. - Console::WriteLine( "Index of Body in MessagePart collection = {0}", myMessagePartCollection->IndexOf( myMessagePart ) ); - Console::WriteLine( "Deleting Body from MessagePart collection..." ); - myMessagePartCollection->Remove( myMessagePart ); - if ( myMessagePartCollection->IndexOf( myMessagePart ) == -1 ) - Console::WriteLine( "from the message AddHttpPostOut." ); - } - } - // - // - // -} -// diff --git a/snippets/cpp/VS_Snippets_Remoting/Message_Samples3/CPP/message_samples3.cpp b/snippets/cpp/VS_Snippets_Remoting/Message_Samples3/CPP/message_samples3.cpp deleted file mode 100644 index ec5c5a7a240..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/Message_Samples3/CPP/message_samples3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// System::Web::Services::Description.Message::FindPartsByName -// System::Web::Services::Description.Message::ServiceDescription -// System::Web::Services::Description.Message::FindPartByName - -/* The following program demonstrates the property ' ServiceDescription' and -methods 'FindPartsByName', 'FindPartByName' of class 'Message'. The program -reads a wsdl document S"MathService::wsdl" and instantiates a -ServiceDescription instance from WSDL document. -The program invokes 'FindPartsByName' to obtain an array of MessageParts and also invokes -'FindPartByName' to retrieve a specific 'MessagePart'. -*/ - -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Collections; -using namespace System::Xml; -int main() -{ - try - { - // - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MathService_cpp.wsdl" ); - - // - // Get message from ServiceDescription. - Message^ myMessage1 = myServiceDescription->Messages[ "AddHttpPostIn" ]; - Console::WriteLine( "ServiceDescription : {0}", myMessage1->ServiceDescription ); - - // - array^myParts = gcnew array(2); - myParts[ 0 ] = "a"; - myParts[ 1 ] = "b"; - array^myMessageParts = myMessage1->FindPartsByName( myParts ); - Console::WriteLine( "Results of FindPartsByName operation:" ); - for ( int i = 0; i < myMessageParts->Length; ++i ) - { - Console::WriteLine( "Part Name: {0}", myMessageParts[ i ]->Name ); - Console::WriteLine( "Part Type: {0}", myMessageParts[ i ]->Type ); - } - // - // - // Get another message from ServiceDescription. - Message^ myMessage2 = myServiceDescription->Messages[ "DivideHttpGetOut" ]; - MessagePart^ myMessagePart = myMessage2->FindPartByName( "Body" ); - Console::WriteLine( "Results of FindPartByName operation:" ); - Console::WriteLine( "Part Name: {0}", myMessagePart->Name ); - Console::WriteLine( "Part Element: {0}", myMessagePart->Element ); - // - } - catch ( Exception^ e ) - { - Console::WriteLine( "Exception: {0}", e->Message ); - } -} diff --git a/snippets/cpp/VS_Snippets_Remoting/MimeContentBinding_Part_4/CPP/mimecontentbinding_part_4.cpp b/snippets/cpp/VS_Snippets_Remoting/MimeContentBinding_Part_4/CPP/mimecontentbinding_part_4.cpp deleted file mode 100644 index 0623e5a713a..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/MimeContentBinding_Part_4/CPP/mimecontentbinding_part_4.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// System::Web::Services::Description.MimeContentBinding::Type -// System::Web::Services::Description.MimeContentBinding::Part -// System::Web::Services::Description.MimeContentBinding::NameSpace -// System::Web::Services::Description.MimeContentBinding - -/* The following program demonstrates the 'Type' and 'Part' properties -and the 'NameSpace' field of the 'MimeContentBinding' class. It reads the 'MimeContentSample_cs::wsdl' file -and instantiates a ServiceDescription Object*. 'MimeContentBinding' objects are retrieved from Extension -points of OutputBinding for one of the Binding Object* and its 'Type' and 'Part' properties are displayed. It also -displays 'NameSpace' of the 'MimeContentBinding' Object*. -*/ - -// -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Collections; - -int main() -{ - // - // - // - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MimeContentSample_cpp.wsdl" ); - - // Get the Binding. - Binding^ myBinding = myServiceDescription->Bindings[ "b1" ]; - - // Get the first OperationBinding. - OperationBinding^ myOperationBinding = myBinding->Operations[ 0 ]; - OutputBinding^ myOutputBinding = myOperationBinding->Output; - ServiceDescriptionFormatExtensionCollection ^ myServiceDescriptionFormatExtensionCollection = myOutputBinding->Extensions; - - // Find all MimeContentBinding objects in extensions. - array^myMimeContentBindings = (array^)myServiceDescriptionFormatExtensionCollection->FindAll( MimeContentBinding::typeid ); - - // Enumerate the array and display MimeContentBinding properties. - IEnumerator^ myEnum = myMimeContentBindings->GetEnumerator(); - while ( myEnum->MoveNext() ) - { - MimeContentBinding^ myMimeContentBinding = safe_cast(myEnum->Current); - Console::WriteLine( "Type: {0}", myMimeContentBinding->Type ); - Console::WriteLine( "Part: {0}", myMimeContentBinding->Part ); - } - // - // - Console::WriteLine( "Namespace: {0}", MimeContentBinding::Namespace ); - // -} -// diff --git a/snippets/cpp/VS_Snippets_Remoting/MimeMultiPartRelatedBinding_Parts_2/CPP/MimeMultiPartRelatedSample_cpp.wsdl b/snippets/cpp/VS_Snippets_Remoting/MimeMultiPartRelatedBinding_Parts_2/CPP/MimeMultiPartRelatedSample_cpp.wsdl deleted file mode 100644 index 4ad0d84133f..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/MimeMultiPartRelatedBinding_Parts_2/CPP/MimeMultiPartRelatedSample_cpp.wsdl +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/cpp/VS_Snippets_Remoting/MimeMultiPartRelatedBinding_Parts_2/CPP/mimemultipartrelatedbinding_parts_2.cpp b/snippets/cpp/VS_Snippets_Remoting/MimeMultiPartRelatedBinding_Parts_2/CPP/mimemultipartrelatedbinding_parts_2.cpp deleted file mode 100644 index f7387c482ad..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/MimeMultiPartRelatedBinding_Parts_2/CPP/mimemultipartrelatedbinding_parts_2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -// System::Web::Services::Description.MimeMultipartRelatedBinding -// System::Web::Services::Description.MimeMultipartRelatedBinding::Parts; - -/* The following program demonstrates the property 'Parts' of class 'MimeMultipartRelatedBinding'. -It reads 'MimeMultiPartRelatedSample_cpp.wsdl'file and instantiates a ServiceDescription Object*. -'MimeMultipartRelatedBinding' Object* is retrieved from Extension -points of OutputBinding for one of the Binding Object* and its property'Parts' has been demonstrated. -*/ - -// -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Collections; - -int main() -{ - // - ServiceDescription^ myServicDescription = ServiceDescription::Read( "MimeMultiPartRelatedSample_cpp.wsdl" ); - - // Get the binding collection. - BindingCollection^ myBindingCollection = myServicDescription->Bindings; - int index = 0; - for ( int i = 0; i < myBindingCollection->Count; i++ ) - // Get the collection for MimeServiceHttpPost. - if ( String::Compare( myBindingCollection[ i ]->Name, "MimeServiceHttpPost" ) == 0 ) - { - OperationBindingCollection^ myOperationBindingCollection = myBindingCollection[ i ]->Operations; - OutputBinding^ myOutputBinding = myOperationBindingCollection[ 0 ]->Output; - ServiceDescriptionFormatExtensionCollection ^ myServiceDescriptionFormatExtensionCollection = myOutputBinding->Extensions; - MimeMultipartRelatedBinding^ myMimeMultipartRelatedBinding = dynamic_cast(myServiceDescriptionFormatExtensionCollection->Find( MimeMultipartRelatedBinding::typeid )); - MimePartCollection^ myMimePartCollection = myMimeMultipartRelatedBinding->Parts; - IEnumerator^ myEnum = myMimePartCollection->GetEnumerator(); - while ( myEnum->MoveNext() ) - { - MimePart^ myMimePart = dynamic_cast(myEnum->Current); - Console::WriteLine( "Extension Types added to MimePart: {0}", index++ ); - Console::WriteLine( "----------------------------" ); - IEnumerator^ myEnum2 = myMimePart->Extensions->GetEnumerator(); - while ( myEnum2->MoveNext() ) - { - Console::WriteLine( myEnum2->Current->GetType() ); - } - - Console::WriteLine( "" ); - } - - break; - } - // -} -// diff --git a/snippets/cpp/VS_Snippets_Remoting/MimePartCollection_1/CPP/MimePartCollection_1_Input_cpp.wsdl b/snippets/cpp/VS_Snippets_Remoting/MimePartCollection_1/CPP/MimePartCollection_1_Input_cpp.wsdl deleted file mode 100644 index 745bfd01aee..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/MimePartCollection_1/CPP/MimePartCollection_1_Input_cpp.wsdl +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/cpp/VS_Snippets_Remoting/MimePartCollection_1/CPP/mimepartcollection_1.cpp b/snippets/cpp/VS_Snippets_Remoting/MimePartCollection_1/CPP/mimepartcollection_1.cpp deleted file mode 100644 index 5648074bf2a..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/MimePartCollection_1/CPP/mimepartcollection_1.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// System::Web::Services::Description.MimePartCollection - -/* The following program demostrates 'MimePartCollection' class. It -takes 'MimePartCollection_1_Input_cpp.wsdl' as input which -contains one 'MimePart' Object* that supports 'HttpPost'. -A mimepartcollection Object* is created and mimepart is added to the -mimepartcollection at the specified location, finally writes -into the file'MimePartCollection_1_Output_cpp.wsdl'. -*/ - -// -#using -#using -#using - -using namespace System; -using namespace System::Collections; -using namespace System::Xml; -using namespace System::Web::Services::Description; - -int main() -{ - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MimePartCollection_1_Input_cpp.wsdl" ); - ServiceDescriptionCollection^ myServiceDescriptionCol = gcnew ServiceDescriptionCollection; - myServiceDescriptionCol->Add( myServiceDescription ); - XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "MimeServiceHttpPost","http://tempuri.org/" ); - - // Create a 'Binding' object. - Binding^ myBinding = myServiceDescriptionCol->GetBinding( myXmlQualifiedName ); - OperationBinding^ myOperationBinding = nullptr; - for ( int i = 0; i < myBinding->Operations->Count; i++ ) - if ( myBinding->Operations[ i ]->Name->Equals( "AddNumbers" ) ) - myOperationBinding = myBinding->Operations[ i ]; - - OutputBinding^ myOutputBinding = myOperationBinding->Output; - MimeMultipartRelatedBinding^ myMimeMultipartRelatedBinding = nullptr; - IEnumerator^ myIEnumerator = myOutputBinding->Extensions->GetEnumerator(); - while ( myIEnumerator->MoveNext() ) - myMimeMultipartRelatedBinding = dynamic_cast(myIEnumerator->Current); - - // Create an instances of 'MimePartCollection'. - MimePartCollection^ myMimePartCollection = gcnew MimePartCollection; - myMimePartCollection = myMimeMultipartRelatedBinding->Parts; - Console::WriteLine( "Total number of mimepart elements initially is: {0}", myMimePartCollection->Count ); - - // Create an instance of 'MimePart'. - MimePart^ myMimePart = gcnew MimePart; - - // Create an instance of 'MimeXmlBinding'. - MimeXmlBinding^ myMimeXmlBinding = gcnew MimeXmlBinding; - myMimeXmlBinding->Part = "body"; - myMimePart->Extensions->Add( myMimeXmlBinding ); - - // Insert a mimepart at first position. - myMimePartCollection->Insert( 0, myMimePart ); - Console::WriteLine( "Inserting a mimepart object..." ); - if ( myMimePartCollection->Contains( myMimePart ) ) - { - Console::WriteLine( "'MimePart' is succesffully added at position: {0}", myMimePartCollection->IndexOf( myMimePart ) ); - Console::WriteLine( "Total number of mimepart elements after inserting is: {0}", myMimePartCollection->Count ); - } - - myServiceDescription->Write( "MimePartCollection_1_Output_cpp.wsdl" ); - Console::WriteLine( "MimePartCollection_1_Output_cpp.wsdl has been generated successfully." ); -} -// diff --git a/snippets/cpp/VS_Snippets_Remoting/MimePartCollection_8/CPP/mimepartcollection_8.cpp b/snippets/cpp/VS_Snippets_Remoting/MimePartCollection_8/CPP/mimepartcollection_8.cpp deleted file mode 100644 index dcd7449eeb1..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/MimePartCollection_8/CPP/mimepartcollection_8.cpp +++ /dev/null @@ -1,146 +0,0 @@ -// System::Web::Services::Description.MimePartCollection::MimePartCollection() -// System::Web::Services::Description.MimePartCollection::Item->Item[System::Int32 index] -// System::Web::Services::Description.MimePartCollection::Insert -// System::Web::Services::Description.MimePartCollection::IndexOf -// System::Web::Services::Description.MimePartCollection->Add -// System::Web::Services::Description.MimePartCollection::Contains -// System::Web::Services::Description.MimePartCollection::CopyTo -// System::Web::Services::Description.MimePartCollection::Remove - -/* This program demonstrates the constructor, the 'Item' property , the 'Insert', 'IndexOf', 'Add', -'Contains', 'CopyTo', and 'Remove' methods of the 'MimePartCollection' class. -It takes 'MimePartCollection_8_Input_cpp.wsdl' as an input file which contains -one 'MimePart' object that supports 'HttpPost'. A MimePartCollection object is -created and new MimePart objects are added to MimePartCollection using the 'Insert' -and 'Add' methods. A MimePart object is removed from the MimePartCollection using the -'Remove' method. The ServiceDescription is finally written into an output wsdl file -'MimePartCollection_8_out_CS::wsdl'. -*/ - -#using -#using -#using - -using namespace System; -using namespace System::Collections; -using namespace System::Xml; -using namespace System::Web::Services::Description; - -int main() -{ - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MimePartCollection_8_Input_cpp.wsdl" ); - ServiceDescriptionCollection^ myServiceDescriptionCol = gcnew ServiceDescriptionCollection; - myServiceDescriptionCol->Add( myServiceDescription ); - XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "MimeServiceHttpPost","http://tempuri.org/" ); - - // Create a binding object. - Binding^ myBinding = myServiceDescriptionCol->GetBinding( myXmlQualifiedName ); - OperationBinding^ myOperationBinding = nullptr; - for ( int i = 0; i < myBinding->Operations->Count; i++ ) - if ( myBinding->Operations[ i ]->Name->Equals( "AddNumbers" ) ) - myOperationBinding = myBinding->Operations[ i ]; - - OutputBinding^ myOutputBinding = myOperationBinding->Output; - - // - // - // - // - MimeMultipartRelatedBinding^ myMimeMultipartRelatedBinding = nullptr; - IEnumerator^ myIEnumerator = myOutputBinding->Extensions->GetEnumerator(); - while ( myIEnumerator->MoveNext() ) - myMimeMultipartRelatedBinding = (MimeMultipartRelatedBinding^)myIEnumerator->Current; - - // Create an instance of 'MimePartCollection'. - MimePartCollection^ myMimePartCollection = gcnew MimePartCollection; - myMimePartCollection = myMimeMultipartRelatedBinding->Parts; - Console::WriteLine( "Total number of mimepart elements in the collection initially is: {0}", myMimePartCollection->Count ); - - // Get the type of first 'Item' in collection. - Console::WriteLine( "The first object in collection is of type: {0}", myMimePartCollection[ 0 ] ); - MimePart^ myMimePart1 = gcnew MimePart; - - // Create an instance of 'MimeXmlBinding'. - MimeXmlBinding^ myMimeXmlBinding1 = gcnew MimeXmlBinding; - myMimeXmlBinding1->Part = "body"; - myMimePart1->Extensions->Add( myMimeXmlBinding1 ); - - // a mimepart at first position. - myMimePartCollection->Insert( 0, myMimePart1 ); - Console::WriteLine( "Inserting a mimepart object..." ); - - // Check whether 'Insert' was successful or not. - if ( myMimePartCollection->Contains( myMimePart1 ) ) - { - // Display the index of inserted 'MimePart'. - Console::WriteLine( "'MimePart' is successfully inserted at position: {0}", myMimePartCollection->IndexOf( myMimePart1 ) ); - } - // - // - // - // - - Console::WriteLine( "Total number of mimepart elements after inserting is: {0}", myMimePartCollection->Count ); - - // - // - MimePart^ myMimePart2 = gcnew MimePart; - MimeXmlBinding^ myMimeXmlBinding2 = gcnew MimeXmlBinding; - myMimeXmlBinding2->Part = "body"; - myMimePart2->Extensions->Add( myMimeXmlBinding2 ); - - // Add a mimepart to the mimepartcollection. - myMimePartCollection->Add( myMimePart2 ); - Console::WriteLine( "Adding a mimepart object..." ); - - // Check if collection contains added mimepart object. - if ( myMimePartCollection->Contains( myMimePart2 ) ) - Console::WriteLine( "'MimePart' is successfully added at position: {0}", myMimePartCollection->IndexOf( myMimePart2 ) ); - // - // - - Console::WriteLine( "Total number of mimepart elements after adding is: {0}", myMimePartCollection->Count ); - - // - array^myArray = gcnew array(myMimePartCollection->Count); - - // Copy the mimepartcollection to an array. - myMimePartCollection->CopyTo( myArray, 0 ); - Console::WriteLine( "Displaying the array copied from mimepartcollection" ); - for ( int j = 0; j < myMimePartCollection->Count; j++ ) - { - Console::WriteLine( "Mimepart object at position : {0}", j ); - for ( int i = 0; i < myArray[ j ]->Extensions->Count; i++ ) - { - MimeXmlBinding^ myMimeXmlBinding3 = (MimeXmlBinding^)(myArray[ j ]->Extensions[ i ]); - Console::WriteLine( "Part: {0}", (myMimeXmlBinding3->Part) ); - } - } - // - // - Console::WriteLine( "Removing a mimepart object..." ); - - // Remove the mimepart from the mimepartcollection. - myMimePartCollection->Remove( myMimePart1 ); - - // Check whether the mimepart is removed or not. - if ( !myMimePartCollection->Contains( myMimePart1 ) ) - Console::WriteLine( "Mimepart is successfully removed from mimepartcollection" ); - // - - Console::WriteLine( "Total number of elements in collection after removing is: {0}", myMimePartCollection->Count ); - array^myArray1 = gcnew array(myMimePartCollection->Count); - myMimePartCollection->CopyTo( myArray1, 0 ); - Console::WriteLine( "Dispalying the 'MimePartCollection' after removing" ); - for ( int j = 0; j < myMimePartCollection->Count; j++ ) - { - Console::WriteLine( "Mimepart object at position : {0}", j ); - for ( int i = 0; i < myArray1[ j ]->Extensions->Count; i++ ) - { - MimeXmlBinding^ myMimeXmlBinding3 = (MimeXmlBinding^)(myArray1[ j ]->Extensions[ i ]); - Console::WriteLine( "part: {0}", (myMimeXmlBinding3->Part) ); - } - } - myServiceDescription->Write( "MimePartCollection_8_output.wsdl" ); - Console::WriteLine( "MimePartCollection_8_output.wsdl has been generated successfully." ); -} diff --git a/snippets/cpp/VS_Snippets_Remoting/MimePart_3/CPP/MimePart_3_Input_cpp.wsdl b/snippets/cpp/VS_Snippets_Remoting/MimePart_3/CPP/MimePart_3_Input_cpp.wsdl deleted file mode 100644 index 64548b47a64..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/MimePart_3/CPP/MimePart_3_Input_cpp.wsdl +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/cpp/VS_Snippets_Remoting/MimePart_3/CPP/mimepart_3.cpp b/snippets/cpp/VS_Snippets_Remoting/MimePart_3/CPP/mimepart_3.cpp deleted file mode 100644 index 78518047dc2..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/MimePart_3/CPP/mimepart_3.cpp +++ /dev/null @@ -1,60 +0,0 @@ - - -// System.Web.Services.Description.MimePart -// System.Web.Services.Description.MimePart.ctor() -// System.Web.Services.Description.MimePart.Extensions -/* The following program demonstrates the 'MimePart' class, constructor -and 'Extensions' property of 'MimePart' class. It reads -'MimePart_3_Input_cpp.wsdl' file which does not have 'MimePart' object -supporting 'OutPut' of 'HttpPost'. It adds the 'MimePart' and finally -writes into 'MimePart_3_OutPut_cpp.wsdl' file. -*/ -// -#using -#using -#using - -using namespace System; -using namespace System::Xml; -using namespace System::Web::Services::Description; - -int main() -{ - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MimePart_3_Input_cpp.wsdl" ); - ServiceDescriptionCollection^ myServiceDescriptionCol = gcnew ServiceDescriptionCollection; - myServiceDescriptionCol->Add( myServiceDescription ); - XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "MimeServiceHttpPost","http://tempuri.org/" ); - - // Create the Binding. - Binding^ myBinding = myServiceDescriptionCol->GetBinding( myXmlQualifiedName ); - OperationBinding^ myOperationBinding = nullptr; - for ( int i = 0; i < myBinding->Operations->Count; i++ ) - { - if ( myBinding->Operations[ i ]->Name->Equals( "AddNumbers" ) ) - { - myOperationBinding = myBinding->Operations[ i ]; - } - } - - // - // - // Create the OutputBinding. - OutputBinding^ myOutputBinding = myOperationBinding->Output; - MimeXmlBinding^ myMimeXmlBinding = gcnew MimeXmlBinding; - myMimeXmlBinding->Part = "body"; - - // Create the MimePart. - MimePart^ myMimePart = gcnew MimePart; - myMimePart->Extensions->Add( myMimeXmlBinding ); - MimeMultipartRelatedBinding^ myMimePartRelatedBinding = gcnew MimeMultipartRelatedBinding; - - // Add the MimePart to the MimePartRelatedBinding. - myMimePartRelatedBinding->Parts->Add( myMimePart ); - myOutputBinding->Extensions->Add( myMimePartRelatedBinding ); - // - // - - myServiceDescription->Write( "MimePart_3_Output_CPP.wsdl" ); - Console::WriteLine( "MimePart_3_Output_CPP.wsdl has been generated successfully." ); -} -// diff --git a/snippets/cpp/VS_Snippets_Remoting/MimeTextMatch_5/CPP/MimeTextMatch_5_Input_CPP.wsdl b/snippets/cpp/VS_Snippets_Remoting/MimeTextMatch_5/CPP/MimeTextMatch_5_Input_CPP.wsdl deleted file mode 100644 index b0b37666a68..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/MimeTextMatch_5/CPP/MimeTextMatch_5_Input_CPP.wsdl +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/cpp/VS_Snippets_Remoting/MimeTextMatch_5/CPP/mimetextmatch_5.cpp b/snippets/cpp/VS_Snippets_Remoting/MimeTextMatch_5/CPP/mimetextmatch_5.cpp deleted file mode 100644 index a1904f5cf88..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/MimeTextMatch_5/CPP/mimetextmatch_5.cpp +++ /dev/null @@ -1,138 +0,0 @@ - - -// System.Web.Services.Description.MimeTextMatch -// System.Web.Services.Description.MimeTextMatch.Capture -// System.Web.Services.Description.MimeTextMatch.Group -// System.Web.Services.Description.MimeTextMatch.Repeats -// System.Web.Services.Description.MimeTextMatch.RepeatsString -/* The following program demostrates constructor, 'Capture', 'Group', - 'Repeats' and 'RepeatsString' properties of 'MimeTextMatch'class. - It takes 'MimeTextMatch_5_Input_CPP.wsdl' as input which does not - contain 'Binding' object supporting 'HttpPost'. A text pattern - ''TITLE>(.*?)<' with text name as 'Title' and type - name set which is to be searched in a HTTP transmission is added to the ServiceDescription. - The modified ServiceDescription is written into 'MimeTextMatch_5_Output_CPP.wsdl'. -*/ -// -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Collections; -using namespace System::Xml; - -int main() -{ - try - { - int myInt = 0; - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MimeTextMatch_5_Input_CPP.wsdl" ); - - // Create the 'Binding' object. - Binding^ myBinding = gcnew Binding; - - // Initialize 'Name' property of 'Binding' class. - myBinding->Name = "MimeTextMatchServiceHttpPost"; - XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "s0:MimeTextMatchServiceHttpPost" ); - myBinding->Type = myXmlQualifiedName; - - // Create the 'HttpBinding' object. - HttpBinding^ myHttpBinding = gcnew HttpBinding; - myHttpBinding->Verb = "POST"; - - // Add the 'HttpBinding' to the 'Binding'. - myBinding->Extensions->Add( myHttpBinding ); - - // Create the 'OperationBinding' object. - OperationBinding^ myOperationBinding = gcnew OperationBinding; - myOperationBinding->Name = "AddNumbers"; - HttpOperationBinding^ myHttpOperationBinding = gcnew HttpOperationBinding; - myHttpOperationBinding->Location = "/AddNumbers"; - - // Add the 'HttpOperationBinding' object to 'OperationBinding'. - myOperationBinding->Extensions->Add( myHttpOperationBinding ); - - // - // - // - // - // Create an InputBinding. - InputBinding^ myInputBinding = gcnew InputBinding; - MimeTextBinding^ myMimeTextBinding = gcnew MimeTextBinding; - MimeTextMatchCollection^ myMimeTextMatchCollection1 = gcnew MimeTextMatchCollection; - array^myMimeTextMatch = gcnew array(3); - myMimeTextMatchCollection1 = myMimeTextBinding->Matches; - - // Intialize the MimeTextMatch. - for ( myInt = 0; myInt < 3; myInt++ ) - { - // Get a new MimeTextMatch. - myMimeTextMatch[ myInt ] = gcnew MimeTextMatch; - - // Assign values to properties of the MimeTextMatch. - myMimeTextMatch[ myInt ]->Name = String::Format( "Title{0}", Convert::ToString( myInt ) ); - myMimeTextMatch[ myInt ]->Type = "*/*"; - myMimeTextMatch[ myInt ]->Pattern = "TITLE>(.*?)<"; - myMimeTextMatch[ myInt ]->IgnoreCase = true; - myMimeTextMatch[ myInt ]->Capture = 2; - myMimeTextMatch[ myInt ]->Group = 2; - if ( myInt != 0 ) - { - - // Assign the Repeats property if the index is not 0. - myMimeTextMatch[ myInt ]->Repeats = 2; - } - else - { - - // Assign the RepeatsString property if the index is 0. - myMimeTextMatch[ myInt ]->RepeatsString = "4"; - } - myMimeTextMatchCollection1->Add( myMimeTextMatch[ myInt ] ); - - } - // - // - // - // - - myInputBinding->Extensions->Add( myMimeTextBinding ); - - // Add the 'InputBinding' to 'OperationBinding'. - myOperationBinding->Input = myInputBinding; - - // Create the 'OutputBinding' instance. - OutputBinding^ myOutput = gcnew OutputBinding; - MimeXmlBinding^ postMimeXmlbinding = gcnew MimeXmlBinding; - - // Initialize 'Part' property of 'MimeXmlBinding' class. - postMimeXmlbinding->Part = "Body"; - - // Add 'MimeXmlBinding' instance to 'OutputBinding' instance. - myOutput->Extensions->Add( postMimeXmlbinding ); - - // Add the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding->Output = myOutput; - - // Add the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding->Output = myOutput; - - // Add the 'OperationBinding' to 'Binding'. - myBinding->Operations->Add( myOperationBinding ); - - // Add the 'Binding' to 'BindingCollection' of 'ServiceDescription'. - myServiceDescription->Bindings->Add( myBinding ); - - // Write the 'ServiceDescription' as a WSDL file. - myServiceDescription->Write( "MimeTextMatch_5_Output_CPP.wsdl" ); - Console::WriteLine( "WSDL file with name 'MimeTextMatch_5_Output_CPP.wsdl' is" - " created successfully." ); - } - catch ( Exception^ e ) - { - Console::WriteLine( "Exception: {0}", e->Message ); - } -} -// diff --git a/snippets/cpp/VS_Snippets_Remoting/MimeText_Binding_Match_8/CPP/MimeText_Binding_Match_8_Input_CPP.wsdl b/snippets/cpp/VS_Snippets_Remoting/MimeText_Binding_Match_8/CPP/MimeText_Binding_Match_8_Input_CPP.wsdl deleted file mode 100644 index 521d34c6e62..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/MimeText_Binding_Match_8/CPP/MimeText_Binding_Match_8_Input_CPP.wsdl +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/cpp/VS_Snippets_Remoting/MimeText_Binding_Match_8/CPP/mimetext_binding_match_8.cpp b/snippets/cpp/VS_Snippets_Remoting/MimeText_Binding_Match_8/CPP/mimetext_binding_match_8.cpp deleted file mode 100644 index 495d3ca8b82..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/MimeText_Binding_Match_8/CPP/mimetext_binding_match_8.cpp +++ /dev/null @@ -1,128 +0,0 @@ - - -// System.Web.Services.Description.MimeTextBinding -// System.Web.Services.Description.MimeTextBinding() -// System.Web.Services.Description.MimeTextMatch() -// System.Web.Services.Description.MimeTextMatch.Name -// System.Web.Services.Description.MimeTextMatch.Type -// System.Web.Services.Description.MimeTextMatch.Pattern -// System.Web.Services.Description.MimeTextMatch.IgnoreCase -// System.Web.Services.Description.MimeTextBinding.Matches -/* This program demostrates constructor and 'Matches' property -of 'MimeTextBinding' class and 'Name', 'Type', 'Pattern', -'IgnoreCase' properties of 'MimeTextMatch' class. -It takes 'MimeText_Binding_Match_8_Input_CPP.wsdl' as an -input file which does not contain 'Binding' object that supports -'HttpPost'. A text pattern ''TITLE>(.*?)<' with text name -as 'Title' and with type name set, is added to the wsdl file. Finally the -' modified ServiceDescription is written to 'MimeText_Binding_Match_8_Output_CPP.wsdl'. -*/ -// -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Collections; -using namespace System::Xml; - -int main() -{ - try - { - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MimeText_Binding_Match_8_Input_CPP.wsdl" ); - - // Create a Binding. - Binding^ myBinding = gcnew Binding; - - // Initialize the Name property of the Binding. - myBinding->Name = "MimeText_Binding_MatchServiceHttpPost"; - XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "s0:MimeText_Binding_MatchServiceHttpPost" ); - myBinding->Type = myXmlQualifiedName; - - // Create an HttpBinding. - HttpBinding^ myHttpBinding = gcnew HttpBinding; - myHttpBinding->Verb = "POST"; - - // Add the HttpBinding to the Binding. - myBinding->Extensions->Add( myHttpBinding ); - - // Create an OperationBinding. - OperationBinding^ myOperationBinding = gcnew OperationBinding; - myOperationBinding->Name = "AddNumbers"; - HttpOperationBinding^ myHttpOperationBinding = gcnew HttpOperationBinding; - myHttpOperationBinding->Location = "/AddNumbers"; - - // Add the HttpOperationBinding to the OperationBinding. - myOperationBinding->Extensions->Add( myHttpOperationBinding ); - - // Create an InputBinding. - InputBinding^ myInputBinding = gcnew InputBinding; - MimeContentBinding^ postMimeContentbinding = gcnew MimeContentBinding; - postMimeContentbinding->Type = "application/x-www-form-urlencoded"; - myInputBinding->Extensions->Add( postMimeContentbinding ); - - // Add the InputBinding to the OperationBinding. - myOperationBinding->Input = myInputBinding; - - // - // - // - // - // - // - // - // Create an OutputBinding. - OutputBinding^ myOutputBinding = gcnew OutputBinding; - - // Create a MimeTextBinding. - MimeTextBinding^ myMimeTextBinding = gcnew MimeTextBinding; - - // Create a MimeTextMatch. - MimeTextMatch^ myMimeTextMatch = gcnew MimeTextMatch; - MimeTextMatchCollection^ myMimeTextMatchCollection; - - // Initialize properties of the MimeTextMatch. - myMimeTextMatch->Name = "Title"; - myMimeTextMatch->Type = "*/*"; - myMimeTextMatch->Pattern = "'TITLE>(.*?)<"; - myMimeTextMatch->IgnoreCase = true; - - // Initialize a MimeTextMatchCollection. - myMimeTextMatchCollection = myMimeTextBinding->Matches; - - // Add the MimeTextMatch to the MimeTextMatchCollection. - myMimeTextMatchCollection->Add( myMimeTextMatch ); - myOutputBinding->Extensions->Add( myMimeTextBinding ); - - // Add the OutputBinding to the OperationBinding. - myOperationBinding->Output = myOutputBinding; - // - // - // - // - // - // - // - - // Add the OutputBinding to the OperationBinding. - myOperationBinding->Output = myOutputBinding; - - // Add the OperationBinding to the Binding. - myBinding->Operations->Add( myOperationBinding ); - - // Add the Binding to the BindingCollection of the ServiceDescription. - myServiceDescription->Bindings->Add( myBinding ); - - // Write the ServiceDescription as a WSDL file. - myServiceDescription->Write( "MimeText_Binding_Match_8_Output_CPP.wsdl" ); - Console::WriteLine( "WSDL file named 'MimeText_Binding_Match_8_Output_CPP.wsdl' was" - " created successfully." ); - } - catch ( Exception^ e ) - { - Console::WriteLine( "Exception: {0}", e->Message ); - } -} -// diff --git a/snippets/cpp/VS_Snippets_Remoting/MimeText_Match_MatchColl_9/CPP/MimeText_Match_MatchColl_9_Input_CPP.wsdl b/snippets/cpp/VS_Snippets_Remoting/MimeText_Match_MatchColl_9/CPP/MimeText_Match_MatchColl_9_Input_CPP.wsdl deleted file mode 100644 index f547e501386..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/MimeText_Match_MatchColl_9/CPP/MimeText_Match_MatchColl_9_Input_CPP.wsdl +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/cpp/VS_Snippets_Remoting/MimeText_Match_MatchColl_9/CPP/mimetext_match_matchcoll_9.cpp b/snippets/cpp/VS_Snippets_Remoting/MimeText_Match_MatchColl_9/CPP/mimetext_match_matchcoll_9.cpp deleted file mode 100644 index c488a6fea49..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/MimeText_Match_MatchColl_9/CPP/mimetext_match_matchcoll_9.cpp +++ /dev/null @@ -1,180 +0,0 @@ -// System.Web.Services.Description.MimeTextMatchCollection -// System.Web.Services.Description.MimeTextMatchCollection() -// System.Web.Services.Description.MimeTextMatchCollection.Contains -// System.Web.Services.Description.MimeTextMatchCollection.Add -// System.Web.Services.Description.MimeTextMatchCollection.CopyTo -// System.Web.Services.Description.MimeTextMatchCollection.Remove -// System.Web.Services.Description.MimeTextMatchCollection.Item -// System.Web.Services.Description.MimeTextMatchCollection.IndexOf -// System.Web.Services.Description.MimeTextMatchCollection.Insert - -/* This program demostrates constructor, Contains, Add, Item, - IndexOf, Insert and Remove property of 'MimeTextMatchCollection'. - This program takes 'MimeText_Match_MatchColl_9_Input_CPP.wsdl' as an - input file which does not contain 'Binding' object that supports - 'HttpPost'. A name, type, Group and Capture properties are set - which are to be searched in a HTTP transmission and - 'MimeTextMatchCollection' collection object is created - for input and output of 'HttpPost' and finally writes into - 'MimeText_Match_MatchColl_9_Output_CPP.wsdl'. -*/ - -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Collections; -using namespace System::Xml; - -int main() -{ - try - { - int myInt = 0; - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MimeText_Match_MatchColl_9_Input_CPP.wsdl" ); - - // Create the 'Binding' object. - Binding^ myBinding = gcnew Binding; - - // Initialize 'Name' property of 'Binding' class. - myBinding->Name = "MimeText_Match_MatchCollServiceHttpPost"; - XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "s0:MimeText_Match_MatchCollServiceHttpPost" ); - myBinding->Type = myXmlQualifiedName; - - // Create the 'HttpBinding' object. - HttpBinding^ myHttpBinding = gcnew HttpBinding; - myHttpBinding->Verb = "POST"; - - // Add the 'HttpBinding' to the 'Binding'. - myBinding->Extensions->Add( myHttpBinding ); - - // Create the 'OperationBinding' object. - OperationBinding^ myOperationBinding = gcnew OperationBinding; - myOperationBinding->Name = "AddNumbers"; - HttpOperationBinding^ myHttpOperationBinding = gcnew HttpOperationBinding; - myHttpOperationBinding->Location = "/AddNumbers"; - - // Add the 'HttpOperationBinding' to 'OperationBinding'. - myOperationBinding->Extensions->Add( myHttpOperationBinding ); - - // - // Create the 'InputBinding' object. - InputBinding^ myInputBinding = gcnew InputBinding; - MimeTextBinding^ myMimeTextBinding = gcnew MimeTextBinding; - MimeTextMatchCollection^ myMimeTextMatchCollection; - - // - // - // - // Get an array instance of 'MimeTextMatch' class. - array^myMimeTextMatch = gcnew array(4); - myMimeTextMatchCollection = myMimeTextBinding->Matches; - - // Initialize properties of 'MimeTextMatch' class. - for ( myInt = 0; myInt < 4; myInt++ ) - { - // Create the 'MimeTextMatch' instance. - myMimeTextMatch[ myInt ] = gcnew MimeTextMatch; - myMimeTextMatch[ myInt ]->Name = "Title"; - myMimeTextMatch[ myInt ]->Type = "*/*"; - myMimeTextMatch[ myInt ]->IgnoreCase = true; - if ( true == myMimeTextMatchCollection->Contains( myMimeTextMatch[ 0 ] ) ) - { - myMimeTextMatch[ myInt ]->Name = String::Format( "Title{0}", Convert::ToString( myInt ) ); - myMimeTextMatch[ myInt ]->Capture = 2; - myMimeTextMatch[ myInt ]->Group = 2; - myMimeTextMatchCollection->Add( myMimeTextMatch[ myInt ] ); - } - else - { - myMimeTextMatchCollection->Add( myMimeTextMatch[ myInt ] ); - myMimeTextMatchCollection[ myInt ]->RepeatsString = "2"; - } - } - myMimeTextMatchCollection = myMimeTextBinding->Matches; - - // Copy collection to 'MimeTextMatch' array instance. - myMimeTextMatchCollection->CopyTo( myMimeTextMatch, 0 ); - // - // - // - - myInputBinding->Extensions->Add( myMimeTextBinding ); - - // Add the 'InputBinding' to 'OperationBinding'. - myOperationBinding->Input = myInputBinding; - - // Create the 'OutputBinding' instance. - OutputBinding^ myOutputBinding = gcnew OutputBinding; - - // Create the 'MimeTextBinding' instance. - MimeTextBinding^ myMimeTextBinding1 = gcnew MimeTextBinding; - - // - // - // - // - // - // Get an instance of 'MimeTextMatchCollection'. - MimeTextMatchCollection^ myMimeTextMatchCollection1 = gcnew MimeTextMatchCollection; - array^myMimeTextMatch1 = gcnew array(5); - myMimeTextMatchCollection1 = myMimeTextBinding1->Matches; - for ( myInt = 0; myInt < 4; myInt++ ) - { - myMimeTextMatch1[ myInt ] = gcnew MimeTextMatch; - myMimeTextMatch1[ myInt ]->Name = String::Format( "Title{0}", Convert::ToString( myInt ) ); - if ( myInt != 0 ) - { - myMimeTextMatch1[ myInt ]->RepeatsString = "7"; - } - myMimeTextMatchCollection1->Add( myMimeTextMatch1[ myInt ] ); - } - myMimeTextMatch1[ 4 ] = gcnew MimeTextMatch; - - // Remove 'MimeTextMatch' instance from collection. - myMimeTextMatchCollection1->Remove( myMimeTextMatch1[ 1 ] ); - - // Using MimeTextMatchCollection.Item indexer to comapre. - if ( myMimeTextMatch1[ 2 ] == myMimeTextMatchCollection1[ 1 ] ) - { - // Check whether 'MimeTextMatch' instance exists. - myInt = myMimeTextMatchCollection1->IndexOf( myMimeTextMatch1[ 2 ] ); - - // Insert 'MimeTextMatch' instance at a desired position. - myMimeTextMatchCollection1->Insert( 1, myMimeTextMatch1[ myInt ] ); - myMimeTextMatchCollection1[ 1 ]->RepeatsString = "5"; - myMimeTextMatchCollection1->Insert( 4, myMimeTextMatch1[ myInt ] ); - } - // - // - // - // - // - // - - myOutputBinding->Extensions->Add( myMimeTextBinding1 ); - - // Add the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding->Output = myOutputBinding; - - // Add the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding->Output = myOutputBinding; - - // Add the 'OperationBinding' to 'Binding'. - myBinding->Operations->Add( myOperationBinding ); - - // Add the 'Binding' to 'BindingCollection' of 'ServiceDescription'. - myServiceDescription->Bindings->Add( myBinding ); - - // Write the 'ServiceDescription' as a WSDL file. - myServiceDescription->Write( "MimeText_Match_MatchColl_9_Output_CPP.wsdl" ); - Console::WriteLine( "WSDL file with name 'MimeText_Match_MatchColl_9_Output_CPP.wsdl' is" - " created successfully." ); - } - catch ( Exception^ e ) - { - Console::WriteLine( "Exception: {0}", e->Message ); - } -} diff --git a/snippets/cpp/VS_Snippets_Remoting/MimeXmlBinding_Part_3/CPP/MimeXmlBinding_Part_3_Input_CPP.wsdl b/snippets/cpp/VS_Snippets_Remoting/MimeXmlBinding_Part_3/CPP/MimeXmlBinding_Part_3_Input_CPP.wsdl deleted file mode 100644 index 6f44c8aff5f..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/MimeXmlBinding_Part_3/CPP/MimeXmlBinding_Part_3_Input_CPP.wsdl +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/cpp/VS_Snippets_Remoting/MimeXmlBinding_Part_3/CPP/mimexmlbinding_part_3.cpp b/snippets/cpp/VS_Snippets_Remoting/MimeXmlBinding_Part_3/CPP/mimexmlbinding_part_3.cpp deleted file mode 100644 index 0cb0a7cb654..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/MimeXmlBinding_Part_3/CPP/mimexmlbinding_part_3.cpp +++ /dev/null @@ -1,93 +0,0 @@ - - -// System.Web.Services.Description.MimeXmlBinding -// System.Web.Services.Description.MimeXmlBinding.MimeXmlBinding() -// System.Web.Services.Description.MimeXmlBinding.Part -/* The following program demonstrates constructor and 'Part'property -of 'MimeXmlBinding' class. This program takes 'MimeXmlBinding_Part_3_Input_CPP.wsdl' -as input, which does not contain 'Binding' object that supports 'HttpPost'. -It sets message part property to 'Body' on which 'MimeXmlBinding' is -applied and finally writes into 'MimeXmlBinding_Part_3_Output_CPP.wsdl'. -*/ -// -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Collections; -using namespace System::Xml; -int main() -{ - try - { - ServiceDescription^ myDescription = ServiceDescription::Read( "MimeXmlBinding_Part_3_Input_CPP.wsdl" ); - - // Create the 'Binding' object. - Binding^ myBinding = gcnew Binding; - - // Initialize 'Name' property of 'Binding' class. - myBinding->Name = "MimeXmlBinding_Part_3_ServiceHttpPost"; - XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "s0:MimeXmlBinding_Part_3_ServiceHttpPost" ); - myBinding->Type = myXmlQualifiedName; - - // Create the 'HttpBinding' object. - HttpBinding^ myHttpBinding = gcnew HttpBinding; - myHttpBinding->Verb = "POST"; - - // Add the 'HttpBinding' to the 'Binding'. - myBinding->Extensions->Add( myHttpBinding ); - - // Create the 'OperationBinding' object. - OperationBinding^ myOperationBinding = gcnew OperationBinding; - myOperationBinding->Name = "AddNumbers"; - HttpOperationBinding^ myHttpOperationBinding = gcnew HttpOperationBinding; - myHttpOperationBinding->Location = "/AddNumbers"; - - // Add the 'HttpOperationBinding' to 'OperationBinding'. - myOperationBinding->Extensions->Add( myHttpOperationBinding ); - - // Create the 'InputBinding' object. - InputBinding^ myInputBinding = gcnew InputBinding; - MimeContentBinding^ myMimeContentBinding = gcnew MimeContentBinding; - myMimeContentBinding->Type = "application/x-www-form-urlencoded"; - myInputBinding->Extensions->Add( myMimeContentBinding ); - - // Add the 'InputBinding' to 'OperationBinding'. - myOperationBinding->Input = myInputBinding; - - // - // - // Create an OutputBinding. - OutputBinding^ myOutputBinding = gcnew OutputBinding; - MimeXmlBinding^ myMimeXmlBinding = gcnew MimeXmlBinding; - - // Initialize the Part property of the MimeXmlBinding. - myMimeXmlBinding->Part = "Body"; - - // Add the MimeXmlBinding to the OutputBinding. - myOutputBinding->Extensions->Add( myMimeXmlBinding ); - // - // - - // Add the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding->Output = myOutputBinding; - - // Add the 'OperationBinding' to 'Binding'. - myBinding->Operations->Add( myOperationBinding ); - - // Add the 'Binding' to 'BindingCollection' of 'ServiceDescription'. - myDescription->Bindings->Add( myBinding ); - - // Write the 'ServiceDescription' as a WSDL file. - myDescription->Write( "MimeXmlBinding_Part_3_Output_CPP.wsdl" ); - Console::WriteLine( "WSDL file with name 'MimeXmlBinding_Part_3_Output_CPP.wsdl' is" - " created successfully." ); - } - catch ( Exception^ e ) - { - Console::WriteLine( "Exception: {0}", e->Message ); - } -} -// diff --git a/snippets/cpp/VS_Snippets_Remoting/OperationBindingCollection_OperationBindingCollection/CPP/MathService_input_cpp.wsdl b/snippets/cpp/VS_Snippets_Remoting/OperationBindingCollection_OperationBindingCollection/CPP/MathService_input_cpp.wsdl deleted file mode 100644 index fa9de60ff9a..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/OperationBindingCollection_OperationBindingCollection/CPP/MathService_input_cpp.wsdl +++ /dev/null @@ -1,312 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/cpp/VS_Snippets_Remoting/OperationBindingCollection_OperationBindingCollection/CPP/operationbindingcollection_operationbindingcollection.cpp b/snippets/cpp/VS_Snippets_Remoting/OperationBindingCollection_OperationBindingCollection/CPP/operationbindingcollection_operationbindingcollection.cpp deleted file mode 100644 index 73662f4cd66..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/OperationBindingCollection_OperationBindingCollection/CPP/operationbindingcollection_operationbindingcollection.cpp +++ /dev/null @@ -1,134 +0,0 @@ -// System.Web.Services.Description.OperationBindingCollection -// System.Web.Services.Description.OperationBindingCollection.Contains -// System.Web.Services.Description.OperationBindingCollection.Add -// System.Web.Services.Description.OperationBindingCollection.Item -// System.Web.Services.Description.OperationBindingCollection.Remove -// System.Web.Services.Description.OperationBindingCollection.Insert -// System.Web.Services.Description.OperationBindingCollection.IndexOf -// System.Web.Services.Description.OperationBindingCollection.CopyTo - -/* -The following example demonstrates the usage of the -'OperationBindingCollection' class, the 'Item' property and various methods of the -class. The input to the program is a WSDL file 'MathService_input_cpp.wsdl' without -the add operation binding of SOAP protocol. In this example the WSDL file -is modified to insert a new 'OperationBinding' for SOAP. The -'OperationBindingCollection' is populated based on WSDL document -structure defined in WSDL specification. The updated instance is then -written to 'MathService_new_cpp.wsdl'. -*/ - -// -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -int main() -{ - try - { - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MathService_input_cpp.wsdl" ); - - // Add the OperationBinding for the Add operation. - OperationBinding^ addOperationBinding = gcnew OperationBinding; - String^ addOperation = "Add"; - String^ myTargetNamespace = myServiceDescription->TargetNamespace; - addOperationBinding->Name = addOperation; - - // Add the InputBinding for the operation. - InputBinding^ myInputBinding = gcnew InputBinding; - SoapBodyBinding^ mySoapBodyBinding = gcnew SoapBodyBinding; - mySoapBodyBinding->Use = SoapBindingUse::Literal; - myInputBinding->Extensions->Add( mySoapBodyBinding ); - addOperationBinding->Input = myInputBinding; - - // Add the OutputBinding for the operation. - OutputBinding^ myOutputBinding = gcnew OutputBinding; - myOutputBinding->Extensions->Add( mySoapBodyBinding ); - addOperationBinding->Output = myOutputBinding; - - // Add the extensibility element for the SoapOperationBinding. - SoapOperationBinding^ mySoapOperationBinding = gcnew SoapOperationBinding; - mySoapOperationBinding->Style = SoapBindingStyle::Document; - mySoapOperationBinding->SoapAction = String::Concat( myTargetNamespace, addOperation ); - addOperationBinding->Extensions->Add( mySoapOperationBinding ); - - // Get the BindingCollection from the ServiceDescription. - BindingCollection^ myBindingCollection = myServiceDescription->Bindings; - - // Get the OperationBindingCollection of SOAP binding from - // the BindingCollection. - OperationBindingCollection^ myOperationBindingCollection = myBindingCollection[ 0 ]->Operations; - - // - // Check for the Add OperationBinding in the collection. - bool contains = myOperationBindingCollection->Contains( addOperationBinding ); - Console::WriteLine( "\nWhether the collection contains the Add OperationBinding : {0}", contains ); - // - - // - // Add the Add OperationBinding to the collection. - myOperationBindingCollection->Add( addOperationBinding ); - Console::WriteLine( "\nAdded the OperationBinding of the Add" - " operation to the collection." ); - // - - // - // - // Get the OperationBinding of the Add operation from the collection. - OperationBinding^ myOperationBinding = myOperationBindingCollection[ 3 ]; - - // Remove the OperationBinding of the Add operation from - // the collection. - myOperationBindingCollection->Remove( myOperationBinding ); - Console::WriteLine( "\nRemoved the OperationBinding of the " - "Add operation from the collection." ); - // - // - - // - // - // Insert the OperationBinding of the Add operation at index 0. - myOperationBindingCollection->Insert( 0, addOperationBinding ); - Console::WriteLine( "\nInserted the OperationBinding of the " - "Add operation in the collection." ); - - // Get the index of the OperationBinding of the Add - // operation from the collection. - int index = myOperationBindingCollection->IndexOf( addOperationBinding ); - Console::WriteLine( "\nThe index of the OperationBinding of the Add operation : {0}", index ); - // - // - - Console::WriteLine( "" ); - - // - array^operationBindingArray = - gcnew array(myOperationBindingCollection->Count); - - // Copy this collection to the OperationBinding array. - myOperationBindingCollection->CopyTo( operationBindingArray, 0 ); - Console::WriteLine( "The operations supported by this service " - "are :" ); - - for each(OperationBinding^ myOperationBinding1 in operationBindingArray) - { - Binding^ myBinding = myOperationBinding1->Binding; - Console::WriteLine(" Binding : "+ myBinding->Name + " Name of " + - "operation : " + myOperationBinding1->Name); - } - // - - // Save the ServiceDescription to an external file. - myServiceDescription->Write( "MathService_new_cpp.wsdl" ); - } - catch ( Exception^ e ) - { - Console::WriteLine( "Exception caught!!!" ); - Console::WriteLine( "Source : {0}", e->Source ); - Console::WriteLine( "Message : {0}", e->Message ); - } -} -// diff --git a/snippets/cpp/VS_Snippets_Remoting/OperationBinding_OperationBinding/CPP/operationbinding_operationbinding.cpp b/snippets/cpp/VS_Snippets_Remoting/OperationBinding_OperationBinding/CPP/operationbinding_operationbinding.cpp deleted file mode 100644 index 275e1d9fc9a..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/OperationBinding_OperationBinding/CPP/operationbinding_operationbinding.cpp +++ /dev/null @@ -1,127 +0,0 @@ -// System.Web.Services.Description.OperationBinding -// System.Web.Services.Description.OperationBinding.OperationBinding -// System.Web.Services.Description.OperationBinding.Name -// System.Web.Services.Description.OperationBinding.Input -// System.Web.Services.Description.OperationBinding.Output -// System.Web.Services.Description.OperationBinding.Extensions -// System.Web.Services.Description.OperationBinding.Faults -// System.Web.Services.Description.OperationBinding.Binding - -/* -The following example demonstrates the usage of the 'OperationBinding' -class, the 'OperationBinding()' constructor, and various properties of the class. The -input to the program is a WSDL file 'MathService_input_cs.wsdl' without the -add operation binding for SOAP protocol. In the example, the WSDL file is modified to insert -a new 'OperationBinding' instance for SOAP. The 'OperationBinding' instance -is populated based on the WSDL document structure defined in the WSDL specification. The updated -instance is then written to 'MathService_new_cs.wsdl'. -*/ - -// -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; - -int main() -{ - try - { - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MathService_input_cs.wsdl" ); - String^ myTargetNamespace = myServiceDescription->TargetNamespace; - - // - // - // Create an OperationBinding for the Add operation. - OperationBinding^ addOperationBinding = gcnew OperationBinding; - String^ addOperation = "Add"; - addOperationBinding->Name = addOperation; - // - - // - // Create an InputBinding for the Add operation. - InputBinding^ myInputBinding = gcnew InputBinding; - SoapBodyBinding^ mySoapBodyBinding = gcnew SoapBodyBinding; - mySoapBodyBinding->Use = SoapBindingUse::Literal; - myInputBinding->Extensions->Add( mySoapBodyBinding ); - - // Add the InputBinding to the OperationBinding. - addOperationBinding->Input = myInputBinding; - // - - // - // Create an OutputBinding for the Add operation. - OutputBinding^ myOutputBinding = gcnew OutputBinding; - myOutputBinding->Extensions->Add( mySoapBodyBinding ); - - // Add the OutputBinding to the OperationBinding. - addOperationBinding->Output = myOutputBinding; - // - - // - // Create an extensibility element for a SoapOperationBinding. - SoapOperationBinding^ mySoapOperationBinding = gcnew SoapOperationBinding; - mySoapOperationBinding->Style = SoapBindingStyle::Document; - mySoapOperationBinding->SoapAction = String::Concat( myTargetNamespace, addOperation ); - - // Add the extensibility element SoapOperationBinding to - // the OperationBinding. - addOperationBinding->Extensions->Add( mySoapOperationBinding ); - // - // - - // - ServiceDescriptionFormatExtensionCollection^ myExtensions; - - // Get the FaultBindingCollection from the OperationBinding. - FaultBindingCollection^ myFaultBindingCollection = addOperationBinding->Faults; - FaultBinding^ myFaultBinding = gcnew FaultBinding; - myFaultBinding->Name = "ErrorFloat"; - - // Associate SOAP fault binding to the fault binding of the operation. - myExtensions = myFaultBinding->Extensions; - SoapFaultBinding^ mySoapFaultBinding = gcnew SoapFaultBinding; - mySoapFaultBinding->Use = SoapBindingUse::Literal; - mySoapFaultBinding->Namespace = myTargetNamespace; - myExtensions->Add( mySoapFaultBinding ); - myFaultBindingCollection->Add( myFaultBinding ); - // - - // Get the BindingCollection from the ServiceDescription. - BindingCollection^ myBindingCollection = myServiceDescription->Bindings; - - // Get the OperationBindingCollection of SOAP binding - // from the BindingCollection. - OperationBindingCollection^ myOperationBindingCollection = myBindingCollection[ 0 ]->Operations; - myOperationBindingCollection->Add( addOperationBinding ); - Console::WriteLine( "The operations supported by this service are:" ); - System::Collections::IEnumerator^ myEnum = myOperationBindingCollection->GetEnumerator(); - while ( myEnum->MoveNext() ) - { - OperationBinding^ myOperationBinding = safe_cast(myEnum->Current); - - // - Binding^ myBinding = myOperationBinding->Binding; - Console::WriteLine( " Binding : {0} :: Name of operation : {1}", myBinding->Name, myOperationBinding->Name ); - // - - FaultBindingCollection^ myFaultBindingCollection1 = myOperationBinding->Faults; - System::Collections::IEnumerator^ myEnum1 = myFaultBindingCollection1->GetEnumerator(); - while ( myEnum1->MoveNext() ) - { - FaultBinding^ myFaultBinding1 = safe_cast(myEnum1->Current); - Console::WriteLine( " Fault : {0}", myFaultBinding1->Name ); - } - } - myServiceDescription->Write( "MathService_new_cs.wsdl" ); - } - catch ( Exception^ e ) - { - Console::WriteLine( "Exception caught!!!" ); - Console::WriteLine( "Source : {0}", e->Source ); - Console::WriteLine( "Message : {0}", e->Message ); - } -} -// diff --git a/snippets/cpp/VS_Snippets_Remoting/OperationCollection_Methods/CPP/operationcollection_methods.cpp b/snippets/cpp/VS_Snippets_Remoting/OperationCollection_Methods/CPP/operationcollection_methods.cpp deleted file mode 100644 index 6dc493cb959..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/OperationCollection_Methods/CPP/operationcollection_methods.cpp +++ /dev/null @@ -1,92 +0,0 @@ -// System.Web.Sevices.Description.OperationCollection -// System.Web.Sevices.Description.OperationCollection.Add -// System.Web.Sevices.Description.OperationCollection.Contains -// System.Web.Sevices.Description.OperationCollection.IndexOf -// System.Web.Sevices.Description.OperationCollection.Remove -// System.Web.Sevices.Description.OperationCollection.Insert -// System.Web.Sevices.Description.OperationCollection.Item -// System.Web.Sevices.Description.OperationCollection.CopyTo - -/* -The following example demonstrates the usage of the -'OperationCollection' class , its property 'Item' and its methods -'Add', 'Contains', 'CopyTo', 'IndexOf', 'Insert' and 'Remove'. -The input to the program is a WSDL file 'MathService_input_cs.wsdl'with -information related to the 'Add' operation for the SOAP protocol, -removed from it. It creates a new file 'MathService_new_cs.wsdl' with -the added information about the 'Add' method. -*/ - -// -#using -#using -#using - -using namespace System; -using namespace System::Web::Services; -using namespace System::Xml; -using namespace System::Web::Services::Description; -int main() -{ - try - { - // Read the 'MathService_Input_cs.wsdl' file. - ServiceDescription^ myDescription = ServiceDescription::Read( "MathService_Input_cs.wsdl" ); - PortTypeCollection^ myPortTypeCollection = myDescription->PortTypes; - - // Get the 'OperationCollection' for 'SOAP' protocol. - - // - OperationCollection^ myOperationCollection = myPortTypeCollection[ 0 ]->Operations; - Operation^ myOperation = gcnew Operation; - myOperation->Name = "Add"; - OperationMessage^ myOperationMessageInput = (OperationMessage^)(gcnew OperationInput); - myOperationMessageInput->Message = gcnew XmlQualifiedName( "AddSoapIn",myDescription->TargetNamespace ); - OperationMessage^ myOperationMessageOutput = (OperationMessage^)(gcnew OperationOutput); - myOperationMessageOutput->Message = gcnew XmlQualifiedName( "AddSoapOut",myDescription->TargetNamespace ); - myOperation->Messages->Add( myOperationMessageInput ); - myOperation->Messages->Add( myOperationMessageOutput ); - myOperationCollection->Add( myOperation ); - // - - // - // - if ( myOperationCollection->Contains( myOperation )) - { - Console::WriteLine( "The index of the added 'myOperation' operation is : {0}", myOperationCollection->IndexOf( myOperation ) ); - } - // - // - - // - // - // - myOperationCollection->Remove( myOperation ); - - // Insert the 'myOpearation' operation at the index '0'. - myOperationCollection->Insert( 0, myOperation ); - Console::WriteLine( "The operation at index '0' is : {0}", myOperationCollection[ 0 ]->Name ); - // - // - // - - // - array^myOperationArray = gcnew array(myOperationCollection->Count); - myOperationCollection->CopyTo( myOperationArray, 0 ); - Console::WriteLine( "The operation(s) in the collection are :" ); - for ( int i = 0; i < myOperationCollection->Count; i++ ) - { - Console::WriteLine( " {0}", myOperationArray[ i ]->Name ); - } - // - - myDescription->Write( "MathService_New_cs.wsdl" ); - } - catch ( Exception^ e ) - { - Console::WriteLine( "Exception caught!!!" ); - Console::WriteLine( "Source : {0}", e->Source ); - Console::WriteLine( "Message : {0}", e->Message ); - } -} -// diff --git a/snippets/cpp/VS_Snippets_Remoting/OperationFaultCollection_7/CPP/operationfaultcollection_7.cpp b/snippets/cpp/VS_Snippets_Remoting/OperationFaultCollection_7/CPP/operationfaultcollection_7.cpp deleted file mode 100644 index ad166a97219..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/OperationFaultCollection_7/CPP/operationfaultcollection_7.cpp +++ /dev/null @@ -1,114 +0,0 @@ -// System::Web::Services::Description.OperationFaultCollection -// System::Web::Services::Description.OperationFaultCollection::Contains -// System::Web::Services::Description.OperationFaultCollection::CopyTo -// System::Web::Services::Description.OperationFaultCollection::IndexOf -// System::Web::Services::Description.OperationFaultCollection::Insert -// System::Web::Services::Description.OperationFaultCollection::Item -// System::Web::Services::Description.OperationFaultCollection::Remove - -/* -The following example demonstrates the usage of the -'OperationFaultCollection' class, the 'Contains', 'CopyTo', 'IndexOf', -'Insert', 'Remove', methods and the 'Item' property of the class. -The program reverses the fault bindings that appear in the WSDL file. -It also reverses the operation faults and writes the resultant WSDL -file. -*/ - -// -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -int main() -{ - try - { - // Read the StockQuote.wsdl file as input. - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "StockQuote_cpp.wsdl" ); - - // - // - // - // - // - // - PortTypeCollection^ myPortTypeCollection = myServiceDescription->PortTypes; - PortType^ myPortType = myPortTypeCollection[ 0 ]; - OperationCollection^ myOperationCollection = myPortType->Operations; - Operation^ myOperation = myOperationCollection[ 0 ]; - OperationFaultCollection^ myOperationFaultCollection = myOperation->Faults; - - // Reverse the operation fault order. - if ( myOperationFaultCollection->Count > 1 ) - { - OperationFault^ myOperationFault = myOperationFaultCollection[ 0 ]; - array^myOperationFaultArray = gcnew array(myOperationFaultCollection->Count); - - // Copy the operation fault to a temporary array. - myOperationFaultCollection->CopyTo( myOperationFaultArray, 0 ); - - // Remove all the operation faults from the collection. - for ( int i = 0; i < myOperationFaultArray->Length; i++ ) - myOperationFaultCollection->Remove( myOperationFaultArray[ i ] ); - - // Insert the operation faults in the reverse order. - for ( int i = 0,j = (myOperationFaultArray->Length - 1); i < myOperationFaultArray->Length; i++,j-- ) - myOperationFaultCollection->Insert( i, myOperationFaultArray[ j ] ); - if ( myOperationFaultCollection->Contains( myOperationFault ) && (myOperationFaultCollection->IndexOf( myOperationFault ) == myOperationFaultCollection->Count - 1) ) - Console::WriteLine( "Succeeded in reversing the operation faults." ); - else - Console::WriteLine( "Error while reversing the faults." ); - } - // - // - // - // - // - // - - BindingCollection^ myBindingCollection = myServiceDescription->Bindings; - Binding^ myBinding = myBindingCollection[ 0 ]; - OperationBindingCollection^ myOperationBindingCollection = myBinding->Operations; - OperationBinding^ myOperationBinding = myOperationBindingCollection[ 0 ]; - FaultBindingCollection^ myFaultBindingCollection = myOperationBinding->Faults; - - // Reverse the fault binding order. - if ( myFaultBindingCollection->Count > 1 ) - { - FaultBinding^ myFaultBinding = myFaultBindingCollection[ 0 ]; - array^myFaultBindingArray = gcnew array(myFaultBindingCollection->Count); - - // Copy the fault bindings to a temporary array. - myFaultBindingCollection->CopyTo( myFaultBindingArray, 0 ); - - // Remove all the fault bindings. - for ( int i = 0; i < myFaultBindingArray->Length; i++ ) - myFaultBindingCollection->Remove( myFaultBindingArray[ i ] ); - - // Insert the fault bindings in the reverse order. - for ( int i = 0,j = (myFaultBindingArray->Length - 1); i < myFaultBindingArray->Length; i++,j-- ) - myFaultBindingCollection->Insert( i, myFaultBindingArray[ j ] ); - - // Check whether the first element before the reversal - // is now the last element. - if ( myFaultBindingCollection->Contains( myFaultBinding ) && myFaultBindingCollection->IndexOf( myFaultBinding ) == (myFaultBindingCollection->Count - 1) ) - { - // Write the WSDL generated to a file. - myServiceDescription->Write( "StockQuoteOut_cpp.wsdl" ); - Console::WriteLine( "The file StockQuoteOut_cpp.wsdl was successfully written" ); - } - else - Console::WriteLine( "An error occurred while reversing the input WSDL file." ); - } - } - catch ( Exception^ e ) - { - Console::WriteLine( "Exception caught!!!" ); - Console::WriteLine( "Source : {0}", e->Source ); - Console::WriteLine( "Message : {0}", e->Message ); - } -} -// diff --git a/snippets/cpp/VS_Snippets_Remoting/OperationFaultCollection_Add/CPP/operationfaultcollection_add.cpp b/snippets/cpp/VS_Snippets_Remoting/OperationFaultCollection_Add/CPP/operationfaultcollection_add.cpp deleted file mode 100644 index 82de5e660ad..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/OperationFaultCollection_Add/CPP/operationfaultcollection_add.cpp +++ /dev/null @@ -1,54 +0,0 @@ -// System::Web::Services::Description.OperationFaultCollection->Add - -/* -The following example demonstrates the 'Add' method of the -'OperationFaultCollection' class. Based on 'StockQuote_cs::wsdl', the program generates a WSDL file -'StockQuoteNew_cs::wsdl' which contains 'Fault' information written out. -*/ - -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Xml; -using namespace System::Xml::Schema; -using namespace System::Xml::Serialization; - -int main() -{ - try - { - // Read the 'StockQuote::wsdl' file as input. - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "StockQuote_cpp.wsdl" ); - PortTypeCollection^ myPortTypeCollection = myServiceDescription->PortTypes; - PortType^ myPortType = myPortTypeCollection[ 0 ]; - OperationCollection^ myOperationCollection = myPortType->Operations; - Operation^ myOperation = myOperationCollection[ 0 ]; - - // - OperationFaultCollection^ myOperationFaultCollection = myOperation->Faults; - OperationFault^ myOperationFault = gcnew OperationFault; - myOperationFault->Name = "ErrorString"; - myOperationFault->Message = gcnew XmlQualifiedName( "s0:GetTradePriceStringFault" ); - myOperationFaultCollection->Add( myOperationFault ); - // - - Console::WriteLine( "Added OperationFault with Name: {0}", myOperationFault->Name ); - myOperationFault = gcnew OperationFault; - myOperationFault->Name = "ErrorInt"; - myOperationFault->Message = gcnew XmlQualifiedName( "s0:GetTradePriceIntFault" ); - myOperationFaultCollection->Add( myOperationFault ); - myOperationCollection->Add( myOperation ); - Console::WriteLine( "Added Second OperationFault with Name: {0}", myOperationFault->Name ); - myServiceDescription->Write( "StockQuoteNew_cpp.wsdl" ); - Console::WriteLine( "\nThe file 'StockQuoteNew_cpp.wsdl' is created successfully." ); - } - catch ( Exception^ e ) - { - Console::WriteLine( "Exception caught!!!" ); - Console::WriteLine( "Source : {0}", e->Source ); - Console::WriteLine( "Message : {0}", e->Message ); - } -} diff --git a/snippets/cpp/VS_Snippets_Remoting/OperationFaultCollection_Item/CPP/operationfaultcollection_item.cpp b/snippets/cpp/VS_Snippets_Remoting/OperationFaultCollection_Item/CPP/operationfaultcollection_item.cpp deleted file mode 100644 index 845e68c6164..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/OperationFaultCollection_Item/CPP/operationfaultcollection_item.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// System::Web::Services::Description.OperationFaultCollection::Item->Item[String*] - -/* -The following example demonstrates the 'Item' property of the -'OperationFaultCollection' class. The program removes a fault binding -with the name 'ErrorString' from the WSDL file. It also removes an -operation fault with the name 'ErrorString' and generates a WSDL file. -*/ - -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -int main() -{ - try - { - // Read the 'StockQuote::wsdl' file as input. - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "StockQuote_cpp.wsdl" ); - - // Remove the operation fault with the name 'ErrorString'. - PortTypeCollection^ myPortTypeCollection = myServiceDescription->PortTypes; - PortType^ myPortType = myPortTypeCollection[ 0 ]; - OperationCollection^ myOperationCollection = myPortType->Operations; - Operation^ myOperation = myOperationCollection[ 0 ]; - - // - OperationFaultCollection^ myOperationFaultCollection = myOperation->Faults; - OperationFault^ myOperationFault = myOperationFaultCollection[ "ErrorString" ]; - if ( myOperationFault != nullptr ) - myOperationFaultCollection->Remove( myOperationFault ); - // - - // Remove the fault binding with the name 'ErrorString'. - BindingCollection^ myBindingCollection = myServiceDescription->Bindings; - Binding^ myBinding = myBindingCollection[ 0 ]; - OperationBindingCollection^ myOperationBindingCollection = myBinding->Operations; - OperationBinding^ myOperationBinding = myOperationBindingCollection[ 0 ]; - FaultBindingCollection^ myFaultBindingCollection = myOperationBinding->Faults; - if ( myFaultBindingCollection->Contains( myFaultBindingCollection[ "ErrorString" ] ) ) - myFaultBindingCollection->Remove( myFaultBindingCollection[ "ErrorString" ] ); - myServiceDescription->Write( "OperationFaultCollection_out.wsdl" ); - Console::WriteLine( "WSDL file with name 'OperationFaultCollection_out.wsdl' created Successfully" ); - } - catch ( Exception^ e ) - { - Console::WriteLine( "Exception caught!!!" ); - Console::WriteLine( "Source : {0}", e->Source ); - Console::WriteLine( "Message : {0}", e->Message ); - } -} diff --git a/snippets/cpp/VS_Snippets_Remoting/OperationFault_OperationFault/CPP/operationfault_operationfault.cpp b/snippets/cpp/VS_Snippets_Remoting/OperationFault_OperationFault/CPP/operationfault_operationfault.cpp deleted file mode 100644 index b5f3b55eaa1..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/OperationFault_OperationFault/CPP/operationfault_operationfault.cpp +++ /dev/null @@ -1,55 +0,0 @@ -// System::Web::Services::Description.OperationFault -// System::Web::Services::Description.OperationFault::OperationFault - -/* The following example demonstrates the usage of the 'OperationFault' -class and its constructor. The program generates a WSDL file -'StockQuoteNew_cs::wsdl' which contains 'Fault' information written -out. -*/ - -// -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Xml; -using namespace System::Xml::Schema; -using namespace System::Xml::Serialization; -int main() -{ - try - { - // Read the 'StockQuote_cpp.wsdl' file as input. - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "StockQuote_cpp.wsdl" ); - PortTypeCollection^ myPortTypeCollection = myServiceDescription->PortTypes; - PortType^ myPortType = myPortTypeCollection[ 0 ]; - OperationCollection^ myOperationCollection = myPortType->Operations; - Operation^ myOperation = myOperationCollection[ 0 ]; - - // - OperationFault^ myOperationFault = gcnew OperationFault; - myOperationFault->Name = "ErrorString"; - myOperationFault->Message = gcnew XmlQualifiedName( "s0:GetTradePriceStringFault" ); - myOperation->Faults->Add( myOperationFault ); - Console::WriteLine( "Added OperationFault with Name: {0}", myOperationFault->Name ); - myOperationFault = gcnew OperationFault; - myOperationFault->Name = "ErrorInt"; - myOperationFault->Message = gcnew XmlQualifiedName( "s0:GetTradePriceIntFault" ); - myOperation->Faults->Add( myOperationFault ); - // - - myOperationCollection->Add( myOperation ); - Console::WriteLine( "Added Second OperationFault with Name: {0}", myOperationFault->Name ); - myServiceDescription->Write( "StockQuoteNew_cpp.wsdl" ); - Console::WriteLine( "\nThe file 'StockQuoteNew_cpp.wsdl' is created successfully." ); - } - catch ( Exception^ e ) - { - Console::WriteLine( "Exception caught!!!" ); - Console::WriteLine( "Source : {0}", e->Source ); - Console::WriteLine( "Message : {0}", e->Message ); - } -} -// diff --git a/snippets/cpp/VS_Snippets_Remoting/OperationFlow_Enum/CPP/operationflow_enum.cpp b/snippets/cpp/VS_Snippets_Remoting/OperationFlow_Enum/CPP/operationflow_enum.cpp deleted file mode 100644 index 200d1635e94..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/OperationFlow_Enum/CPP/operationflow_enum.cpp +++ /dev/null @@ -1,141 +0,0 @@ -// System.Web.Sevices.Description.OperationFlow -// System.Web.Sevices.Description.OperationFlow.None -// System.Web.Sevices.Description.OperationFlow.OneWay -// System.Web.Sevices.Description.OperationFlow.Notification -// System.Web.Sevices.Description.OperationFlow.SolicitResponse -// System.Web.Sevices.Description.OperationFlow.RequestResponse - -/* -The following example demonstrates the usage of the 'OperationFlow' -Enumeration, its members 'None', 'OneWay', 'Notification', -'SolicitResponse', 'RequestResponse'. The input to the program is a -WSDL file 'MathService_input_cs.wsdl' It creates a new file -'MathService_new_cs.wsdl' by adding the operation messages -'OperationInput' and 'OperationOutput' are added to the -'OperationInput' and 'OperationOutput' in such way that all members of -the 'OperationFlow' enumeration are generated. -*/ - -// -#using -#using -#using - -using namespace System; -using namespace System::Xml; -using namespace System::Web::Services; -using namespace System::Web::Services::Description; - -// -// -// -// -// -void DisplayOperationFlowDescription( OperationFlow myOperationFlow ) -{ - switch ( myOperationFlow ) - { - case OperationFlow::None: - Console::WriteLine( "Indicates that the endpoint or service " - "receives no transmissions (None)." ); - break; - - case OperationFlow::OneWay: - Console::WriteLine( "Indicates that the endpoint or service " - "receives a message (OneWay)." ); - break; - - case OperationFlow::Notification: - Console::WriteLine( "Indicates that the endpoint or service " - "sends a message (Notification)." ); - break; - - case OperationFlow::SolicitResponse: - Console::WriteLine( "Indicates that the endpoint or service " - "sends a message, then receives a " - "correlated message (SolicitResponse)." ); - break; - - case OperationFlow::RequestResponse: - Console::WriteLine( "Indicates that the endpoint or service " - "receives a message, then sends a " - "correlated message (RequestResponse)." ); - break; - } -} -// -// -// -// -// - -int main() -{ - try - { - ServiceDescription^ myDescription = ServiceDescription::Read( "MathService_Input_cs.wsdl" ); - PortTypeCollection^ myPortTypeCollection = myDescription->PortTypes; - - // Get the OperationCollection for SOAP protocol. - OperationCollection^ myOperationCollection = myPortTypeCollection[ 0 ]->Operations; - - // Get the OperationMessageCollection for the Add operation. - OperationMessageCollection^ myOperationMessageCollection = myOperationCollection[ 0 ]->Messages; - - // Indicate that the endpoint or service receives no - // transmissions (None). - Console::WriteLine( "myOperationMessageCollection does not " - "contain any operation messages." ); - DisplayOperationFlowDescription( myOperationMessageCollection->Flow ); - Console::WriteLine(); - - // Indicate that the endpoint or service receives a message (OneWay). - OperationMessage^ myInputOperationMessage = dynamic_cast(gcnew OperationInput); - XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "AddSoapIn",myDescription->TargetNamespace ); - myInputOperationMessage->Message = myXmlQualifiedName; - myOperationMessageCollection->Add( myInputOperationMessage ); - Console::WriteLine( "myOperationMessageCollection contains " - "only input operation messages." ); - DisplayOperationFlowDescription( myOperationMessageCollection->Flow ); - Console::WriteLine(); - myOperationMessageCollection->Remove( myInputOperationMessage ); - - // Indicate that an endpoint or service sends a message (Notification). - OperationMessage^ myOutputOperationMessage = dynamic_cast(gcnew OperationOutput); - XmlQualifiedName^ myXmlQualifiedName1 = gcnew XmlQualifiedName( "AddSoapOut",myDescription->TargetNamespace ); - myOutputOperationMessage->Message = myXmlQualifiedName1; - myOperationMessageCollection->Add( myOutputOperationMessage ); - Console::WriteLine( "myOperationMessageCollection contains " - "only output operation messages." ); - DisplayOperationFlowDescription( myOperationMessageCollection->Flow ); - Console::WriteLine(); - - // Indicate that an endpoint or service sends a message, then - // receives a correlated message (SolicitResponse). - myOperationMessageCollection->Add( myInputOperationMessage ); - Console::WriteLine( "'myOperationMessageCollection' contains " - "an output operation message first, then " - "an input operation message." ); - DisplayOperationFlowDescription( myOperationMessageCollection->Flow ); - Console::WriteLine(); - - // Indicate that an endpoint or service receives a message, - // then sends a correlated message (RequestResponse). - myOperationMessageCollection->Remove( myInputOperationMessage ); - myOperationMessageCollection->Insert( 0, myInputOperationMessage ); - Console::WriteLine( "myOperationMessageCollection contains " - "an input operation message first, then " - "an output operation message." ); - DisplayOperationFlowDescription( myOperationMessageCollection->Flow ); - Console::WriteLine(); - myDescription->Write( "MathService_new_cs.wsdl" ); - Console::WriteLine( "The file MathService_new_cs.wsdl was successfully written." ); - } - catch ( Exception^ e ) - { - Console::WriteLine( "Exception caught!!!" ); - Console::WriteLine( "Source : {0}", e->Source ); - Console::WriteLine( "Message : {0}", e->Message ); - } -} -// diff --git a/snippets/cpp/VS_Snippets_Remoting/OperationInput_OperationInput/CPP/operationinput_operationinput.cpp b/snippets/cpp/VS_Snippets_Remoting/OperationInput_OperationInput/CPP/operationinput_operationinput.cpp deleted file mode 100644 index fdc4a94dd1d..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/OperationInput_OperationInput/CPP/operationinput_operationinput.cpp +++ /dev/null @@ -1,127 +0,0 @@ -// System.Web.Services.Description.OperationInput -// System.Web.Services.Description.OperationInput.OperationInput - -/* -The following example demonstrates the usage of the 'OperationInput' -class and its constructor 'OperationInput'. It instantiates the -'ServiceDescription' object by reading a file 'AddNumbersIn_cs.wsdl' -and then creates 'AddNumbersOut_cs.wsdl' file which corresponds to -added attributes in the 'ServiceDescription' instance. -*/ - -// -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Collections; -using namespace System::Xml; - -int main() -{ - try - { - ServiceDescription^ myDescription = ServiceDescription::Read( "AddNumbersIn_cs.wsdl" ); - - // Add the ServiceHttpPost binding. - Binding^ myBinding = gcnew Binding; - myBinding->Name = "ServiceHttpPost"; - XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "s0:ServiceHttpPost" ); - myBinding->Type = myXmlQualifiedName; - HttpBinding^ myHttpBinding = gcnew HttpBinding; - myHttpBinding->Verb = "POST"; - myBinding->Extensions->Add( myHttpBinding ); - - // Add the operation name AddNumbers. - OperationBinding^ myOperationBinding = gcnew OperationBinding; - myOperationBinding->Name = "AddNumbers"; - HttpOperationBinding^ myOperation = gcnew HttpOperationBinding; - myOperation->Location = "/AddNumbers"; - myOperationBinding->Extensions->Add( myOperation ); - - // Add the input binding. - InputBinding^ myInput = gcnew InputBinding; - MimeContentBinding^ postMimeContentbinding = gcnew MimeContentBinding; - postMimeContentbinding->Type = "application/x-www-form-urlencoded"; - myInput->Extensions->Add( postMimeContentbinding ); - - // Add the InputBinding to the OperationBinding. - myOperationBinding->Input = myInput; - - // Add the ouput binding. - OutputBinding^ myOutput = gcnew OutputBinding; - MimeXmlBinding^ postMimeXmlBinding = gcnew MimeXmlBinding; - postMimeXmlBinding->Part = "Body"; - myOutput->Extensions->Add( postMimeXmlBinding ); - - // Add the OutputBinding to the OperationBinding. - myOperationBinding->Output = myOutput; - myBinding->Operations->Add( myOperationBinding ); - myDescription->Bindings->Add( myBinding ); - - // Add the port definition. - Port^ postPort = gcnew Port; - postPort->Name = "ServiceHttpPost"; - postPort->Binding = gcnew XmlQualifiedName( "s0:ServiceHttpPost" ); - HttpAddressBinding^ postAddressBinding = gcnew HttpAddressBinding; - postAddressBinding->Location = "http://localhost/Service.cs.asmx"; - postPort->Extensions->Add( postAddressBinding ); - myDescription->Services[ 0 ]->Ports->Add( postPort ); - - // Add the post port type definition. - PortType^ postPortType = gcnew PortType; - postPortType->Name = "ServiceHttpPost"; - Operation^ postOperation = gcnew Operation; - postOperation->Name = "AddNumbers"; - OperationMessage^ postOutput = dynamic_cast(gcnew OperationOutput); - postOutput->Message = gcnew XmlQualifiedName( "s0:AddNumbersHttpPostOut" ); - - // - OperationInput^ postInput = gcnew OperationInput; - postInput->Message = gcnew XmlQualifiedName( "s0:AddNumbersHttpPostIn" ); - postOperation->Messages->Add( postInput ); - postOperation->Messages->Add( postOutput ); - postPortType->Operations->Add( postOperation ); - // - - myDescription->PortTypes->Add( postPortType ); - - // Add the first message information. - Message^ postMessage1 = gcnew Message; - postMessage1->Name = "AddNumbersHttpPostIn"; - MessagePart^ postMessagePart1 = gcnew MessagePart; - postMessagePart1->Name = "firstnumber"; - postMessagePart1->Type = gcnew XmlQualifiedName( "s:string" ); - - // Add the second message information. - MessagePart^ postMessagePart2 = gcnew MessagePart; - postMessagePart2->Name = "secondnumber"; - postMessagePart2->Type = gcnew XmlQualifiedName( "s:string" ); - postMessage1->Parts->Add( postMessagePart1 ); - postMessage1->Parts->Add( postMessagePart2 ); - Message^ postMessage2 = gcnew Message; - postMessage2->Name = "AddNumbersHttpPostOut"; - - // Add the third message information. - MessagePart^ postMessagePart3 = gcnew MessagePart; - postMessagePart3->Name = "Body"; - postMessagePart3->Element = gcnew XmlQualifiedName( "s0:int" ); - postMessage2->Parts->Add( postMessagePart3 ); - myDescription->Messages->Add( postMessage1 ); - myDescription->Messages->Add( postMessage2 ); - - // Write the ServiceDescription as a WSDL file. - myDescription->Write( "AddNumbersOut_cs.wsdl" ); - Console::WriteLine( "WSDL file named AddNumberOut_cs.Wsdl" - " created successfully." ); - } - catch ( Exception^ e ) - { - Console::WriteLine( "Exception caught!!!" ); - Console::WriteLine( "Source : {0}", e->Source ); - Console::WriteLine( "Message : {0}", e->Message ); - } -} -// diff --git a/snippets/cpp/VS_Snippets_Remoting/OperationMessageCollection_Sample/CPP/operationmessagecollection_sample.cpp b/snippets/cpp/VS_Snippets_Remoting/OperationMessageCollection_Sample/CPP/operationmessagecollection_sample.cpp deleted file mode 100644 index 051aa44c1c0..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/OperationMessageCollection_Sample/CPP/operationmessagecollection_sample.cpp +++ /dev/null @@ -1,129 +0,0 @@ - - -// System.Web.Services.Description.OperationMessageCollection -// System.Web.Services.Description.OperationMessageCollection.Item -// System.Web.Services.Description.OperationMessageCollection.CopyTo -// System.Web.Services.Description.OperationMessageCollection.Add -// System.Web.Services.Description.OperationMessageCollection.Contains -// System.Web.Services.Description.OperationMessageCollection.IndexOf -// System.Web.Services.Description.OperationMessageCollection.Remove -// System.Web.Services.Description.OperationMessageCollection.Insert -// System.Web.Services.Description.OperationMessageCollection.Flow -// System.Web.Services.Description.OperationMessageCollection.Input -// System.Web.Services.Description.OperationMessageCollection.Output - -/* -The following example demonstrates the usage of the -'OperationMessageCollection' class and various methods and properties of it. -The input to the program is a WSDL file 'MathService_input_vb.wsdl' without -the input message of 'Add' operation for the SOAP -protocol. In a way, it tries to simulate a scenario -wherein the operation flow was 'Notification', however later operation -flow changed to 'Request-Response'. The WSDL file is -modified by inserting a new input message for the 'Add' operation. The -input message in the ServiceDescription instance is loaded with values for -'Input Message'. The instance is then written to 'MathService_new_vb.wsdl'. -*/ - -// -#using -#using -#using - -using namespace System; -using namespace System::Xml; -using namespace System::Web::Services; -using namespace System::Web::Services::Description; - -// -// -// -// Displays the properties of the OperationMessageCollection. -void DisplayFlowInputOutput( OperationMessageCollection^ myOperationMessageCollection, String^ myOperation ) -{ - Console::WriteLine( "After {0}:", myOperation ); - Console::WriteLine( "Flow : {0}", myOperationMessageCollection->Flow ); - Console::WriteLine( "The first occurrence of operation Input in the collection {0}", myOperationMessageCollection->Input ); - Console::WriteLine( "The first occurrence of operation Output in the collection {0}", myOperationMessageCollection->Output ); - Console::WriteLine(); -} -// -// -// - -int main() -{ - try - { - ServiceDescription^ myDescription = ServiceDescription::Read( "MathService_input_cs.wsdl" ); - PortTypeCollection^ myPortTypeCollection = myDescription->PortTypes; - - // Get the OperationCollection for the SOAP protocol. - OperationCollection^ myOperationCollection = myPortTypeCollection[ 0 ]->Operations; - - // Get the OperationMessageCollection for the Add operation. - OperationMessageCollection^ myOperationMessageCollection = myOperationCollection[ 0 ]->Messages; - - // Display the Flow, Input, and Output properties. - DisplayFlowInputOutput( myOperationMessageCollection, "Start" ); - - // - // - // Get the operation message for the Add operation. - OperationMessage^ myOperationMessage = myOperationMessageCollection[ 0 ]; - OperationMessage^ myInputOperationMessage = dynamic_cast(gcnew OperationInput); - XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "AddSoapIn",myDescription->TargetNamespace ); - myInputOperationMessage->Message = myXmlQualifiedName; - - // - array^myCollection = gcnew array(myOperationMessageCollection->Count); - myOperationMessageCollection->CopyTo( myCollection, 0 ); - Console::WriteLine( "Operation name(s) :" ); - for ( int i = 0; i < myCollection->Length; i++ ) - { - Console::WriteLine( " {0}", myCollection[ i ]->Operation->Name ); - } - // - - // Add the OperationMessage to the collection. - myOperationMessageCollection->Add( myInputOperationMessage ); - - // - DisplayFlowInputOutput( myOperationMessageCollection, "Add" ); - - // - // - if ( myOperationMessageCollection->Contains( myOperationMessage )) - { - int myIndex = myOperationMessageCollection->IndexOf( myOperationMessage ); - Console::WriteLine( " The index of the Add operation message in the collection is : {0}", myIndex ); - } - // - // - // - - // - // - myOperationMessageCollection->Remove( myInputOperationMessage ); - - // Display Flow, Input, and Output after removing. - DisplayFlowInputOutput( myOperationMessageCollection, "Remove" ); - - // Insert the message at index 0 in the collection. - myOperationMessageCollection->Insert( 0, myInputOperationMessage ); - - // Display Flow, Input, and Output after inserting. - DisplayFlowInputOutput( myOperationMessageCollection, "Insert" ); - // - // - - myDescription->Write( "MathService_new_cs.wsdl" ); - } - catch ( Exception^ e ) - { - Console::WriteLine( "Exception caught!!!" ); - Console::WriteLine( "Source : {0}", e->Source ); - Console::WriteLine( "Message : {0}", e->Message ); - } -} -// diff --git a/snippets/cpp/VS_Snippets_Remoting/OperationMessage_Properties/CPP/operationmessage_properties.cpp b/snippets/cpp/VS_Snippets_Remoting/OperationMessage_Properties/CPP/operationmessage_properties.cpp deleted file mode 100644 index c7cd7a8b49c..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/OperationMessage_Properties/CPP/operationmessage_properties.cpp +++ /dev/null @@ -1,64 +0,0 @@ -// System.Web.Services.Description.OperationMessage -// System.Web.Services.Description.OperationMessage.OperationMessage -// System.Web.Services.Description.OperationMessage.Message -// System.Web.Services.Description.OperationMessage.Operation - -/* -The following example demonstrates the usage of the 'OperationMessage' -class, its constructor and the properties 'Message' and 'Operation'. -The input to the program is a WSDL file 'MathService_input_cs.wsdl' without -the input message of 'Add' operation for the SOAP -protocol. In this example a new input message for the 'Add' operation is created. -The input message in the ServiceDescription instance is loaded with values for -'InputMessage'. The instance is then written to 'MathService_new_cs.wsdl'. -*/ - -// -#using -#using -#using - -using namespace System; -using namespace System::Xml; -using namespace System::Web::Services; -using namespace System::Web::Services::Description; - -int main() -{ - try - { - ServiceDescription^ myDescription = ServiceDescription::Read( "MathService_input_cs.wsdl" ); - PortTypeCollection^ myPortTypeCollection = myDescription->PortTypes; - - // Get the OperationCollection for the SOAP protocol. - OperationCollection^ myOperationCollection = myPortTypeCollection[ 0 ]->Operations; - - // Get the OperationMessageCollection for the Add operation. - OperationMessageCollection^ myOperationMessageCollection = myOperationCollection[ 0 ]->Messages; - - // - // - // - OperationMessage^ myInputOperationMessage = (OperationMessage^)(gcnew OperationInput); - XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "AddSoapIn",myDescription->TargetNamespace ); - myInputOperationMessage->Message = myXmlQualifiedName; - // - - myOperationMessageCollection->Insert( 0, myInputOperationMessage ); - - // Display the operation name of the InputMessage. - Console::WriteLine( "The operation name is {0}", myInputOperationMessage->Operation->Name ); - // - // - - // Add the OperationMessage to the collection. - myDescription->Write( "MathService_new_cs.wsdl" ); - } - catch ( Exception^ e ) - { - Console::WriteLine( "Exception caught!!!" ); - Console::WriteLine( "Source : {0}", e->Source ); - Console::WriteLine( "Message : {0}", e->Message ); - } -} -// diff --git a/snippets/cpp/VS_Snippets_Remoting/OperationOutput_OperationOutput/CPP/operationoutput_operationoutput.cpp b/snippets/cpp/VS_Snippets_Remoting/OperationOutput_OperationOutput/CPP/operationoutput_operationoutput.cpp deleted file mode 100644 index 9500f4f962e..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/OperationOutput_OperationOutput/CPP/operationoutput_operationoutput.cpp +++ /dev/null @@ -1,127 +0,0 @@ -// System.Web.Services.Description.OperationOutput -// System.Web.Services.Description.OperationOutput.OperationOutput - -/* -The following example demonstrates the usage of the 'OperationOutput' -class and its constructor 'OperationOutput'. It creates a -'ServiceDescription' object by reading the file 'AddNumbersIn_cs.wsdl' and -then creates 'AddNumbersOut_cs.wsdl' file which corresponds to added -attributes in the 'ServiceDescription' instance. -*/ - -// -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Collections; -using namespace System::Xml; - -int main() -{ - try - { - ServiceDescription^ myDescription = ServiceDescription::Read( "AddNumbersIn_cs.wsdl" ); - - // Add the ServiceHttpPost binding. - Binding^ myBinding = gcnew Binding; - myBinding->Name = "ServiceHttpPost"; - XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "s0:ServiceHttpPost" ); - myBinding->Type = myXmlQualifiedName; - HttpBinding^ myHttpBinding = gcnew HttpBinding; - myHttpBinding->Verb = "POST"; - myBinding->Extensions->Add( myHttpBinding ); - - // Add the operation name AddNumbers. - OperationBinding^ myOperationBinding = gcnew OperationBinding; - myOperationBinding->Name = "AddNumbers"; - HttpOperationBinding^ myOperation = gcnew HttpOperationBinding; - myOperation->Location = "/AddNumbers"; - myOperationBinding->Extensions->Add( myOperation ); - - // Add the input binding. - InputBinding^ myInput = gcnew InputBinding; - MimeContentBinding^ postMimeContentbinding = gcnew MimeContentBinding; - postMimeContentbinding->Type = "application/x-www-form-urlencoded"; - myInput->Extensions->Add( postMimeContentbinding ); - - // Add the InputBinding to the OperationBinding. - myOperationBinding->Input = myInput; - - // Add the ouput binding. - OutputBinding^ myOutput = gcnew OutputBinding; - MimeXmlBinding^ postMimeXmlbinding = gcnew MimeXmlBinding; - postMimeXmlbinding->Part = "Body"; - myOutput->Extensions->Add( postMimeXmlbinding ); - - // Add the OutPutBinding to the OperationBinding. - myOperationBinding->Output = myOutput; - myBinding->Operations->Add( myOperationBinding ); - myDescription->Bindings->Add( myBinding ); - - // Add the port definition. - Port^ postPort = gcnew Port; - postPort->Name = "ServiceHttpPost"; - postPort->Binding = gcnew XmlQualifiedName( "s0:ServiceHttpPost" ); - HttpAddressBinding^ postAddressBinding = gcnew HttpAddressBinding; - postAddressBinding->Location = "http://localhost/Service_cs.asmx"; - postPort->Extensions->Add( postAddressBinding ); - myDescription->Services[ 0 ]->Ports->Add( postPort ); - - // Add the post port type definition. - PortType^ postPortType = gcnew PortType; - postPortType->Name = "ServiceHttpPost"; - Operation^ postOperation = gcnew Operation; - postOperation->Name = "AddNumbers"; - OperationMessage^ postInput = dynamic_cast(gcnew OperationInput); - postInput->Message = gcnew XmlQualifiedName( "s0:AddNumbersHttpPostIn" ); - - // - OperationOutput^ postOutput = gcnew OperationOutput; - postOutput->Message = gcnew XmlQualifiedName( "s0:AddNumbersHttpPostOut" ); - postOperation->Messages->Add( postInput ); - postOperation->Messages->Add( postOutput ); - postPortType->Operations->Add( postOperation ); - // - - myDescription->PortTypes->Add( postPortType ); - - // Add the first message information. - Message^ postMessage1 = gcnew Message; - postMessage1->Name = "AddNumbersHttpPostIn"; - MessagePart^ postMessagePart1 = gcnew MessagePart; - postMessagePart1->Name = "firstnumber"; - postMessagePart1->Type = gcnew XmlQualifiedName( "s:string" ); - - // Add the second message information. - MessagePart^ postMessagePart2 = gcnew MessagePart; - postMessagePart2->Name = "secondnumber"; - postMessagePart2->Type = gcnew XmlQualifiedName( "s:string" ); - postMessage1->Parts->Add( postMessagePart1 ); - postMessage1->Parts->Add( postMessagePart2 ); - Message^ postMessage2 = gcnew Message; - postMessage2->Name = "AddNumbersHttpPostOut"; - - // Add the third message information. - MessagePart^ postMessagePart3 = gcnew MessagePart; - postMessagePart3->Name = "Body"; - postMessagePart3->Element = gcnew XmlQualifiedName( "s0:int" ); - postMessage2->Parts->Add( postMessagePart3 ); - myDescription->Messages->Add( postMessage1 ); - myDescription->Messages->Add( postMessage2 ); - - // Write the ServiceDescription as a WSDL file. - myDescription->Write( "AddNumbersOut_cs.wsdl" ); - Console::WriteLine( "WSDL file named AddNumbersOut_cs.Wsdl" - " created successfully." ); - } - catch ( Exception^ e ) - { - Console::WriteLine( "Exception caught!!!" ); - Console::WriteLine( "Source : {0}", e->Source ); - Console::WriteLine( "Message : {0}", e->Message ); - } -} -// diff --git a/snippets/cpp/VS_Snippets_Remoting/Operation_2/CPP/operation_2.cpp b/snippets/cpp/VS_Snippets_Remoting/Operation_2/CPP/operation_2.cpp deleted file mode 100644 index 6af07a14872..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/Operation_2/CPP/operation_2.cpp +++ /dev/null @@ -1,155 +0,0 @@ -// System.Web.Services.Description Operation.ParameterOrderString -// System.Web.Services.Description Operation.ParameterOrder - -/* The following program demonstrates the 'ParameterOrderString' and - 'ParameterOrder' properties of 'Operation' class. It collects the - message part names from the input WSDL file and sets to the - 'ParameterOrderString'. It then displays the same using 'ParameterOrder' - property. -*/ - -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Collections; -using namespace System::Xml; - -int main() -{ - try - { - ServiceDescription^ myDescription = ServiceDescription::Read( "Operation_2_Input_CS.wsdl" ); - Binding^ myBinding = gcnew Binding; - myBinding->Name = "Operation_2_ServiceHttpPost"; - XmlQualifiedName^ myQualifiedName = gcnew XmlQualifiedName( "s0:Operation_2_ServiceHttpPost" ); - myBinding->Type = myQualifiedName; - HttpBinding^ myHttpBinding = gcnew HttpBinding; - myHttpBinding->Verb = "POST"; - - // Add the 'HttpBinding' to the 'Binding'. - myBinding->Extensions->Add( myHttpBinding ); - OperationBinding^ myOperationBinding = gcnew OperationBinding; - myOperationBinding->Name = "AddNumbers"; - HttpOperationBinding^ myHttpOperationBinding = gcnew HttpOperationBinding; - myHttpOperationBinding->Location = "/AddNumbers"; - - // Add the 'HttpOperationBinding' to 'OperationBinding'. - myOperationBinding->Extensions->Add( myHttpOperationBinding ); - InputBinding^ myInputBinding = gcnew InputBinding; - MimeContentBinding^ myPostMimeContentbinding = gcnew MimeContentBinding; - myPostMimeContentbinding->Type = "application/x-www-form-urlencoded"; - myInputBinding->Extensions->Add( myPostMimeContentbinding ); - - // Add the 'InputBinding' to 'OperationBinding'. - myOperationBinding->Input = myInputBinding; - OutputBinding^ myOutputBinding = gcnew OutputBinding; - MimeXmlBinding^ myPostMimeXmlbinding = gcnew MimeXmlBinding; - myPostMimeXmlbinding->Part = "Body"; - myOutputBinding->Extensions->Add( myPostMimeXmlbinding ); - - // Add the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding->Output = myOutputBinding; - - // Add the 'OperationBinding' to 'Binding'. - myBinding->Operations->Add( myOperationBinding ); - - // Add the 'Binding' to 'BindingCollection' of 'ServiceDescription'. - myDescription->Bindings->Add( myBinding ); - Port^ myPostPort = gcnew Port; - myPostPort->Name = "Operation_2_ServiceHttpPost"; - myPostPort->Binding = gcnew XmlQualifiedName( "s0:Operation_2_ServiceHttpPost" ); - HttpAddressBinding^ myPostAddressBinding = gcnew HttpAddressBinding; - myPostAddressBinding->Location = "http://localhost/Operation_2/Operation_2_Service.cs.asmx"; - - // Add the 'HttpAddressBinding' to the 'Port'. - myPostPort->Extensions->Add( myPostAddressBinding ); - - // Add the 'Port' to 'PortCollection' of 'ServiceDescription'. - myDescription->Services[ 0 ]->Ports->Add( myPostPort ); - PortType^ myPostPortType = gcnew PortType; - myPostPortType->Name = "Operation_2_ServiceHttpPost"; - Operation^ myPostOperation = gcnew Operation; - myPostOperation->Name = "AddNumbers"; - OperationMessage^ myPostOperationInput = dynamic_cast(gcnew OperationInput); - myPostOperationInput->Message = gcnew XmlQualifiedName( "s0:AddNumbersHttpPostIn" ); - OperationMessage^ myPostOperationOutput = dynamic_cast(gcnew OperationOutput); - myPostOperationOutput->Message = gcnew XmlQualifiedName( "s0:AddNumbersHttpPostout" ); - myPostOperation->Messages->Add( myPostOperationInput ); - myPostOperation->Messages->Add( myPostOperationOutput ); - - // Add the 'Operation' to 'PortType'. - myPostPortType->Operations->Add( myPostOperation ); - - // Adds the 'PortType' to 'PortTypeCollection' of 'ServiceDescription'. - myDescription->PortTypes->Add( myPostPortType ); - Message^ myPostMessage1 = gcnew Message; - myPostMessage1->Name = "AddNumbersHttpPostIn"; - MessagePart^ myPostMessagePart1 = gcnew MessagePart; - myPostMessagePart1->Name = "firstnumber"; - myPostMessagePart1->Type = gcnew XmlQualifiedName( "s:string" ); - MessagePart^ myPostMessagePart2 = gcnew MessagePart; - myPostMessagePart2->Name = "secondnumber"; - myPostMessagePart2->Type = gcnew XmlQualifiedName( "s:string" ); - - // Add the 'MessagePart' objects to 'Messages'. - myPostMessage1->Parts->Add( myPostMessagePart1 ); - myPostMessage1->Parts->Add( myPostMessagePart2 ); - Message^ myPostMessage2 = gcnew Message; - myPostMessage2->Name = "AddNumbersHttpPostout"; - MessagePart^ myPostMessagePart3 = gcnew MessagePart; - myPostMessagePart3->Name = "Body"; - myPostMessagePart3->Element = gcnew XmlQualifiedName( "s0:int" ); - - // Add the 'MessagePart' to 'Message'. - myPostMessage2->Parts->Add( myPostMessagePart3 ); - - // Add the 'Message' objects to 'ServiceDescription'. - myDescription->Messages->Add( myPostMessage1 ); - myDescription->Messages->Add( myPostMessage2 ); - - // Write the 'ServiceDescription' as a WSDL file. - myDescription->Write( "Operation_2_Output_CS.wsdl" ); - Console::WriteLine( " 'Operation_2_Output_CS.wsdl' file created Successfully" ); - - // - // - String^ myString = nullptr; - Operation^ myOperation = gcnew Operation; - myDescription = ServiceDescription::Read( "Operation_2_Input_CS.wsdl" ); - array^myMessage = gcnew array(myDescription->Messages->Count); - - // Copy the messages from the service description. - myDescription->Messages->CopyTo( myMessage, 0 ); - for ( int i = 0; i < myDescription->Messages->Count; i++ ) - { - array^myMessagePart = gcnew array(myMessage[ i ]->Parts->Count); - - // Copy the message parts into a MessagePart. - myMessage[ i ]->Parts->CopyTo( myMessagePart, 0 ); - for ( int j = 0; j < myMessage[ i ]->Parts->Count; j++ ) - { - myString = String::Concat( myString, myMessagePart[ j ]->Name, " " ); - } - } - - // message part names. - myOperation->ParameterOrderString = myString; - array^myString1 = myOperation->ParameterOrder; - int k = 0; - Console::WriteLine( "The list of message part names is as follows:" ); - while ( k < 5 ) - { - Console::WriteLine( myString1[ k ] ); - k++; - } - // - // - } - catch ( Exception^ e ) - { - Console::WriteLine( "The following Exception is raised : {0}", e->Message ); - } -} diff --git a/snippets/cpp/VS_Snippets_Remoting/Operation_5/CPP/operation_5.cpp b/snippets/cpp/VS_Snippets_Remoting/Operation_5/CPP/operation_5.cpp deleted file mode 100644 index 13001d530c7..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/Operation_5/CPP/operation_5.cpp +++ /dev/null @@ -1,72 +0,0 @@ - - -// System.Web.Services.Description.Operation -// System.Web.Services.Description.Operation.Operation -// System.Web.Services.Description.Operation.Messages -// System.Web.Services.Description.Operation.Name -// System.Web.Services.Description.Operation.PortType -/* The following program demonstrates 'Operation' class, its contructor -and 'Messages','Name' and 'PortType' properties. It reads the file -'Operation_5_Input_CS.wsdl' which does not have 'PortType' object that -supports 'HttpPost'. It adds a 'PortType' object that supports 'HttpPost' -protocol and writes into 'Operation_5_Output_CS.wsdl'. -*/ -// -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Collections; -using namespace System::Xml; -Operation^ CreateOperation( String^ myOperationName, String^ myInputMesg, String^ myOutputMesg ) -{ - - // - // - // - // Create an Operation. - Operation^ myOperation = gcnew Operation; - myOperation->Name = myOperationName; - OperationMessage^ myInput = dynamic_cast(gcnew OperationInput); - myInput->Message = gcnew XmlQualifiedName( myInputMesg ); - OperationMessage^ myOutput = dynamic_cast(gcnew OperationOutput); - myOutput->Message = gcnew XmlQualifiedName( myOutputMesg ); - - // Add messages to the OperationMessageCollection. - myOperation->Messages->Add( myInput ); - myOperation->Messages->Add( myOutput ); - Console::WriteLine( "Operation name is: {0}", myOperation->Name ); - - // - // - // - return myOperation; -} - -int main() -{ - ServiceDescription^ myDescription = ServiceDescription::Read( "Operation_5_Input_CS.wsdl" ); - - // Create a 'PortType' object. - PortType^ myPortType = gcnew PortType; - myPortType->Name = "OperationServiceHttpPost"; - Operation^ myOperation = CreateOperation( "AddNumbers", "s0:AddNumbersHttpPostIn", "s0:AddNumbersHttpPostOut" ); - myPortType->Operations->Add( myOperation ); - - // - // Get the PortType of the Operation. - PortType^ myPort = myOperation->PortType; - Console::WriteLine( "The port type of the operation is: {0}", myPort->Name ); - - // - // Add the 'PortType's to 'PortTypeCollection' of 'ServiceDescription'. - myDescription->PortTypes->Add( myPortType ); - - // Write the 'ServiceDescription' as a WSDL file. - myDescription->Write( "Operation_5_Output_CS.wsdl" ); - Console::WriteLine( "WSDL file with name 'Operation_5_Output_CS.wsdl' file created Successfully" ); -} - -// diff --git a/snippets/cpp/VS_Snippets_Remoting/Operation_Faults/CPP/operation_faults.cpp b/snippets/cpp/VS_Snippets_Remoting/Operation_Faults/CPP/operation_faults.cpp deleted file mode 100644 index 69a3b7c85e8..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/Operation_Faults/CPP/operation_faults.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// System::Web::Services::Description.Operation::Faults - -/* The following program demonstrates the 'Faults' property of 'Operation' -class. It reads from a 'Operation_Faults_Input_CS::wsdl' file removes fault -binding and operation fault with the name 'ErrorString'. The modified -ServiceDescriptor is written to 'Operation_Faults_Output_Cpp.wsdl' file. -*/ - -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; - -int main() -{ - // - // Read the 'Operation_Faults_Input_cpp.wsdl' file as input. - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "Operation_Faults_Input_cpp.wsdl" ); - - // Get the operation fault collection. - PortTypeCollection^ myPortTypeCollection = myServiceDescription->PortTypes; - PortType^ myPortType = myPortTypeCollection[ 0 ]; - OperationCollection^ myOperationCollection = myPortType->Operations; - - // Remove the operation fault with the name 'ErrorString'. - Operation^ myOperation = myOperationCollection[ 0 ]; - OperationFaultCollection^ myOperationFaultCollection = myOperation->Faults; - if ( myOperationFaultCollection->Contains( myOperationFaultCollection[ "ErrorString" ] ) ) - myOperationFaultCollection->Remove( myOperationFaultCollection[ "ErrorString" ] ); - // - - // Get the fault binding collection. - BindingCollection^ myBindingCollection = myServiceDescription->Bindings; - Binding^ myBinding = myBindingCollection[ 0 ]; - OperationBindingCollection^ myOperationBindingCollection = myBinding->Operations; - - // Remove the fault binding with the name 'ErrorString'. - OperationBinding^ myOperationBinding = myOperationBindingCollection[ 0 ]; - FaultBindingCollection^ myFaultBindingCollection = myOperationBinding->Faults; - if ( myFaultBindingCollection->Contains( myFaultBindingCollection[ "ErrorString" ] ) ) - myFaultBindingCollection->Remove( myFaultBindingCollection[ "ErrorString" ] ); - - myServiceDescription->Write( "Operation_Faults_Output_cpp.wsdl" ); - Console::WriteLine( "WSDL file with name 'Operation_Faults_Output_cpp.wsdl' file created Successfully" ); -} diff --git a/snippets/cpp/VS_Snippets_Remoting/Operation_IsBoundBy/CPP/operation_isboundby.cpp b/snippets/cpp/VS_Snippets_Remoting/Operation_IsBoundBy/CPP/operation_isboundby.cpp deleted file mode 100644 index fab0c5d907a..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/Operation_IsBoundBy/CPP/operation_isboundby.cpp +++ /dev/null @@ -1,95 +0,0 @@ -// System.Web.Services.Description.Operation.IsBoundBy -/* The following program demonstrates the 'IsBoundBy' method of - 'Operation' class. It takes "Operation_IsBoundBy_Input_CS.wsdl" - as input which does not contain 'PortType' and 'Binding' objects - supporting 'HttpPost'. It then adds those objects and writes into - 'Operation_IsBoundBy_Output_CS.wsdl'. -*/ - -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Collections; -using namespace System::Xml; - -int main() -{ - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "Operation_IsBoundBy_Input_CS.wsdl" ); - - // Create the 'Binding' object. - Binding^ myBinding = gcnew Binding; - myBinding->Name = "MyOperationIsBoundByServiceHttpPost"; - XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "s0:OperationServiceHttpPost" ); - myBinding->Type = myXmlQualifiedName; - - // Create the 'HttpBinding' object. - HttpBinding^ myHttpBinding = gcnew HttpBinding; - myHttpBinding->Verb = "POST"; - - // Add the 'HttpBinding' to the 'Binding'. - myBinding->Extensions->Add( myHttpBinding ); - - // Create the 'OperationBinding' object. - OperationBinding^ myOperationBinding = gcnew OperationBinding; - myOperationBinding->Name = "AddNumbers"; - HttpOperationBinding^ myHttpOperationBinding = gcnew HttpOperationBinding; - myHttpOperationBinding->Location = "/AddNumbers"; - - // Add the 'HttpOperationBinding' to 'OperationBinding'. - myOperationBinding->Extensions->Add( myHttpOperationBinding ); - - // Create the 'InputBinding' object. - InputBinding^ myInputBinding = gcnew InputBinding; - MimeContentBinding^ myPostMimeContentBinding = gcnew MimeContentBinding; - myPostMimeContentBinding->Type = "application/x-www-form-urlencoded"; - myInputBinding->Extensions->Add( myPostMimeContentBinding ); - - // Add the 'InputBinding' to 'OperationBinding'. - myOperationBinding->Input = myInputBinding; - - // Create the 'OutputBinding' object. - OutputBinding^ myOutputBinding = gcnew OutputBinding; - MimeXmlBinding^ myPostMimeXmlBinding = gcnew MimeXmlBinding; - myPostMimeXmlBinding->Part = "Body"; - myOutputBinding->Extensions->Add( myPostMimeXmlBinding ); - - // Add the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding->Output = myOutputBinding; - - // Add the 'OperationBinding' to 'Binding'. - myBinding->Operations->Add( myOperationBinding ); - - // Add the 'Binding' to 'BindingCollection' of 'ServiceDescription'. - myServiceDescription->Bindings->Add( myBinding ); - - // Create a 'PortType' object. - PortType^ myPostPortType = gcnew PortType; - myPostPortType->Name = "OperationServiceHttpPost"; - -// - Operation^ myPostOperation = gcnew Operation; - myPostOperation->Name = myOperationBinding->Name; - Console::WriteLine( "'Operation' instance uses 'OperationBinding': {0}", - myPostOperation->IsBoundBy( myOperationBinding ) ); -// - - OperationMessage^ myOperationMessage = dynamic_cast(gcnew OperationInput); - myOperationMessage->Message = gcnew XmlQualifiedName( "s0:AddNumbersHttpPostIn" ); - OperationMessage^ myOperationMessage1 = dynamic_cast(gcnew OperationOutput); - myOperationMessage1->Message = gcnew XmlQualifiedName( "s0:AddNumbersHttpPostOut" ); - myPostOperation->Messages->Add( myOperationMessage ); - myPostOperation->Messages->Add( myOperationMessage1 ); - - // Add the 'Operation' to 'PortType'. - myPostPortType->Operations->Add( myPostOperation ); - - // Adds the 'PortType' to 'PortTypeCollection' of 'ServiceDescription'. - myServiceDescription->PortTypes->Add( myPostPortType ); - - // Write the 'ServiceDescription' as a WSDL file. - myServiceDescription->Write( "Operation_IsBoundBy_Output_CS.wsdl" ); - Console::WriteLine( "WSDL file with name 'Operation_IsBoundBy_Output_CS.wsdl' created Successfully" ); -} diff --git a/snippets/cpp/VS_Snippets_Remoting/PortClass/CPP/portclass.cpp b/snippets/cpp/VS_Snippets_Remoting/PortClass/CPP/portclass.cpp deleted file mode 100644 index 458ca2e8f8e..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/PortClass/CPP/portclass.cpp +++ /dev/null @@ -1,166 +0,0 @@ - - -// System.Web.Services.Description.Port.ctor(). -// System.Web.Services.Description.Port.Binding(). -// System.Web.Services.Description.Portt.Extensions. -// System.Web.Services.Description.Port.Name. -// System.Web.Services.Description.Port.Service. -/* The following example demonstrates the constructor and the properties 'Binding', - 'Extensions','Name', and 'Service' of the 'Port' class. - The input to the program is a WSDL file 'AddNumbers_cs.wsdl'. - It creates a 'ServiceDescription' instance by using the static read method - of 'ServiceDescription' by passing the 'AddNumbers.wsdl' name as an argument. - It creates a 'Binding' object and adds that binding object to - 'ServiceDescription'. It adds the 'PortType',Messages to the 'ServiceDescription' - object. Finally it writes the 'ServiceDescrption' as a WSDL file with - name 'AddNumbersOne.wsdl. - */ -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Web; -using namespace System::Collections; -using namespace System::Xml; -int main() -{ - try - { - ServiceDescription^ myDescription = ServiceDescription::Read( "AddNumbers_cs.wsdl" ); - - // Create the 'Binding' object. - Binding^ myBinding = gcnew Binding; - myBinding->Name = "PortServiceHttpPost"; - XmlQualifiedName^ qualifiedName = gcnew XmlQualifiedName( "s0:PortServiceHttpPost" ); - myBinding->Type = qualifiedName; - - // Create the 'HttpBinding' object. - HttpBinding^ myHttpBinding = gcnew HttpBinding; - myHttpBinding->Verb = "POST"; - - // Add the 'HttpBinding' to the 'Binding'. - myBinding->Extensions->Add( myHttpBinding ); - - // Create the 'OperationBinding' object. - OperationBinding^ myOperationBinding = gcnew OperationBinding; - myOperationBinding->Name = "AddNumbers"; - HttpOperationBinding^ myOperation = gcnew HttpOperationBinding; - myOperation->Location = "/AddNumbers"; - - // Add the 'HttpOperationBinding' to 'OperationBinding'. - myOperationBinding->Extensions->Add( myOperation ); - - // Create the 'InputBinding' object. - InputBinding^ myInput = gcnew InputBinding; - MimeContentBinding^ postMimeContentbinding = gcnew MimeContentBinding; - postMimeContentbinding->Type = "application/x-www-form-urlencoded"; - myInput->Extensions->Add( postMimeContentbinding ); - - // Add the 'InputBinding' to 'OperationBinding'. - myOperationBinding->Input = myInput; - - // Create the 'OutputBinding' object. - OutputBinding^ myOutput = gcnew OutputBinding; - MimeXmlBinding^ postMimeXmlbinding = gcnew MimeXmlBinding; - postMimeXmlbinding->Part = "Body"; - myOutput->Extensions->Add( postMimeXmlbinding ); - - // Add the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding->Output = myOutput; - - // Add the 'OperationBinding' to 'Binding'. - myBinding->Operations->Add( myOperationBinding ); - - // Add the 'Binding' to 'BindingCollection' of 'ServiceDescription'. - myDescription->Bindings->Add( myBinding ); - - // - // - // - // - // - // Create a Port. - Port^ postPort = gcnew Port; - postPort->Name = "PortServiceHttpPost"; - postPort->Binding = gcnew XmlQualifiedName( "s0:PortServiceHttpPost" ); - // - // - - // Create an HttpAddressBinding. - HttpAddressBinding^ postAddressBinding = gcnew HttpAddressBinding; - postAddressBinding->Location = "http://localhost/PortClass/PortService_cs.asmx"; - - // Add the HttpAddressBinding to the Port. - postPort->Extensions->Add( postAddressBinding ); - // - - // Get the Service of the postPort. - Service^ myService = postPort->Service; - - // Print the service name for the port. - Console::WriteLine( "This is the service name of the postPort:*{0}*", myDescription->Services[ 0 ]->Ports[ 0 ]->Service->Name ); - - // Add the Port to the PortCollection of the ServiceDescription. - myDescription->Services[ 0 ]->Ports->Add( postPort ); - // - // - - // Create a 'PortType' object. - PortType^ postPortType = gcnew PortType; - postPortType->Name = "PortServiceHttpPost"; - Operation^ postOperation = gcnew Operation; - postOperation->Name = "AddNumbers"; - OperationMessage^ postInput = dynamic_cast(gcnew OperationInput); - postInput->Message = gcnew XmlQualifiedName( "s0:AddNumbersHttpPostIn" ); - OperationMessage^ postOutput = dynamic_cast(gcnew OperationOutput); - postOutput->Message = gcnew XmlQualifiedName( "s0:AddNumbersHttpPostOut" ); - postOperation->Messages->Add( postInput ); - postOperation->Messages->Add( postOutput ); - - // Add the 'Operation' to 'PortType'. - postPortType->Operations->Add( postOperation ); - - // Adds the 'PortType' to 'PortTypeCollection' of 'ServiceDescription'. - myDescription->PortTypes->Add( postPortType ); - - // Create the 'Message' object. - Message^ postMessage1 = gcnew Message; - postMessage1->Name = "AddNumbersHttpPostIn"; - - // Create the 'MessageParts'. - MessagePart^ postMessagePart1 = gcnew MessagePart; - postMessagePart1->Name = "firstnumber"; - postMessagePart1->Type = gcnew XmlQualifiedName( "s:string" ); - MessagePart^ postMessagePart2 = gcnew MessagePart; - postMessagePart2->Name = "secondnumber"; - postMessagePart2->Type = gcnew XmlQualifiedName( "s:string" ); - - // Add the 'MessagePart' objects to 'Messages'. - postMessage1->Parts->Add( postMessagePart1 ); - postMessage1->Parts->Add( postMessagePart2 ); - - // Create another 'Message' object. - Message^ postMessage2 = gcnew Message; - postMessage2->Name = "AddNumbersHttpPostOut"; - MessagePart^ postMessagePart3 = gcnew MessagePart; - postMessagePart3->Name = "Body"; - postMessagePart3->Element = gcnew XmlQualifiedName( "s0:int" ); - - // Add the 'MessagePart' to 'Message' - postMessage2->Parts->Add( postMessagePart3 ); - - // Add the 'Message' objects to 'ServiceDescription'. - myDescription->Messages->Add( postMessage1 ); - myDescription->Messages->Add( postMessage2 ); - - // Write the 'ServiceDescription' as a WSDL file. - myDescription->Write( "AddNumbersOne.wsdl" ); - Console::WriteLine( "WSDL file with name 'AddNumbersOne.Wsdl' file created Successfully" ); - } - catch ( Exception^ ex ) - { - Console::WriteLine( "Exception {0} occurred", ex->Message ); - } -} diff --git a/snippets/cpp/VS_Snippets_Remoting/PortCollection_Add/CPP/portcollection_add.cpp b/snippets/cpp/VS_Snippets_Remoting/PortCollection_Add/CPP/portcollection_add.cpp deleted file mode 100644 index aea7134fd0b..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/PortCollection_Add/CPP/portcollection_add.cpp +++ /dev/null @@ -1,67 +0,0 @@ - - -// System.Web.Services.Description.PortCollection.Contains -// System.Web.Services.Description.PortCollection.Add -/* - The following sample reads the contents of a file 'MathServiceAdd_cs.wsdl' - into a 'ServiceDescription' instance. It gets the collection of Service - instances from 'ServiceDescription'. It then adds a new port and checks - whether a port exists. The programs writes a new web service description - file. -*/ -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Xml; -int main() -{ - try - { - Service^ myService; - PortCollection^ myPortCollection; - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MathServiceAdd_cs.wsdl" ); - Console::WriteLine( "\nTotal Number of Services :{0}", myServiceDescription->Services->Count ); - for ( int i = 0; i < myServiceDescription->Services->Count; ++i ) - { - myService = myServiceDescription->Services[ i ]; - Console::WriteLine( "Name : {0}", myService->Name ); - - // - // - myPortCollection = myService->Ports; - Port^ myNewPort = myPortCollection[ 0 ]; - myPortCollection->Remove( myNewPort ); - - // Display the number of ports. - Console::WriteLine( "\nTotal number of ports before adding a new port : {0}", myService->Ports->Count ); - - // Add a new port. - myPortCollection->Add( myNewPort ); - - // Display the number of ports after adding a port. - Console::WriteLine( "Total number of ports after adding a new port : {0}", myService->Ports->Count ); - // - - bool bContain = myPortCollection->Contains( myNewPort ); - Console::WriteLine( "\nPort '{0}' exists : {1}", myNewPort->Name, bContain ); - - // Remove a port from the collection. - myPortCollection->Remove( myPortCollection[ myNewPort->Name ] ); - bContain = myPortCollection->Contains( myNewPort ); - Console::WriteLine( "Port '{0}' exists : {1}", myNewPort->Name, bContain ); - - // Create the description file. - myPortCollection->Insert( 0, myNewPort ); - myServiceDescription->Write( "MathServiceAddNew_cs.wsdl" ); - // - - } - } - catch ( Exception^ ex ) - { - Console::WriteLine( "Exception:{0}", ex->Message ); - } -} diff --git a/snippets/cpp/VS_Snippets_Remoting/PortCollection_CopyTo/CPP/portcollection_copyto.cpp b/snippets/cpp/VS_Snippets_Remoting/PortCollection_CopyTo/CPP/portcollection_copyto.cpp deleted file mode 100644 index 3f20f18b74a..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/PortCollection_CopyTo/CPP/portcollection_copyto.cpp +++ /dev/null @@ -1,71 +0,0 @@ - - -// System.Web.Services.Description.PortCollection.Insert -// System.Web.Services.Description.PortCollection.IndexOf -// System.Web.Services.Description.PortCollection.CopyTo -/* - The following sample reads the contents of a file 'MathService.wsdl' - into a 'ServiceDescription' instance. It gets the collection of Service - instances from 'ServiceDescription'. It instantiates 'PortCollection' for - each service in the collection. 'CopyTo' is called to copy - the contents into an array. Calls 'IndexOf' for a given port. - 'Insert' method is called to insert a new port in the collection. -*/ -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Xml; - -int main() -{ - try - { - Service^ myService; - PortCollection^ myPortCollection; - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MathServiceCopyTo_cs.wsdl" ); - Console::WriteLine( "Total Number of Services :{0}", myServiceDescription->Services->Count ); - for ( int i = 0; i < myServiceDescription->Services->Count; ++i ) - { - myService = myServiceDescription->Services[ i ]; - Console::WriteLine( "Name : {0}", myService->Name ); - - // - // - // - myPortCollection = myService->Ports; - - // Create an array of Port objects. - Console::WriteLine( "\nPort collection :" ); - array^myPortArray = gcnew array(myService->Ports->Count); - myPortCollection->CopyTo( myPortArray, 0 ); - for ( int i1 = 0; i1 < myService->Ports->Count; ++i1 ) - { - Console::WriteLine( "Port[{0}] : {1}", i1, myPortArray[ i1 ]->Name ); - - } - // - Port^ myIndexPort = myPortCollection[ 0 ]; - Console::WriteLine( "\n\nThe index of port '{0}' is : {1}", myIndexPort->Name, myPortCollection->IndexOf( myIndexPort ) ); - // - - Port^ myPortTestInsert = myPortCollection[ 0 ]; - myPortCollection->Remove( myPortTestInsert ); - myPortCollection->Insert( 0, myPortTestInsert ); - Console::WriteLine( "\n\nTotal Number of Ports after inserting a new port '{0}' is : {1}", myPortTestInsert->Name, myService->Ports->Count ); - for ( int i1 = 0; i1 < myService->Ports->Count; ++i1 ) - { - Console::WriteLine( "Port[{0}] : {1}", i1, myPortArray[ i1 ]->Name ); - - } - myServiceDescription->Write( "MathServiceCopyToNew_cs.wsdl" ); - // - } - } - catch ( Exception^ ex ) - { - Console::WriteLine( "Exception:{0}", ex->Message ); - } -} diff --git a/snippets/cpp/VS_Snippets_Remoting/PortCollection_Item/CPP/portcollection_item.cpp b/snippets/cpp/VS_Snippets_Remoting/PortCollection_Item/CPP/portcollection_item.cpp deleted file mode 100644 index 2f9033c0d1c..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/PortCollection_Item/CPP/portcollection_item.cpp +++ /dev/null @@ -1,71 +0,0 @@ - - -// System.Web.Services.Description.PortCollection -// System.Web.Services.Description.PortCollection.Remove -// System.Web.Services.Description.PortCollection.Item(String) -// System.Web.Services.Description.PortCollection.Item(Int32) -/* - The following sample reads the contents of a file 'MathService_cs.wsdl' - into a 'ServiceDescription' instance. It gets the collection of Service - instances from 'ServiceDescription'. It instantiates 'PortCollection' for - each service in the collection. It access the ports from the collection and - displays them. It accesses a port by its name from the collection and - displays its index. It adds a new port and calls 'Remove' - to remove the newly added port. The programs writes a new web service - description file. -*/ -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; - -int main() -{ - try - { - // - // - // - // - Service^ myService; - PortCollection^ myPortCollection; - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MathServiceItem_cs.wsdl" ); - Console::WriteLine( "Total number of services : {0}", myServiceDescription->Services->Count ); - for ( int i = 0; i < myServiceDescription->Services->Count; ++i ) - { - myService = myServiceDescription->Services[ i ]; - Console::WriteLine( "Name : {0}", myService->Name ); - myPortCollection = myService->Ports; - - // Create an array of ports. - Console::WriteLine( "\nPort collection :" ); - for ( int i1 = 0; i1 < myService->Ports->Count; ++i1 ) - { - Console::WriteLine( "Port[{0}] : {1}", i1, myPortCollection[ i1 ]->Name ); - } - // - - String^ strPort = myPortCollection[ 0 ]->Name; - Port^ myPort = myPortCollection[ strPort ]; - Console::WriteLine( "\nIndex of Port[{0}] : {1}", strPort, myPortCollection->IndexOf( myPort ) ); - // - - Port^ myPortTestRemove = myPortCollection[ 0 ]; - Console::WriteLine( "\nTotal number of ports before removing a port '{0}' is : {1}", myPortTestRemove->Name, myService->Ports->Count ); - myPortCollection->Remove( myPortTestRemove ); - Console::WriteLine( "Total number of ports after removing a port '{0}' is : {1}", myPortTestRemove->Name, myService->Ports->Count ); - - // Create the WSDL file. - myPortCollection->Insert( 0, myPortTestRemove ); - myServiceDescription->Write( "MathServiceItemNew_cs.wsdl" ); - // - // - } - } - catch ( Exception^ ex ) - { - Console::WriteLine( "Exception: {0}", ex->Message ); - } -} diff --git a/snippets/cpp/VS_Snippets_Remoting/PortType/CPP/porttype.cpp b/snippets/cpp/VS_Snippets_Remoting/PortType/CPP/porttype.cpp deleted file mode 100644 index e6400fcfd3f..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/PortType/CPP/porttype.cpp +++ /dev/null @@ -1,75 +0,0 @@ - - -// System.Web.Services.Description.PortType.Operations -// System.Web.Services.Description.PortType.PortType() -// System.Web.Services.Description.PortType.Name -/*The following sample demonstrates the properties 'Operations','Name' and constructor -'PortType()' of class 'PortType'. This sample reads the contents of a file 'MathService_cs.wsdl' -into a 'ServiceDescription' instance. It gets the collection of 'PortType' -instances from 'ServiceDescription'. It removes a 'PortType' from the collection, creates a -new 'PortType' and adds it into collection. The programs writes a new web service description -file 'MathService_New.wsdl'. -*/ -// -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Xml; -Operation^ CreateOperation( String^ operationName, String^ inputMessage, String^ outputMessage, String^ targetNamespace ) -{ - Operation^ myOperation = gcnew Operation; - myOperation->Name = operationName; - OperationMessage^ input = dynamic_cast(gcnew OperationInput); - input->Message = gcnew XmlQualifiedName( inputMessage,targetNamespace ); - OperationMessage^ output = dynamic_cast(gcnew OperationOutput); - output->Message = gcnew XmlQualifiedName( outputMessage,targetNamespace ); - myOperation->Messages->Add( input ); - myOperation->Messages->Add( output ); - return myOperation; -} - -int main() -{ - try - { - // - // - PortTypeCollection^ myPortTypeCollection; - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MathService_CS.wsdl" ); - myPortTypeCollection = myServiceDescription->PortTypes; - int noOfPortTypes = myServiceDescription->PortTypes->Count; - Console::WriteLine( "\nTotal number of PortTypes : {0}", noOfPortTypes ); - PortType^ myPortType = myPortTypeCollection[ "MathServiceSoap" ]; - myPortTypeCollection->Remove( myPortType ); - - // Create a new PortType. - PortType^ myNewPortType = gcnew PortType; - myNewPortType->Name = "MathServiceSoap"; - OperationCollection^ myOperationCollection = myServiceDescription->PortTypes[ 0 ]->Operations; - String^ inputMsg; - String^ outputMsg; - for ( int i = 0; i < myOperationCollection->Count; i++ ) - { - inputMsg = String::Concat( myOperationCollection[ i ]->Name, "SoapIn" ); - outputMsg = String::Concat( myOperationCollection[ i ]->Name, "SoapOut" ); - Console::WriteLine( " Operation = {0}", myOperationCollection[ i ]->Name ); - myNewPortType->Operations->Add( CreateOperation( myOperationCollection[ i ]->Name, inputMsg, outputMsg, myServiceDescription->TargetNamespace ) ); - - } - myPortTypeCollection->Add( myNewPortType ); - noOfPortTypes = myServiceDescription->PortTypes->Count; - Console::WriteLine( "\nTotal number of PortTypes : {0}", noOfPortTypes ); - myServiceDescription->Write( "MathService_New.wsdl" ); - // - // - } - catch ( Exception^ e ) - { - Console::WriteLine( "Exception:{0}", e->Message ); - } - -} -// diff --git a/snippets/cpp/VS_Snippets_Remoting/PortTypeCollection_1/CPP/porttypecollection_1.cpp b/snippets/cpp/VS_Snippets_Remoting/PortTypeCollection_1/CPP/porttypecollection_1.cpp deleted file mode 100644 index bfaa4c38ac4..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/PortTypeCollection_1/CPP/porttypecollection_1.cpp +++ /dev/null @@ -1,59 +0,0 @@ - - -// System.Web.Services.Description.PortTypeCollection.Item[int] -// System.Web.Services.Description.PortTypeCollection.Remove() -// System.Web.Services.Description.PortTypeCollection.Add() -/*The following sample demonstrates the indexer 'Item[int]', methods -'Remove()' and 'Add()' of class 'PortTypeCollection'. It reads the -contents of a file 'MathService.wsdl'into a 'ServiceDescription' instance. -It gets the collection of 'PortType' from 'ServiceDescription' and adds -a new PortType and writes a new web service description file into -'MathService_New.wsdl'. -*/ -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Xml; - -int main() -{ - try - { - // - // - // - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MathService_CS.wsdl" ); - PortTypeCollection^ myPortTypeCollection = myServiceDescription->PortTypes; - int noOfPortTypes = myServiceDescription->PortTypes->Count; - Console::WriteLine( "\nTotal number of PortTypes: {0}", myServiceDescription->PortTypes->Count ); - - // Get the first PortType in the collection. - PortType^ myNewPortType = myPortTypeCollection[ 0 ]; - Console::WriteLine( "The PortType at index 0 is: {0}", myNewPortType->Name ); - Console::WriteLine( "Removing the PortType {0}", myNewPortType->Name ); - - // Remove the PortType from the collection. - myPortTypeCollection->Remove( myNewPortType ); - - // Display the number of PortTypes. - Console::WriteLine( "\nTotal number of PortTypes after removing: {0}", myServiceDescription->PortTypes->Count ); - Console::WriteLine( "Adding a PortType {0}", myNewPortType->Name ); - - // Add a new PortType from the collection. - myPortTypeCollection->Add( myNewPortType ); - - // Display the number of PortTypes after adding a port. - Console::WriteLine( "Total number of PortTypes after adding a new port: {0}", myServiceDescription->PortTypes->Count ); - myServiceDescription->Write( "MathService_New.wsdl" ); - // - // - // - } - catch ( Exception^ e ) - { - Console::WriteLine( "Exception: {0}", e->Message ); - } -} diff --git a/snippets/cpp/VS_Snippets_Remoting/PortTypeCollection_2/CPP/porttypecollection_2.cpp b/snippets/cpp/VS_Snippets_Remoting/PortTypeCollection_2/CPP/porttypecollection_2.cpp deleted file mode 100644 index 3a73b6fac7f..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/PortTypeCollection_2/CPP/porttypecollection_2.cpp +++ /dev/null @@ -1,68 +0,0 @@ - - -// System.Web.Services.Description.PortTypeCollection.Contains() -// System.Web.Services.Description.PortTypeCollection.Insert() -// System.Web.Services.Description.PortTypeCollection.IndexOf() -// System.Web.Services.Description.PortTypeCollection.Item[string] -/* -The following sample demonstrates the methods 'IndexOf()','Insert()','Contains()' and -indexer 'Item[string]' of class 'PortTypeCollection'. This sample reads the contents -of 'MathService.wsdl' into a 'ServiceDescription' instance. It gets the collection of -'PortType' instances from 'ServiceDescription'. It removes a 'PortType' with the name -'MathServiceSoap' and adds the same later. Then it checks whether the collection contains -the added 'PortType'. The sample writes a new web service description file 'MathService_New.wsdl'. -*/ -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Xml; -int main() -{ - try - { - // - // - // - // - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MathService_CS.wsdl" ); - PortTypeCollection^ myPortTypeCollection = myServiceDescription->PortTypes; - int noOfPortTypes = myServiceDescription->PortTypes->Count; - Console::WriteLine( "\nTotal number of PortTypes: {0}", noOfPortTypes ); - PortType^ myNewPortType = myPortTypeCollection[ "MathServiceSoap" ]; - // - - // Get the index in the collection. - int index = myPortTypeCollection->IndexOf( myNewPortType ); - // - - Console::WriteLine( "Removing the PortType named {0}", myNewPortType->Name ); - - // Remove the PortType from the collection. - myPortTypeCollection->Remove( myNewPortType ); - noOfPortTypes = myServiceDescription->PortTypes->Count; - Console::WriteLine( "\nTotal number of PortTypes: {0}", noOfPortTypes ); - - // Check whether the PortType exists in the collection. - bool bContains = myPortTypeCollection->Contains( myNewPortType ); - Console::WriteLine( "Port Type'{0}' exists: {1}", myNewPortType->Name, bContains ); - Console::WriteLine( "Adding the PortType" ); - - // Insert a new portType at the index location. - myPortTypeCollection->Insert( index, myNewPortType ); - // - - // Display the number of portTypes after adding a port. - Console::WriteLine( "Total number of PortTypes after adding a new port: {0}", myServiceDescription->PortTypes->Count ); - bContains = myPortTypeCollection->Contains( myNewPortType ); - Console::WriteLine( "Port Type'{0}' exists: {1}", myNewPortType->Name, bContains ); - myServiceDescription->Write( "MathService_New.wsdl" ); - // - } - catch ( Exception^ e ) - { - Console::WriteLine( "Exception: {0}", e->Message ); - } -} diff --git a/snippets/cpp/VS_Snippets_Remoting/PortTypeCollection_Class/CPP/porttypecollection_class.cpp b/snippets/cpp/VS_Snippets_Remoting/PortTypeCollection_Class/CPP/porttypecollection_class.cpp deleted file mode 100644 index a0c7a4790fc..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/PortTypeCollection_Class/CPP/porttypecollection_class.cpp +++ /dev/null @@ -1,64 +0,0 @@ - - -// System.Web.Services.Description.PortTypeCollection -/* The following sample demonstrates the class 'PortTypeCollection'. It reads the -contents of WSDL document 'MathService.wsdl'into a 'ServiceDescription' instance. -It gets the collection of 'PortType'from 'ServiceDescription'. It copies the -collection into an array of 'PortType' and displays their names. Then it removes a -'PortType', checks whether the collection contains the removed 'PortType'. -It adds the same 'PortType' and writes a new web service description file into -'MathService_New.wsdl'. -*/ -// -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Xml; -using namespace System::Collections; -int main() -{ - try - { - // Read the existing Web service description file. - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MathService_CS.wsdl" ); - PortTypeCollection^ myPortTypeCollection = myServiceDescription->PortTypes; - int noOfPortTypes = myServiceDescription->PortTypes->Count; - Console::WriteLine( "\nTotal number of PortTypes: {0}", myServiceDescription->PortTypes->Count ); - - // Get the first PortType in the collection. - PortType^ myNewPortType = myPortTypeCollection[ "MathServiceSoap" ]; - int index = myPortTypeCollection->IndexOf( myNewPortType ); - Console::WriteLine( "The PortType with the name {0} is at index: {1}", myNewPortType->Name, (index + 1) ); - Console::WriteLine( "Removing the PortType: {0}", myNewPortType->Name ); - - // Remove the PortType from the collection. - myPortTypeCollection->Remove( myNewPortType ); - bool bContains = myPortTypeCollection->Contains( myNewPortType ); - Console::WriteLine( "The PortType with the name {0} exists: {1}", myNewPortType->Name, bContains ); - Console::WriteLine( "Total number of PortTypes after removing: {0}", myServiceDescription->PortTypes->Count ); - Console::WriteLine( "Adding a PortType: {0}", myNewPortType->Name ); - - // Add a new portType from the collection. - myPortTypeCollection->Add( myNewPortType ); - - // Display the number of portTypes after adding a port. - Console::WriteLine( "Total number of PortTypes after adding a new port: {0}", myServiceDescription->PortTypes->Count ); - - // List the PortTypes available in the WSDL document. - IEnumerator^ myEnum = myPortTypeCollection->GetEnumerator(); - while ( myEnum->MoveNext() ) - { - PortType^ myPortType = safe_cast(myEnum->Current); - Console::WriteLine( "The PortType name is: {0}", myPortType->Name ); - } - myServiceDescription->Write( "MathService_New.wsdl" ); - } - catch ( Exception^ e ) - { - Console::WriteLine( "Exception: {0}", e->Message ); - } -} -// diff --git a/snippets/cpp/VS_Snippets_Remoting/PortTypeCollection_CopyTo/CPP/porttypecollection_copyto.cpp b/snippets/cpp/VS_Snippets_Remoting/PortTypeCollection_CopyTo/CPP/porttypecollection_copyto.cpp deleted file mode 100644 index f5b3a9694c0..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/PortTypeCollection_CopyTo/CPP/porttypecollection_copyto.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// System.Web.Services.Description.PortTypeCollection.CopyTo() - -/* -The following sample demonstrates the 'CopyTo()' method of the class -'PortTypeCollection'. This sample reads the contents of a file 'MathService.wsdl' -into a 'ServiceDescription' instance. It gets the collection of 'PortType' -from 'ServiceDescription'. It copies the collection into an array of 'PortType' -and displays their names. -*/ - -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Xml; - -int main() -{ - try - { -// - PortTypeCollection^ myPortTypeCollection; - - ServiceDescription^ myServiceDescription = - ServiceDescription::Read( "MathService_CS.wsdl" ); - - myPortTypeCollection = myServiceDescription->PortTypes; - int noOfPortTypes = myServiceDescription->PortTypes->Count; - Console::WriteLine( "\nTotal number of PortTypes: {0}", - myServiceDescription->PortTypes->Count ); - - // Copy the collection into an array. - array^ myPortTypeArray = gcnew array(noOfPortTypes); - myPortTypeCollection->CopyTo( myPortTypeArray, 0 ); - - // Display names of all PortTypes. - for ( int i = 0; i < noOfPortTypes; i++ ) - { - Console::WriteLine( "PortType name: {0}", myPortTypeArray[ i ]->Name ); - } - myServiceDescription->Write( "MathService_New.wsdl" ); -// - } - catch ( Exception^ e ) - { - Console::WriteLine( "Exception: {0}", e->Message ); - } -} diff --git a/snippets/cpp/VS_Snippets_Remoting/PortType_Class/CPP/porttype_class.cpp b/snippets/cpp/VS_Snippets_Remoting/PortType_Class/CPP/porttype_class.cpp deleted file mode 100644 index a8935574cb1..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/PortType_Class/CPP/porttype_class.cpp +++ /dev/null @@ -1,71 +0,0 @@ - - -// System.Web.Services.Description.PortType -/* -The following sample demonstrates the class 'PortType'. This sample reads -the contents of a file 'MathService_cs.wsdl' into a 'ServiceDescription' instance. -It gets the collection of 'PortType' instances from 'ServiceDescription'. -It removes a 'PortType' from the collection, creates a new 'PortType' and adds -it into collection. The programs writes a new web service description -file 'MathService_New.wsdl'. -*/ -// -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Xml; -Operation^ CreateOperation( String^ operationName, String^ inputMessage, String^ outputMessage, String^ targetNamespace ) -{ - Operation^ myOperation = gcnew Operation; - myOperation->Name = operationName; - OperationMessage^ input = dynamic_cast(gcnew OperationInput); - input->Message = gcnew XmlQualifiedName( inputMessage,targetNamespace ); - OperationMessage^ output = dynamic_cast(gcnew OperationOutput); - output->Message = gcnew XmlQualifiedName( outputMessage,targetNamespace ); - myOperation->Messages->Add( input ); - myOperation->Messages->Add( output ); - return myOperation; -} - -int main() -{ - try - { - PortTypeCollection^ myPortTypeCollection; - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MathService_CS.wsdl" ); - myPortTypeCollection = myServiceDescription->PortTypes; - int noOfPortTypes = myServiceDescription->PortTypes->Count; - Console::WriteLine( "\nTotal number of PortTypes : {0}", noOfPortTypes ); - PortType^ myPortType = myPortTypeCollection[ "MathServiceSoap" ]; - myPortTypeCollection->Remove( myPortType ); - - // Create a new PortType. - PortType^ myNewPortType = gcnew PortType; - myNewPortType->Name = "MathServiceSoap"; - OperationCollection^ myOperationCollection = myServiceDescription->PortTypes[ 0 ]->Operations; - for ( int i = 0; i < myOperationCollection->Count; i++ ) - { - String^ inputmsg = String::Concat( myOperationCollection[ i ]->Name, "SoapIn" ); - String^ outputmsg = String::Concat( myOperationCollection[ i ]->Name, "SoapOut" ); - Console::WriteLine( "Operation = {0}", myOperationCollection[ i ]->Name ); - myNewPortType->Operations->Add( CreateOperation( myOperationCollection[ i ]->Name, inputmsg, outputmsg, myServiceDescription->TargetNamespace ) ); - - } - - // Add the PortType to the collection. - myPortTypeCollection->Add( myNewPortType ); - noOfPortTypes = myServiceDescription->PortTypes->Count; - Console::WriteLine( "\nTotal Number of PortTypes : {0}", noOfPortTypes ); - myServiceDescription->Write( "MathService_New.wsdl" ); - } - catch ( Exception^ e ) - { - Console::WriteLine( "Exception: {0}", e->Message ); - } - -} - -// diff --git a/snippets/cpp/VS_Snippets_Remoting/ServiceClass/CPP/serviceclass.cpp b/snippets/cpp/VS_Snippets_Remoting/ServiceClass/CPP/serviceclass.cpp deleted file mode 100644 index 5dc403fbd36..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/ServiceClass/CPP/serviceclass.cpp +++ /dev/null @@ -1,84 +0,0 @@ -// System.Web.Services.Description.Service - -/* The following sample demonstrates the class 'Service'. This sample reads the -contents of a file 'MathService_cs.wsdl' into a 'ServiceDescription' instance. -It gets the collection of Service instances from 'ServiceDescription'. It -then removes a 'Service' from the collection and creates a new 'Service' and -adds it into collection. It writes a new web service description file 'MathService_New.wsdl'. -*/ - -// -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Xml; - -Port^ CreatePort( String^ PortName, String^ BindingName, String^ targetNamespace ) -{ - Port^ myPort = gcnew Port; - myPort->Name = PortName; - myPort->Binding = gcnew XmlQualifiedName( BindingName,targetNamespace ); - - // Create a SoapAddress extensibility element to add to the port. - SoapAddressBinding^ mySoapAddressBinding = gcnew SoapAddressBinding; - mySoapAddressBinding->Location = "http://localhost/ServiceClass/MathService_CS.asmx"; - myPort->Extensions->Add( mySoapAddressBinding ); - return myPort; -} - -int main() -{ - try - { - // Read a WSDL document. - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MathService_CS.wsdl" ); - ServiceCollection^ myServiceCollection = myServiceDescription->Services; - int noOfServices = myServiceCollection->Count; - Console::WriteLine( "\nTotal number of services: {0}", noOfServices ); - - // Gets a reference to the service. - Service^ myOldService = myServiceCollection[ 0 ]; - Console::WriteLine( "No. of ports in the service: {0}", myServiceCollection[ 0 ]->Ports->Count ); - Console::WriteLine( "These are the ports in the service:" ); - for ( int i = 0; i < myOldService->Ports->Count; i++ ) - Console::WriteLine( "Port name: {0}", myOldService->Ports[ i ]->Name ); - Console::WriteLine( "Service name: {0}", myOldService->Name ); - Service^ myService = gcnew Service; - myService->Name = "MathService"; - - // Add the Ports to the newly created Service. - for ( int i = 0; i < myOldService->Ports->Count; i++ ) - { - String^ PortName = myServiceCollection[ 0 ]->Ports[ i ]->Name; - String^ BindingName = myServiceCollection[ 0 ]->Ports[ i ]->Binding->Name; - myService->Ports->Add( CreatePort( PortName, BindingName, myServiceDescription->TargetNamespace ) ); - } - Console::WriteLine( "Newly created ports -" ); - for ( int i = 0; i < myService->Ports->Count; i++ ) - Console::WriteLine( "Port name: {0}", myOldService->Ports[ i ]->Name ); - - // Add the extensions to the newly created Service. - int noOfExtensions = myOldService->Extensions->Count; - Console::WriteLine( "No. of extensions: {0}", noOfExtensions ); - if ( noOfExtensions > 0 ) - { - for ( int i = 0; i < myOldService->Ports->Count; i++ ) - myService->Extensions->Add( myServiceCollection[ 0 ]->Extensions[ i ] ); - } - - // Remove the service from the collection. - myServiceCollection->Remove( myOldService ); - - // Add the newly created service. - myServiceCollection->Add( myService ); - myServiceDescription->Write( "MathService_New.wsdl" ); - } - catch ( Exception^ e ) - { - Console::WriteLine( "Exception: {0}", e->Message ); - } -} -// diff --git a/snippets/cpp/VS_Snippets_Remoting/ServiceCollection_CopyTo/CPP/servicecollection_copyto.cpp b/snippets/cpp/VS_Snippets_Remoting/ServiceCollection_CopyTo/CPP/servicecollection_copyto.cpp deleted file mode 100644 index 8935936e70f..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/ServiceCollection_CopyTo/CPP/servicecollection_copyto.cpp +++ /dev/null @@ -1,111 +0,0 @@ -// System.Web.Services.Description.ServiceCollection.Contains(Service) -// System.Web.Services.Description.ServiceCollection.IndexOf(service) -// System.Web.Services.Description.ServiceCollection.CopyTo(System[],int) - -/* -The following program demonstrates the methods of -ServiceDescription and ServiceCollection class. An existing WSDL document -is read. An exiting service named "MathService" is removed from the -collection. A new Service object is constructed and added at index 1 of the -Collection .A new WSDL file is created as output. -*/ - -#using -#using -#using - -using namespace System; -using namespace System::Text; -using namespace System::Web::Services::Description; -using namespace System::Collections; -using namespace System::IO; -using namespace System::Xml; -int main() -{ - try - { - // Read the Existing Wsdl. - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "AddSubtractService_CS.wsdl" ); - - // Remove the service named "MathService". - ServiceCollection^ myServiceDescriptionCollection = myServiceDescription->Services; - myServiceDescriptionCollection->Remove( myServiceDescription->Services[ "MathService" ] ); - - // Build a new Service. - Service^ myService = gcnew Service; - myService->Name = "MathService"; - XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "s0:MathServiceSoap" ); - - // Build a new Port for Soap. - Port^ mySoapPort = gcnew Port; - mySoapPort->Name = "MathServiceSoap"; - mySoapPort->Binding = myXmlQualifiedName; - SoapAddressBinding^ mySoapAddressBinding = gcnew SoapAddressBinding; - mySoapAddressBinding->Location = "http://localhost/ServiceCollection_CopyTo/AddSubtractService_CS.asmx"; - mySoapPort->Extensions->Add( mySoapAddressBinding ); - - // Build a new Port for HttpGet. - XmlQualifiedName^ myXmlQualifiedName2 = gcnew XmlQualifiedName( "s0:MathServiceHttpGet" ); - Port^ myHttpGetPort = gcnew Port; - myHttpGetPort->Name = "MathServiceHttpGet"; - myHttpGetPort->Binding = myXmlQualifiedName2; - HttpAddressBinding^ myHttpAddressBinding = gcnew HttpAddressBinding; - myHttpAddressBinding->Location = "http://localhost/ServiceCollection_CopyTo/AddSubtractService_CS.asmx"; - myHttpGetPort->Extensions->Add( myHttpAddressBinding ); - - // Build a new Port for HttpPost. - XmlQualifiedName^ myXmlQualifiedName3 = gcnew XmlQualifiedName( "s0:MathServiceHttpPost" ); - - // Build a new Port for Soap. - Port^ myHttpPostPort = gcnew Port; - myHttpPostPort->Name = "MathServiceHttpPost"; - myHttpPostPort->Binding = myXmlQualifiedName3; - HttpAddressBinding^ myHttpAddressBinding1 = gcnew HttpAddressBinding; - myHttpAddressBinding1->Location = "http://localhost/ServiceCollection_CopyTo/AddSubtractService_CS.asmx"; - myHttpPostPort->Extensions->Add( myHttpAddressBinding1 ); - - // Add the ports to the service. - myService->Ports->Add( mySoapPort ); - myService->Ports->Add( myHttpGetPort ); - myService->Ports->Add( myHttpPostPort ); - - // Add the Service to the ServiceCollection. - myServiceDescription->Services->Insert( 1, myService ); - StreamWriter^ myStreamWriter = gcnew StreamWriter( "output.wsdl" ); - - // Output the Wsdl. - myServiceDescription->Write( myStreamWriter ); - myStreamWriter->Close(); - - // - // - if ( myServiceDescription->Services->Contains( myService ) ) - { - Console::WriteLine( "The mentioned service exists at index {0} in the WSDL.", myServiceDescription->Services->IndexOf( myService ) ); - - // - array^myServiceArray = gcnew array(myServiceDescription->Services->Count); - - // Copy the services into an array. - myServiceDescription->Services->CopyTo( myServiceArray, 0 ); - IEnumerator^ myEnumerator = myServiceArray->GetEnumerator(); - Console::WriteLine( "The names of services in the array are" ); - while ( myEnumerator->MoveNext() ) - { - Service^ myService1 = dynamic_cast(myEnumerator->Current); - Console::WriteLine( myService1->Name ); - } - // - } - else - { - Console::WriteLine( "Service does not exist in the WSDL." ); - } - // - // - } - catch ( Exception^ e ) - { - Console::WriteLine( "Exception Caught! {0}", e->Message ); - } -} diff --git a/snippets/cpp/VS_Snippets_Remoting/ServiceCollection_Item/CPP/servicecollection_item.cpp b/snippets/cpp/VS_Snippets_Remoting/ServiceCollection_Item/CPP/servicecollection_item.cpp deleted file mode 100644 index d0089a0774c..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/ServiceCollection_Item/CPP/servicecollection_item.cpp +++ /dev/null @@ -1,80 +0,0 @@ -// System.Web.Services.Description.ServiceDescription.Write(FileName) -// System.Web.Services.Description.ServiceCollection.Remove -// System.Web.Services.Description.ServiceCollection.Item(int) -// System.Web.Services.Description.ServiceDescription.Services -// System.Web.Services.Description.ServiceDescription.TargetNamespace -// System.Web.Services.Description.ServiceCollection.Add - -/* -The following example demonstrates methods and properties of the -ServiceDescription and ServiceCollection classes. -A new WSDL is read and the existing service "MathService" in the -ServiceCollection is removed. The service by default is defined for -SOAP, HttpGet, HttpPost. A new Service defined for SOAP and HttpGet is -constructed and added to the ServiceCollection. -The programs writes a new web service description file. -*/ - -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Collections; -using namespace System::Xml; -int main() -{ - // - // - // - // - // - // Read a ServiceDescription from existing WSDL. - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "Input_CS.wsdl" ); - myServiceDescription->TargetNamespace = "http://tempuri.org/"; - // - - // Get the ServiceCollection of the ServiceDescription. - ServiceCollection^ myServiceCollection = myServiceDescription->Services; - - // Remove the Service at index 0 of the collection. - myServiceCollection->Remove( myServiceDescription->Services[ 0 ] ); - // - // - // - // - // Build a new Service. - Service^ myService = gcnew Service; - myService->Name = "MathService"; - XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "s0:MathServiceSoap" ); - - // Build a new Port for SOAP. - Port^ mySoapPort = gcnew Port; - mySoapPort->Name = "MathServiceSoap"; - mySoapPort->Binding = myXmlQualifiedName; - SoapAddressBinding^ mySoapAddressBinding = gcnew SoapAddressBinding; - mySoapAddressBinding->Location = "http://localhost/ServiceCollection_Item/AddSub_CS.asmx"; - mySoapPort->Extensions->Add( mySoapAddressBinding ); - - // Build a new Port for HTTP-GET. - XmlQualifiedName^ myXmlQualifiedName2 = gcnew XmlQualifiedName( "s0:MathServiceHttpGet" ); - Port^ myHttpGetPort = gcnew Port; - myHttpGetPort->Name = "MathServiceHttpGet"; - myHttpGetPort->Binding = myXmlQualifiedName2; - HttpAddressBinding^ myHttpAddressBinding = gcnew HttpAddressBinding; - myHttpAddressBinding->Location = "http://localhost/ServiceCollection_Item/AddSub_CS.asmx"; - myHttpGetPort->Extensions->Add( myHttpAddressBinding ); - - // Add the ports to the service. - myService->Ports->Add( myHttpGetPort ); - myService->Ports->Add( mySoapPort ); - - // Add the service to the ServiceCollection. - myServiceCollection->Add( myService ); - - // - // Write to a new WSDL file. - myServiceDescription->Write( "output.wsdl" ); - // -} diff --git a/snippets/cpp/VS_Snippets_Remoting/ServiceDescription/CPP/servicedescription.cpp b/snippets/cpp/VS_Snippets_Remoting/ServiceDescription/CPP/servicedescription.cpp deleted file mode 100644 index fa70e899296..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/ServiceDescription/CPP/servicedescription.cpp +++ /dev/null @@ -1,84 +0,0 @@ -// System.Web.Services.Description.ServiceDescription - -/* -The following example demonstrates the 'ServiceDescription' class. -The input to the program is a WSDL file 'MyWsdl.wsdl'. -This program removes one 'Binding' from the existing WSDL. -A new Binding is defined and added to the ServiceDescription object. -The program generates a new Web Service Description document. -*/ - -#using -#using -#using - -using namespace System; -using namespace System::Web::Services; -using namespace System::Web::Services::Description; -using namespace System::Xml; - -// Used to create OperationBinding instances within 'Binding'. -OperationBinding^ CreateOperationBinding( String^ operation, String^ targetNamespace ) -{ - // Create OperationBinding instance for operation. - OperationBinding^ myOperationBinding = gcnew OperationBinding; - myOperationBinding->Name = operation; - - // Create InputBinding for operation. - InputBinding^ myInputBinding = gcnew InputBinding; - SoapBodyBinding^ mySoapBodyBinding = gcnew SoapBodyBinding; - mySoapBodyBinding->Use = SoapBindingUse::Literal; - myInputBinding->Extensions->Add( mySoapBodyBinding ); - - // Create OutputBinding for operation. - OutputBinding^ myOutputBinding = gcnew OutputBinding; - myOutputBinding->Extensions->Add( mySoapBodyBinding ); - - // Add 'InputBinding' and 'OutputBinding' to 'OperationBinding'. - myOperationBinding->Input = myInputBinding; - myOperationBinding->Output = myOutputBinding; - - // Create extensibility element for 'SoapOperationBinding'. - SoapOperationBinding^ mySoapOperationBinding = gcnew SoapOperationBinding; - mySoapOperationBinding->Style = SoapBindingStyle::Document; - mySoapOperationBinding->SoapAction = targetNamespace + operation; - - // Add extensibility element 'SoapOperationBinding' to 'OperationBinding'. - myOperationBinding->Extensions->Add( mySoapOperationBinding ); - return myOperationBinding; -} - -int main() -{ - try - { - // - // Obtain the ServiceDescription of existing Wsdl. - ServiceDescription^ myDescription = ServiceDescription::Read( "MyWsdl_CS.wsdl" ); - - // Remove the Binding from the Binding Collection of ServiceDescription. - BindingCollection^ myBindingCollection = myDescription->Bindings; - myBindingCollection->Remove( myBindingCollection[ 0 ] ); - - // Form a new Binding. - Binding^ myBinding = gcnew Binding; - myBinding->Name = "Service1Soap"; - XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "s0:Service1Soap" ); - myBinding->Type = myXmlQualifiedName; - SoapBinding^ mySoapBinding = gcnew SoapBinding; - mySoapBinding->Transport = "http://schemas.xmlsoap.org/soap/http"; - mySoapBinding->Style = SoapBindingStyle::Document; - OperationBinding^ addOperationBinding = CreateOperationBinding( "Add", myDescription->TargetNamespace ); - myBinding->Operations->Add( addOperationBinding ); - myBinding->Extensions->Add( mySoapBinding ); - - // Add the Binding to the ServiceDescription. - myDescription->Bindings->Add( myBinding ); - myDescription->Write( "MyOutWsdl.wsdl" ); - // - } - catch ( Exception^ e ) - { - Console::WriteLine( "Exception :{0}", e->Message ); - } -} diff --git a/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionBaseCollection/CPP/servicedescriptionbasecollection.cpp b/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionBaseCollection/CPP/servicedescriptionbasecollection.cpp deleted file mode 100644 index a8845c0e0db..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionBaseCollection/CPP/servicedescriptionbasecollection.cpp +++ /dev/null @@ -1,192 +0,0 @@ - - -// System.Web.Services.Description.ServiceDescriptionBaseCollection. -/* -The following example demonstrates 'ServiceDescriptionBaseCollection' class. -A 'ServiceDescription' instance is obtained from the existing Wsdl. -'MyMethod' takes an instance of 'ServiceDescriptionBaseCollection' as a parameter. -Instance of different types of collections that were actually derived from -'ServiceDescriptionBaseCollection' are passed to my method and modifications of -corresponding instances in done. -*/ -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Collections; -using namespace System::Xml; -ref class ServiceDescription_Sample -{ -public: - static ServiceDescription^ myServiceDescription; - static void Main() - { - // Read a ServiceDescription of existing WSDL. - myServiceDescription = ServiceDescription::Read( "Input_CS.wsdl" ); - - // Get the ServiceCollection of the ServiceDescription. - ServiceCollection^ myServiceCollection = myServiceDescription->Services; - MyMethod( myServiceCollection ); - BindingCollection^ myBindingCollection = myServiceDescription->Bindings; - MyMethod( myBindingCollection ); - PortTypeCollection^ myPortTypeCollection = myServiceDescription->PortTypes; - MyMethod( myPortTypeCollection ); - myServiceDescription->Write( "Output.Wsdl" ); - } - - // - static void MyMethod( ServiceDescriptionBaseCollection^ myServiceCollection ) - { - Type^ myType = myServiceCollection->GetType(); - if ( myType->Equals( System::Web::Services::Description::ServiceCollection::typeid ) ) - { - // Remove the services at index 0 of the collection. - (dynamic_cast(myServiceCollection))->Remove( myServiceDescription->Services[ 0 ] ); - - // Build a new Service. - Service^ myService = gcnew Service; - myService->Name = "MathService"; - XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "s0:MathServiceSoap" ); - - // Build a new Port for SOAP. - Port^ mySoapPort = gcnew Port; - mySoapPort->Name = "MathServiceSoap"; - mySoapPort->Binding = myXmlQualifiedName; - SoapAddressBinding^ mySoapAddressBinding = gcnew SoapAddressBinding; - mySoapAddressBinding->Location = "http://localhost/" - "ServiceDescriptionBaseCollection/AddSubtractService.CS.asmx"; - mySoapPort->Extensions->Add( mySoapAddressBinding ); - - // Build a new Port for HTTP-GET. - XmlQualifiedName^ myXmlQualifiedName2 = gcnew XmlQualifiedName( "s0:MathServiceHttpGet" ); - Port^ myHttpGetPort = gcnew Port; - myHttpGetPort->Name = "MathServiceHttpGet"; - myHttpGetPort->Binding = myXmlQualifiedName2; - HttpAddressBinding^ myHttpAddressBinding = gcnew HttpAddressBinding; - myHttpAddressBinding->Location = "http://localhost/" - "ServiceDescriptionBaseCollection/AddSubtractService.CS.asmx"; - myHttpGetPort->Extensions->Add( myHttpAddressBinding ); - - // Add the ports to the Service. - myService->Ports->Add( myHttpGetPort ); - myService->Ports->Add( mySoapPort ); - - // Add the Service to the ServiceCollection. - myServiceDescription->Services->Add( myService ); - } - else - if ( myType->Equals( System::Web::Services::Description::BindingCollection::typeid ) ) - { - // Remove the Binding in the BindingCollection at index 0. - (dynamic_cast(myServiceCollection))->Remove( myServiceDescription->Bindings[ 0 ] ); - - // Build a new Binding. - Binding^ myBinding = gcnew Binding; - myBinding->Name = "MathServiceSoap"; - XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "s0:MathServiceSoap" ); - myBinding->Type = myXmlQualifiedName; - SoapBinding^ mySoapBinding = gcnew SoapBinding; - mySoapBinding->Transport = "http://schemas.xmlsoap.org/soap/http"; - mySoapBinding->Style = SoapBindingStyle::Document; - - // Create the operations for the binding. - OperationBinding^ addOperationBinding = CreateOperationBinding( "Add", myServiceDescription->TargetNamespace ); - OperationBinding^ subtractOperationBinding = CreateOperationBinding( "Subtract", myServiceDescription->TargetNamespace ); - - // Add the operations to the Binding. - myBinding->Operations->Add( subtractOperationBinding ); - myBinding->Operations->Add( addOperationBinding ); - myBinding->Extensions->Add( mySoapBinding ); - - // Add the Binding to the Bindings collection. - myServiceDescription->Bindings->Add( myBinding ); - } - else - if ( myType->Equals( System::Web::Services::Description::PortTypeCollection::typeid ) ) - { - // Remove the PortType at index 0. - (dynamic_cast(myServiceCollection))->Remove( myServiceDescription->PortTypes[ 0 ] ); - - // Build a new PortType. - PortType^ myPortType = gcnew PortType; - myPortType->Name = "MathServiceSoap"; - - // Build an Add Operation for the PortType. - Operation^ myAddOperation = gcnew Operation; - myAddOperation->Name = "Add"; - - // Build the Input and Output messages for the Operations. - OperationInput^ myOperationInputMessage1 = gcnew OperationInput; - XmlQualifiedName^ myXmlQualifiedName1 = gcnew XmlQualifiedName( "s0:AddSoapIn" ); - myOperationInputMessage1->Message = myXmlQualifiedName1; - OperationOutput^ myOperationOutputMessage1 = gcnew OperationOutput; - XmlQualifiedName^ myXmlQualifiedName2 = gcnew XmlQualifiedName( "s0:AddSoapOut" ); - myOperationOutputMessage1->Message = myXmlQualifiedName2; - - // Add the messages to the operations. - myAddOperation->Messages->Add( myOperationInputMessage1 ); - myAddOperation->Messages->Add( myOperationOutputMessage1 ); - - // Build an Add Operation for the PortType. - Operation^ mySubtractOperation = gcnew Operation; - mySubtractOperation->Name = "Subtract"; - - // Build the Input and Output messages for the operations. - OperationInput^ myOperationInputMessage2 = gcnew OperationInput; - XmlQualifiedName^ myXmlQualifiedName3 = gcnew XmlQualifiedName( "s0:SubtractSoapIn" ); - myOperationInputMessage2->Message = myXmlQualifiedName3; - OperationOutput^ myOperationOutputMessage2 = gcnew OperationOutput; - XmlQualifiedName^ myXmlQualifiedName4 = gcnew XmlQualifiedName( "s0:SubtractSoapOut" ); - myOperationOutputMessage2->Message = myXmlQualifiedName4; - - // Add the messages to the operations. - mySubtractOperation->Messages->Add( myOperationInputMessage2 ); - mySubtractOperation->Messages->Add( myOperationOutputMessage2 ); - - // Add the operations to the PortType. - myPortType->Operations->Add( myAddOperation ); - myPortType->Operations->Add( mySubtractOperation ); - - // Add the PortType to the collection. - myServiceDescription->PortTypes->Add( myPortType ); - } - } - // - - static OperationBinding^ CreateOperationBinding( String^ operation, String^ targetNamespace ) - { - // Create OperationBinding instance for operation. - OperationBinding^ myOperationBinding = gcnew OperationBinding; - myOperationBinding->Name = operation; - - // Create InputBinding for operation. - InputBinding^ myInputBinding = gcnew InputBinding; - SoapBodyBinding^ mySoapBodyBinding = gcnew SoapBodyBinding; - mySoapBodyBinding->Use = SoapBindingUse::Literal; - myInputBinding->Extensions->Add( mySoapBodyBinding ); - - // Create OutputBinding for operation. - OutputBinding^ myOutputBinding = gcnew OutputBinding; - myOutputBinding->Extensions->Add( mySoapBodyBinding ); - - // Add 'InputBinding' and 'OutputBinding' to 'OperationBinding'. - myOperationBinding->Input = myInputBinding; - myOperationBinding->Output = myOutputBinding; - - // Create extensibility element for 'SoapOperationBinding'. - SoapOperationBinding^ mySoapOperationBinding = gcnew SoapOperationBinding; - mySoapOperationBinding->Style = SoapBindingStyle::Document; - mySoapOperationBinding->SoapAction = String::Concat( targetNamespace, operation ); - - // Add extensibility element 'SoapOperationBinding' to 'OperationBinding'. - myOperationBinding->Extensions->Add( mySoapOperationBinding ); - return myOperationBinding; - } -}; - -int main() -{ - ServiceDescription_Sample::Main(); -} diff --git a/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionCollection/CPP/servicedescriptioncollection.cpp b/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionCollection/CPP/servicedescriptioncollection.cpp deleted file mode 100644 index 3a27bf22ab5..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionCollection/CPP/servicedescriptioncollection.cpp +++ /dev/null @@ -1,57 +0,0 @@ - - -// System::Web::Services::Description.ServiceDescriptionCollection -/*The following program demonstrates the 'ServiceDescriptionCollection' class. -It creates two 'ServiceDescription' objects and add them to -'ServiceDescriptionCollection' Object*. It displays the name of 'ServiceDescription' -objects using 'Item' property. 'GetBinding' method is used to display binding instance of the -'ServiceDescription' Object*. - -Note: This program requires 'DataTypes_CS.wsdl' and 'MathService_cpp.wsdl' files to -be placed in same directory as that of .exe for running. -*/ -// -#using -#using - -using namespace System; -using namespace System::Xml; -using namespace System::Web::Services::Description; - -int main() -{ - try - { - // Get ServiceDescription objects. - ServiceDescription^ myServiceDescription1 = ServiceDescription::Read( "DataTypes_cpp.wsdl" ); - ServiceDescription^ myServiceDescription2 = ServiceDescription::Read( "MathService_cpp.wsdl" ); - - // Set the names of the ServiceDescriptions. - myServiceDescription1->Name = "DataTypes"; - myServiceDescription2->Name = "MathService"; - - // Create a ServiceDescriptionCollection. - ServiceDescriptionCollection^ myServiceDescriptionCollection = gcnew ServiceDescriptionCollection; - - // Add the ServiceDescriptions to the collection. - myServiceDescriptionCollection->Add( myServiceDescription1 ); - myServiceDescriptionCollection->Add( myServiceDescription2 ); - - // Display the elements of the collection using the Item property. - Console::WriteLine( "Elements in the collection: " ); - for ( int i = 0; i < myServiceDescriptionCollection->Count; i++ ) - Console::WriteLine( myServiceDescriptionCollection[ i ]->Name ); - - // Construct an XML qualified name. - XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "MathServiceSoap","http://tempuri2.org/" ); - - // Get the Binding from the collection. - Binding^ myBinding = myServiceDescriptionCollection->GetBinding( myXmlQualifiedName ); - Console::WriteLine( "Binding found in collection with name: {0}", myBinding->ServiceDescription->Name ); - } - catch ( Exception^ e ) - { - Console::WriteLine( "The following exception was raised: {0}", e->Message ); - } -} -// diff --git a/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionCollection_Constructor_Add_Item/CPP/sdcollection_constructor_add_item.cpp b/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionCollection_Constructor_Add_Item/CPP/sdcollection_constructor_add_item.cpp deleted file mode 100644 index 1f4b047229c..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionCollection_Constructor_Add_Item/CPP/sdcollection_constructor_add_item.cpp +++ /dev/null @@ -1,50 +0,0 @@ - - -// System::Web::Services::Description.ServiceDescriptionCollection::ServiceDescriptionCollection() -// System::Web::Services::Description.ServiceDescriptionCollection->Add() -// System::Web::Services::Description.ServiceDescriptionCollection::Item(Int32) -/* The following program demonstrates 'Constructor', 'Add' method and -'Item' property of 'ServiceDescriptionCollection' class. It creates an -instance of 'ServiceDescriptionCollection' and adds -'ServiceDescription' objects to the collection. The Item property is used to -display the TargetNamespace of elements in the collection. - -Note: This program requires 'DataTypes_CS::wsdl' and 'MathService_CS::wsdl' -files to be placed in same directory as that of .exe for running. -*/ -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; - -int main() -{ - try - { - ServiceDescription^ myServiceDescription1 = ServiceDescription::Read( "DataTypes_cpp.wsdl" ); - ServiceDescription^ myServiceDescription2 = ServiceDescription::Read( "MathService_cpp.wsdl" ); - - // - // - // Create a ServiceDescriptionCollection. - ServiceDescriptionCollection^ myCollection = gcnew ServiceDescriptionCollection; - - // Add ServiceDescriptions to the collection. - myCollection->Add( myServiceDescription1 ); - myCollection->Add( myServiceDescription2 ); - // - // - - // - // Display element properties in the collection using - // the Item property. - for ( int i = 0; i < myCollection->Count; i++ ) - Console::WriteLine( myCollection[ i ]->TargetNamespace ); - // - } - catch ( Exception^ e ) - { - Console::WriteLine( "The following exception was raised: {0}", e->Message ); - } -} diff --git a/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionCollection_GetBinding/CPP/servicedescriptioncollection_getbinding.cpp b/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionCollection_GetBinding/CPP/servicedescriptioncollection_getbinding.cpp deleted file mode 100644 index 79ca7ba38d2..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionCollection_GetBinding/CPP/servicedescriptioncollection_getbinding.cpp +++ /dev/null @@ -1,52 +0,0 @@ - - -// System::Web::Services::Description.ServiceDescriptionCollection::GetBinding() -/* The following program demonstrates the 'GetBinding' method -of 'ServiceDescriptionCollection' class. It searches for a -'Binding' in the collection and returns the Binding instance. -On success, a message is displayed on the console. - -Note: This program requires 'DataTypes_cpp.wsdl' and 'MathService_cpp.wsdl' -files to be placed in same directory as that of .exe for running. -*/ - -#using -#using - -using namespace System; -using namespace System::Xml; -using namespace System::Web::Services::Description; - -int main() -{ - try - { - ServiceDescription^ myServiceDescription1 = - ServiceDescription::Read( "DataTypes_cpp.wsdl" ); - ServiceDescription^ myServiceDescription2 = - ServiceDescription::Read( "MathService_cpp.wsdl" ); - - // Create the Object* of 'ServiceDescriptionCollection' class. - ServiceDescriptionCollection^ myCollection = - gcnew ServiceDescriptionCollection; - - // Add ServiceDescription objects. - myCollection->Add( myServiceDescription1 ); - myCollection->Add( myServiceDescription2 ); - -// - // Construct an XML qualified name. - XmlQualifiedName^ myXmlQualifiedName = - gcnew XmlQualifiedName( "MathServiceSoap","http://tempuri2.org/" ); - - // Get the Binding from the collection. - myCollection->GetBinding( myXmlQualifiedName ); -// - Console::WriteLine( "Specified Binding is a member of ServiceDescription " - + "instances within the collection" ); - } - catch ( Exception^ e ) - { - Console::WriteLine( "The following exception was raised: {0}", e->Message ); - } -} diff --git a/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionCollection_GetMessage/CPP/servicedescriptioncollection_getmessage.cpp b/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionCollection_GetMessage/CPP/servicedescriptioncollection_getmessage.cpp deleted file mode 100644 index e84c9b01134..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionCollection_GetMessage/CPP/servicedescriptioncollection_getmessage.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// System::Web::Services::Description.ServiceDescriptionCollection::GetMessage() - -/* The following program demonstrates the 'GetMessage' method -of 'ServiceDescriptionCollection' class. It searches for a -'Message' in the collection and returns the Message instance. On success, -a message is displayed on the console. - -Note: This program requires 'DataTypes_cpp.wsdl' and 'MathService_cpp.wsdl' -files to be placed in same directory as that of .exe for running. -*/ - -#using -#using - -using namespace System; -using namespace System::Xml; -using namespace System::Web::Services::Description; - -int main() -{ - try - { - ServiceDescription^ myServiceDescription1 = - ServiceDescription::Read( "DataTypes_cpp.wsdl" ); - ServiceDescription^ myServiceDescription2 = - ServiceDescription::Read( "MathService_cpp.wsdl" ); - - // Create the Object* of 'ServiceDescriptionCollection' class. - ServiceDescriptionCollection^ myCollection = - gcnew ServiceDescriptionCollection; - - // Add 'ServiceDescription' objects. - myCollection->Add( myServiceDescription1 ); - myCollection->Add( myServiceDescription2 ); - -// - // Construct an XML qualified name. - XmlQualifiedName^ myXmlQualifiedName = - gcnew XmlQualifiedName( "AddSoapIn","http://tempuri2.org/" ); - - // Get the Message from the collection. - myCollection->GetMessage( myXmlQualifiedName ); -// - - Console::WriteLine( "Specified Message is a member of ServiceDescription " - + "instances within the collection." ); - } - catch ( Exception^ e ) - { - Console::WriteLine( "The following exception was raised: {0}", e->Message ); - } -} diff --git a/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionCollection_GetPortType/CPP/servicedescriptioncollection_getporttype.cpp b/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionCollection_GetPortType/CPP/servicedescriptioncollection_getporttype.cpp deleted file mode 100644 index 8374664ea9d..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionCollection_GetPortType/CPP/servicedescriptioncollection_getporttype.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// System::Web::Services::Description.ServiceDescriptionCollection::GetPortType() - -/* The following program demonstrates the 'GetPortType' method -of 'ServiceDescriptionCollection' class. It searches for a -'PortType' with XmlQualifiedName in the collection and returns a -PortType instance. On success, a message is displayed on the -console. - -Note: This program requires 'DataTypes_cpp..wsdl' and 'MathService_cpp..wsdl' -files to be placed in same directory as that of .exe for running. -*/ - -#using -#using - -using namespace System; -using namespace System::Xml; -using namespace System::Web::Services::Description; - -int main() -{ - try - { - ServiceDescription^ myServiceDescription1 = - ServiceDescription::Read( "DataTypes_cpp..wsdl" ); - ServiceDescription^ myServiceDescription2 = - ServiceDescription::Read( "MathService_cpp..wsdl" ); - - // Create the Object* of 'ServiceDescriptionCollection' class. - ServiceDescriptionCollection^ myCollection = - gcnew ServiceDescriptionCollection; - - // Add 'ServiceDescription' objects. - myCollection->Add( myServiceDescription1 ); - myCollection->Add( myServiceDescription2 ); - -// - // Construct an XML qualified name. - XmlQualifiedName^ myXmlQualifiedName = - gcnew XmlQualifiedName( "MathServiceSoap","http://tempuri2.org/" ); - - // Get the PortType from the collection. - myCollection->GetPortType( myXmlQualifiedName ); -// - - Console::WriteLine( "Specified PortType is a member of ServiceDescription " - + "instances within the collection." ); - } - catch ( Exception^ e ) - { - Console::WriteLine( "The following exception was raised: {0}", e->Message ); - } -} diff --git a/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionCollection_GetService/CPP/servicedescriptioncollection_getservice.cpp b/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionCollection_GetService/CPP/servicedescriptioncollection_getservice.cpp deleted file mode 100644 index 393a442e65a..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionCollection_GetService/CPP/servicedescriptioncollection_getservice.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// System::Web::Services::Description.ServiceDescriptionCollection::GetService() - -/* The following program demonstrates the 'GetService' method -of 'ServiceDescriptionCollection' class. It searches for a -'Service' with XmlQualifiedName in the collection and returns -the Service instance. On success, a message is displayed on the -console. - -Note: This program requires 'DataTypes_cpp.wsdl' and 'MathService_cpp.wsdl' -files to be placed in same directory as that of .exe for running. -*/ - -#using -#using - -using namespace System; -using namespace System::Xml; -using namespace System::Web::Services::Description; - -int main() -{ - try - { - ServiceDescription^ myServiceDescription1 = - ServiceDescription::Read( "DataTypes_cpp.wsdl" ); - ServiceDescription^ myServiceDescription2 = - ServiceDescription::Read( "MathService_cpp.wsdl" ); - - // Create the Object* of 'ServiceDescriptionCollection' class. - ServiceDescriptionCollection^ myCollection = - gcnew ServiceDescriptionCollection; - - // Add 'ServiceDescription' objects. - myCollection->Add( myServiceDescription1 ); - myCollection->Add( myServiceDescription2 ); - -// - // Construct an XML qualified name. - XmlQualifiedName^ myXmlQualifiedName = - gcnew XmlQualifiedName( "MathService","http://tempuri2.org/" ); - - // Get the Service from the collection. - myCollection->GetService( myXmlQualifiedName ); -// - - Console::WriteLine( "Specified Service is a member of ServiceDescription " - + "instances within the collection" ); - } - catch ( Exception^ e ) - { - Console::WriteLine( "The following exception was raised: {0}", e->Message ); - } -} diff --git a/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionCollection_Insert_Item_CopyTo/CPP/sdcollection_insert_item_copyto.cpp b/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionCollection_Insert_Item_CopyTo/CPP/sdcollection_insert_item_copyto.cpp deleted file mode 100644 index 65f79d261a7..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionCollection_Insert_Item_CopyTo/CPP/sdcollection_insert_item_copyto.cpp +++ /dev/null @@ -1,62 +0,0 @@ - - -// System::Web::Services::Description.ServiceDescriptionCollection::Insert() -// System::Web::Services::Description.ServiceDescriptionCollection::Item(String) -// System::Web::Services::Description.ServiceDescriptionCollection::CopyTo() -/* The following program demonstrates 'Item' property, 'Insert' and 'CopyTo' -methods of the 'ServiceDescriptionCollection' class. It creates an instance of -'ServiceDescriptionCollection' and adds 'ServiceDescription' objects to the -collection. The elements of the collection are copied to a 'ServiceDescription' -array. - -Note: This program requires 'DataTypes_cpp.wsdl' and 'MathService_cpp.wsdl' -files to be placed in the same directory as that of .exe for running. -*/ -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; - -int main() -{ - try - { - ServiceDescription^ myServiceDescription1 = ServiceDescription::Read( "DataTypes_cpp.wsdl" ); - myServiceDescription1->Name = "DataTypes"; - ServiceDescription^ myServiceDescription2 = ServiceDescription::Read( "MathService_cpp.wsdl" ); - myServiceDescription2->Name = "MathService"; - - // Create the object of 'ServiceDescriptionCollection' class. - ServiceDescriptionCollection^ myCollection = gcnew ServiceDescriptionCollection; - - // Add 'ServiceDescription' objects. - myCollection->Add( myServiceDescription1 ); - - // - // Insert a ServiceDescription into the collection. - myCollection->Insert( 1, myServiceDescription2 ); - // - - // - // Get a ServiceDescription in the collection using - // the Item property. - ServiceDescription^ myServiceDescription = myCollection[ "http://tempuri1.org/" ]; - // - - Console::WriteLine( "Name of the object retrieved using 'Item' property: {0}", myServiceDescription->Name ); - - // - array^myArray = gcnew array(myCollection->Count); - - // Copy the collection to a ServiceDescription array. - myCollection->CopyTo( myArray, 0 ); - for ( int i = 0; i < myArray->Length; i++ ) - Console::WriteLine( "Name of element in array: {0}", myArray[ i ]->Name ); - // - } - catch ( Exception^ e ) - { - Console::WriteLine( "The following exception was raised: {0}", e->Message ); - } -} diff --git a/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionFormatExtension_13/CPP/servicedescriptionformatextension_13.cpp b/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionFormatExtension_13/CPP/servicedescriptionformatextension_13.cpp deleted file mode 100644 index bd4ca480209..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionFormatExtension_13/CPP/servicedescriptionformatextension_13.cpp +++ /dev/null @@ -1,142 +0,0 @@ - - -// System::Web::Services::Description.ServiceDescriptionFormatExtensionCollection -// System::Web::Services::Description.ServiceDescriptionFormatExtensionCollection::ctor -// System::Web::Services::Description.ServiceDescriptionFormatExtensionCollection->Add() -// System::Web::Services::Description.ServiceDescriptionFormatExtensionCollection::Item -// System::Web::Services::Description.ServiceDescriptionFormatExtensionCollection::Find(System::Type type) -// System::Web::Services::Description.ServiceDescriptionFormatExtensionCollection::FindAll(System::Type type) -// System::Web::Services::Description.ServiceDescriptionFormatExtensionCollection::IsHandled() -// System::Web::Services::Description.ServiceDescriptionFormatExtensionCollection::IsRequired() -// System::Web::Services::Description.ServiceDescriptionFormatExtensionCollection::CopyTo() -// System::Web::Services::Description.ServiceDescriptionFormatExtensionCollection::Contains() -// System::Web::Services::Description.ServiceDescriptionFormatExtensionCollection::IndexOf() -// System::Web::Services::Description.ServiceDescriptionFormatExtensionCollection::Remove() -// System::Web::Services::Description.ServiceDescriptionFormatExtensionCollection::Insert() -/* The following program demonstrates the class, properties and methods of -'ServiceDescriptionFormatExtensionCollection' -class. It creates a ServiceDescription object, uses it to create -'ServiceDescriptionFormatExtensionCollection' object. Collection -object is used for demonstration of class properties and methods. - -Note: This program requires 'Sample_cpp.wsdl' file to be placed in -the same directory as that of .exe for running. -*/ -// -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Collections; - -ref class MyFormatExtension: public ServiceDescriptionFormatExtension -{ -public: - MyFormatExtension() - { - // Set the properties. - this->Handled = true; - this->Required = true; - } -}; - -int main() -{ - try - { - // - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "Sample_cpp.wsdl" ); - ServiceDescriptionFormatExtensionCollection^ myCollection = gcnew ServiceDescriptionFormatExtensionCollection( myServiceDescription ); - // - - // - SoapBinding^ mySoapBinding1 = gcnew SoapBinding; - SoapBinding^ mySoapBinding2 = gcnew SoapBinding; - SoapAddressBinding^ mySoapAddressBinding = gcnew SoapAddressBinding; - MyFormatExtension^ myFormatExtensionObject = gcnew MyFormatExtension; - - // Add elements to collection. - myCollection->Add( mySoapBinding1 ); - myCollection->Add( mySoapAddressBinding ); - myCollection->Add( mySoapBinding2 ); - myCollection->Add( myFormatExtensionObject ); - // - - // - Console::WriteLine( "Collection contains following types of elements: " ); - - // Display the 'Type' of the elements in collection. - for ( int i = 0; i < myCollection->Count; i++ ) - Console::WriteLine( myCollection[ i ]->GetType() ); - // - - // - // Check element of type 'SoapAddressBinding' in collection. - Object^ myObj = myCollection->Find( mySoapAddressBinding->GetType() ); - if ( myObj == nullptr ) - Console::WriteLine( "Element of type ' {0}' not found in collection.", mySoapAddressBinding->GetType() ); - else - Console::WriteLine( "Element of type ' {0}' found in collection.", mySoapAddressBinding->GetType() ); - // - - // - // Check all elements of type 'SoapBinding' in collection. - array^myObjectArray1 = gcnew array(myCollection->Count); - myObjectArray1 = myCollection->FindAll( mySoapBinding1->GetType() ); - int myNumberOfElements = 0; - IEnumerator^ myIEnumerator = myObjectArray1->GetEnumerator(); - - // Calculate number of elements of type 'SoapBinding'. - while ( myIEnumerator->MoveNext() ) - if ( mySoapBinding1->GetType() == myIEnumerator->Current->GetType() ) - myNumberOfElements++; - Console::WriteLine( "Collection contains {0} objects of type ' {1}'.", myNumberOfElements, mySoapBinding1->GetType() ); - // - - // - // Check 'IsHandled' status for 'myFormatExtensionObject' object in collection. - Console::WriteLine( "'IsHandled' status for {0} object is {1}.", myFormatExtensionObject, myCollection->IsHandled( myFormatExtensionObject ) ); - // - - // - // Check 'IsRequired' status for 'myFormatExtensionObject' object in collection. - Console::WriteLine( "'IsRequired' status for {0} object is {1}.", myFormatExtensionObject, myCollection->IsRequired( myFormatExtensionObject ) ); - // - - // - // Copy elements of collection to an Object array. - array^myObjectArray2 = gcnew array(myCollection->Count); - myCollection->CopyTo( myObjectArray2, 0 ); - Console::WriteLine( "Collection elements are copied to an object array." ); - // - - // - // Check for 'myFormatExtension' object in collection. - if ( myCollection->Contains( myFormatExtensionObject ) ) - { - // - // Get index of a 'myFormatExtension' object in collection. - Console::WriteLine( "Index of 'myFormatExtensionObject' is {0} in collection.", myCollection->IndexOf( myFormatExtensionObject ) ); - // - - // - // Remove 'myFormatExtensionObject' element from collection. - myCollection->Remove( myFormatExtensionObject ); - Console::WriteLine( "'myFormatExtensionObject' is removed from collection." ); - // - } - // - - // - // Insert 'MyFormatExtension' object. - myCollection->Insert( 0, myFormatExtensionObject ); - Console::WriteLine( "'myFormatExtensionObject' is inserted to collection." ); - // - } - catch ( Exception^ e ) - { - Console::WriteLine( "The following exception was raised: {0}", e->Message ); - } -} -// diff --git a/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_Bindings/CPP/servicedescription_bindings.cpp b/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_Bindings/CPP/servicedescription_bindings.cpp deleted file mode 100644 index 7b2a6a89d1b..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_Bindings/CPP/servicedescription_bindings.cpp +++ /dev/null @@ -1,85 +0,0 @@ -// System.Web.Services.Description.ServiceDescription.Bindings - -/* -The following example demonstrates the property 'Bindings' of -'ServiceDescription' class. The input to the program is a WSDL file -'MyWsdl_CS.wsdl'. This program removes one 'Binding' from the existing WSDL. -A new Binding is defined and added to the ServiceDescription object. -The program generates a new Web Service Description document. -*/ - -#using -#using -#using - -using namespace System; -using namespace System::Web::Services; -using namespace System::Web::Services::Description; -using namespace System::Xml; - -// Used to create OperationBinding instances within 'Binding'. -OperationBinding^ CreateOperationBinding( String^ operation, String^ targetNamespace ) -{ - // Create OperationBinding instance for operation. - OperationBinding^ myOperationBinding = gcnew OperationBinding; - myOperationBinding->Name = operation; - - // Create InputBinding for operation. - InputBinding^ myInputBinding = gcnew InputBinding; - SoapBodyBinding^ mySoapBodyBinding = gcnew SoapBodyBinding; - mySoapBodyBinding->Use = SoapBindingUse::Literal; - myInputBinding->Extensions->Add( mySoapBodyBinding ); - - // Create OutputBinding for operation. - OutputBinding^ myOutputBinding = gcnew OutputBinding; - myOutputBinding->Extensions->Add( mySoapBodyBinding ); - - // Add 'InputBinding' and 'OutputBinding' to 'OperationBinding'. - myOperationBinding->Input = myInputBinding; - myOperationBinding->Output = myOutputBinding; - - // Create extensibility element for 'SoapOperationBinding'. - SoapOperationBinding^ mySoapOperationBinding = gcnew SoapOperationBinding; - mySoapOperationBinding->Style = SoapBindingStyle::Document; - mySoapOperationBinding->SoapAction = targetNamespace + operation; - - // Add extensibility element 'SoapOperationBinding' to 'OperationBinding'. - myOperationBinding->Extensions->Add( mySoapOperationBinding ); - return myOperationBinding; -} - -int main() -{ - try - { - // - // Obtain the ServiceDescription from existing WSDL. - ServiceDescription^ myDescription = ServiceDescription::Read( "MyWsdl_CS.wsdl" ); - - // Remove the Binding from the BindingCollection of - // the ServiceDescription. - BindingCollection^ myBindingCollection = myDescription->Bindings; - myBindingCollection->Remove( myBindingCollection[ 0 ] ); - - // Form a new Binding. - Binding^ myBinding = gcnew Binding; - myBinding->Name = "Service1Soap"; - XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "s0:Service1Soap" ); - myBinding->Type = myXmlQualifiedName; - SoapBinding^ mySoapBinding = gcnew SoapBinding; - mySoapBinding->Transport = "http://schemas.xmlsoap.org/soap/http"; - mySoapBinding->Style = SoapBindingStyle::Document; - OperationBinding^ addOperationBinding = CreateOperationBinding( "Add", myDescription->TargetNamespace ); - myBinding->Operations->Add( addOperationBinding ); - myBinding->Extensions->Add( mySoapBinding ); - - // Add the Binding to the ServiceDescription. - myDescription->Bindings->Add( myBinding ); - myDescription->Write( "MyOutWsdl.wsdl" ); - // - } - catch ( Exception^ e ) - { - Console::WriteLine( "Exception: {0}", e->Message ); - } -} diff --git a/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_Constructor_4/CPP/servicedescription_constructor_4.cpp b/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_Constructor_4/CPP/servicedescription_constructor_4.cpp deleted file mode 100644 index 4d5942332c2..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_Constructor_4/CPP/servicedescription_constructor_4.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// System.Web.Services.Description.ServiceDescription.ServiceDescription() -// System.Web.Services.Description.ServiceDescription.Read(string) -// System.Web.Services.Description.ServiceDescription.Messages -// System.Web.Services.Description.ServiceDescription.Name - -/* -The following example demonstrates the 'ServiceDescription()' constructor, -the 'Messages' and 'Name' properties and the 'Read' method of the 'ServiceDescription' -class. The input to the program is a WSDL file 'MyWsdl.wsdl'. -This program removes one message from the existing WSDL. -A new Message is defined and added to the ServiceDescription. -A new wsdl with modified ServiceDescription is written in 'MyOutWsdl.wsdl'. -*/ - -#using -#using -#using - -using namespace System; -using namespace System::Web::Services; -using namespace System::Web::Services::Description; -using namespace System::Xml; - -int main() -{ - // - // - // - // - ServiceDescription^ myDescription = gcnew ServiceDescription; - myDescription = ServiceDescription::Read( "MyWsdl_CS.wsdl" ); - myDescription->Name = "MyServiceDescription"; - Console::WriteLine( "Name: {0}", myDescription->Name ); - MessageCollection^ myMessageCollection = myDescription->Messages; - - // Remove the message at index 0 from the message collection. - myMessageCollection->Remove( myDescription->Messages[ 0 ] ); - - // Build a new message. - Message^ myMessage = gcnew Message; - myMessage->Name = "AddSoapIn"; - - // Build a new MessagePart. - MessagePart^ myMessagePart = gcnew MessagePart; - myMessagePart->Name = "parameters"; - XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "s0:Add" ); - myMessagePart->Element = myXmlQualifiedName; - - // Add MessageParts to the message. - myMessage->Parts->Add( myMessagePart ); - - // Add the message to the ServiceDescription. - myDescription->Messages->Add( myMessage ); - myDescription->Write( "MyOutWsdl.wsdl" ); - // - // - // - // -} diff --git a/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_Extensions_RetrieveUrl/CPP/servicedescription_extensions_2.cpp b/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_Extensions_RetrieveUrl/CPP/servicedescription_extensions_2.cpp deleted file mode 100644 index 5aa1c26e6f6..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_Extensions_RetrieveUrl/CPP/servicedescription_extensions_2.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// System.Web.Services.Description.ServiceDescription.Extensions -// System.Web.Services.Description.ServiceDescription.RetrievalUrl -/* The following program demonstrates properties 'Extensions', 'RetrievalUrl' of -'ServiceDescription' class. The input to the program is a WSDL file -'ServiceDescription_Extensions_Input_cs.wsdl'. This program adds one object -to the extensions collection and displays the count and set the 'RetrievalURL' and displays. -*/ - -#using -#using -#using - -using namespace System; -using namespace System::Web::Services; -using namespace System::Web::Services::Description; - -int main() -{ - // - // - ServiceDescription^ myServiceDescription = gcnew ServiceDescription; - myServiceDescription = ServiceDescription::Read( "ServiceDescription_Extensions_Input_cs.wsdl" ); - Console::WriteLine( myServiceDescription->Bindings[ 1 ]->Extensions[ 0 ] ); - SoapBinding^ mySoapBinding = gcnew SoapBinding; - mySoapBinding->Required = true; - SoapBinding^ mySoapBinding1 = gcnew SoapBinding; - mySoapBinding1->Required = false; - myServiceDescription->Extensions->Add( mySoapBinding ); - myServiceDescription->Extensions->Add( mySoapBinding1 ); - System::Collections::IEnumerator^ myEnum = myServiceDescription->Extensions->GetEnumerator(); - while ( myEnum->MoveNext() ) - { - ServiceDescriptionFormatExtension^ myServiceDescriptionFormatExtension = (ServiceDescriptionFormatExtension^)(myEnum->Current); - Console::WriteLine( "Required: {0}", myServiceDescriptionFormatExtension->Required ); - } - - myServiceDescription->Write( "ServiceDescription_Extensions_Output_cs.wsdl" ); - myServiceDescription->RetrievalUrl = "http://www.contoso.com/"; - Console::WriteLine( "Retrieval URL is: {0}", myServiceDescription->RetrievalUrl ); - // - // -} diff --git a/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_Imports_Service/CPP/servicedescription_imports.cpp b/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_Imports_Service/CPP/servicedescription_imports.cpp deleted file mode 100644 index 7f3cffea1be..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_Imports_Service/CPP/servicedescription_imports.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// System.Web.Services.Description.ServiceDescription.Imports - -/* The following program demonstrates the property 'Imports' of 'ServiceDescription' class. -The input to the program is a WSDL file 'ServiceDescription_Imports_Input_CS.wsdl' which -is not having the import element. A new 'Import' is defined and added to the new modified -'ServiceDescription_Imports_Output_CS.wsdl' file. -*/ - -#using -#using -#using - -using namespace System; -using namespace System::Web::Services; -using namespace System::Web::Services::Description; -using namespace System::Xml; - -int main() -{ - // - ServiceDescription^ myServiceDescription = gcnew ServiceDescription; - myServiceDescription = ServiceDescription::Read( "ServiceDescription_Imports_Input_CS.wsdl" ); - ImportCollection^ myImportCollection = myServiceDescription->Imports; - - // Create an Import. - Import^ myImport = gcnew Import; - myImport->Namespace = myServiceDescription->TargetNamespace; - - // Set the location for the Import. - myImport->Location = "http://www.contoso.com/"; - myImportCollection->Add( myImport ); - myServiceDescription->Write( "ServiceDescription_Imports_Output_CS.wsdl" ); - myImportCollection->Clear(); - myServiceDescription = ServiceDescription::Read( "ServiceDescription_Imports_Output_CS.wsdl" ); - myImportCollection = myServiceDescription->Imports; - Console::WriteLine( "The Import elements added to the ImportCollection are: " ); - for ( int i = 0; i < myImportCollection->Count; i++ ) - { - Console::WriteLine( "{0}. {1}", (i + 1), myImportCollection[ i ]->Location ); - } - // -} diff --git a/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_Namespace/CPP/servicedescription_namespace.cpp b/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_Namespace/CPP/servicedescription_namespace.cpp deleted file mode 100644 index e200b9e1fd6..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_Namespace/CPP/servicedescription_namespace.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// System::Web::Services::Description.ServiceDescription::Namespace - -/* -The following example demonstrates the 'Namespace' property of 'ServiceDescription' class. The input to the program is a -WSDL file 'MyWsdl::wsdl'.This program displays the Namespace of 'ServiceDescription' class. -*/ - -#using -#using -#using - -using namespace System; -using namespace System::Web::Services; -using namespace System::Web::Services::Description; - -int main() -{ - try - { -// - ServiceDescription^ myDescription = - ServiceDescription::Read( "MyWsdl_CS.wsdl" ); - Console::WriteLine( "Namespace : " + ServiceDescription::Namespace ); -// - } - catch ( Exception^ e ) - { - Console::WriteLine( "Exception: " + e->Message ); - } -} diff --git a/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_PortTypes_2/CPP/servicedescription_porttypes_2.cpp b/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_PortTypes_2/CPP/servicedescription_porttypes_2.cpp deleted file mode 100644 index fb6a682faf5..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_PortTypes_2/CPP/servicedescription_porttypes_2.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// System.Web.Services.Description.ServiceDescription.PortTypes -// System.Web.Services.Description.ServiceDescription.CanRead - -/* -The following example demonstrates the 'PortTypes' property -and 'CanRead' method of 'ServiceDescription' class. -The input to the program is a WSDL file 'MyWsdl_CS.wsdl'. -This program checks the validity of WSDL file.One of the existing -port types is removed.A new PortType is defined and added to the -port types collection of the service description. A modified WSDL -is the output of the program. -*/ - -#using -#using -#using - -using namespace System; -using namespace System::Web::Services; -using namespace System::Web::Services::Description; -using namespace System::Xml; - -// -// -// Creates an Operation for a PortType. -Operation^ CreateOperation( String^ operationName, String^ inputMessage, String^ outputMessage, String^ targetNamespace ) -{ - Operation^ myOperation = gcnew Operation; - myOperation->Name = operationName; - OperationMessage^ input = dynamic_cast(gcnew OperationInput); - input->Message = gcnew XmlQualifiedName( inputMessage,targetNamespace ); - OperationMessage^ output = dynamic_cast(gcnew OperationOutput); - output->Message = gcnew XmlQualifiedName( outputMessage,targetNamespace ); - myOperation->Messages->Add( input ); - myOperation->Messages->Add( output ); - return myOperation; -} - -int main() -{ - String^ myWsdlFileName = "MyWsdl_CS.wsdl"; - XmlTextReader^ myReader = gcnew XmlTextReader( myWsdlFileName ); - if ( ServiceDescription::CanRead( myReader ) ) - { - ServiceDescription^ myDescription = ServiceDescription::Read( myWsdlFileName ); - - // Remove the PortType at index 0 of the collection. - PortTypeCollection^ myPortTypeCollection = myDescription->PortTypes; - myPortTypeCollection->Remove( myDescription->PortTypes[ 0 ] ); - - // Build a new PortType. - PortType^ myPortType = gcnew PortType; - myPortType->Name = "Service1Soap"; - Operation^ myOperation = CreateOperation( "Add", "s0:AddSoapIn", "s0:AddSoapOut", "" ); - myPortType->Operations->Add( myOperation ); - - // Add a new PortType to the PortType collection of - // the ServiceDescription. - myDescription->PortTypes->Add( myPortType ); - myDescription->Write( "MyOutWsdl.wsdl" ); - Console::WriteLine( "New WSDL file generated successfully." ); - } - else - { - Console::WriteLine( "This file is not a WSDL file." ); - } -} -// -// diff --git a/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_Read/CPP/servicedescription_read.cpp b/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_Read/CPP/servicedescription_read.cpp deleted file mode 100644 index 9f61643a1f4..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_Read/CPP/servicedescription_read.cpp +++ /dev/null @@ -1,85 +0,0 @@ - - -// System.Web.Description.ServiceDescription.Read(XmlReader) -// System.Web.Description.ServiceCollection.Item(string) -// System.Web.Description.ServiceCollection.Insert(int,Service) -// System.Web.Description.ServiceDescription.Write(XmlWriter) -/* -The following program demonstrates the properties of ServiceDescription and -ServiceCollection class.An XmlTextReader with the required url is created. -An existing WSDL document is read. -An existing service named "MathService" is removed from the collection and -A new Service object is constructed and added at index 1 of the Collection of Services. -A new WSDL file is created as output. -*/ -#using -#using -#using - -using namespace System; -using namespace System::Text; -using namespace System::Web::Services::Description; -using namespace System::Collections; -using namespace System::Xml; - -int main() -{ - try - { - // - // - // Create a new XmlTextWriter with specified URL. - XmlTextReader^ myXmlReader = gcnew XmlTextReader( "All_CS.wsdl" ); - ServiceDescription^ myServiceDescription = ServiceDescription::Read( myXmlReader ); - myServiceDescription->TargetNamespace = "http://tempuri.org/"; - - // Remove the service named MathService. - ServiceCollection^ myServiceDescriptionCollection = myServiceDescription->Services; - myServiceDescriptionCollection->Remove( myServiceDescription->Services[ "MathService" ] ); - // - // - - // - Service^ myService = gcnew Service; - myService->Name = "MathService"; - XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "s0:MathServiceSoap" ); - - // Build a new Port for SOAP. - Port^ mySoapPort = gcnew Port; - mySoapPort->Name = "MathServiceSoap"; - mySoapPort->Binding = myXmlQualifiedName; - SoapAddressBinding^ mySoapAddressBinding = gcnew SoapAddressBinding; - mySoapAddressBinding->Location = "http://localhost/ServiceDescription_Read/AddService_CS.asmx"; - mySoapPort->Extensions->Add( mySoapAddressBinding ); - - // Build a new Port for HTTP-GET. - XmlQualifiedName^ myXmlQualifiedName2 = gcnew XmlQualifiedName( "s0:MathServiceHttpGet" ); - Port^ myHttpGetPort = gcnew Port; - myHttpGetPort->Name = "MathServiceHttpGet"; - myHttpGetPort->Binding = myXmlQualifiedName2; - HttpAddressBinding^ myHttpAddressBinding = gcnew HttpAddressBinding; - myHttpAddressBinding->Location = "http://localhost/ServiceDescription_Read/AddService_CS.asmx"; - myHttpGetPort->Extensions->Add( myHttpAddressBinding ); - - // Add the ports to the service. - myService->Ports->Add( myHttpGetPort ); - myService->Ports->Add( mySoapPort ); - - // Add the service to the ServiceCollection. - myServiceDescription->Services->Insert( 1, myService ); - // - - // - // Create a new XmlTextWriter object. - XmlTextWriter^ myWriter = gcnew XmlTextWriter( "output.wsdl",Encoding::UTF8 ); - myWriter->Formatting = Formatting::Indented; - - // Write the WSDL. - myServiceDescription->Write( myWriter ); - // - } - catch ( Exception^ e ) - { - Console::WriteLine( "Exception: {0}", e->Message ); - } -} diff --git a/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_Read1/CPP/servicedescription_read1.cpp b/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_Read1/CPP/servicedescription_read1.cpp deleted file mode 100644 index ce0c8097760..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_Read1/CPP/servicedescription_read1.cpp +++ /dev/null @@ -1,44 +0,0 @@ - - -// System::Web::Services::Description.Read(TextReader) -/* -The following example demonstrates the 'Read(TextReader)' method of -'ServiceDescription' class.A ServiceDescription instance is -obtained from existing Wsdl::Name property of Bindings in the -ServiceDescription is displayed to console. -*/ -#using -#using - -using namespace System; -using namespace System::Web::Services; -using namespace System::Web::Services::Description; -using namespace System::Xml; -using namespace System::IO; - -int main() -{ - try - { - // - ServiceDescription^ myDescription = gcnew ServiceDescription; - - // Create a StreamReader to read a WSDL file. - TextReader^ myTextReader = gcnew StreamReader( "MyWsdl.wsdl" ); - myDescription = ServiceDescription::Read( myTextReader ); - Console::WriteLine( "Bindings are: " ); - - // Display the Bindings present in the WSDL file. - System::Collections::IEnumerator^ myEnum = myDescription->Bindings->GetEnumerator(); - while ( myEnum->MoveNext() ) - { - Binding^ myBinding = safe_cast(myEnum->Current); - Console::WriteLine( myBinding->Name ); - } - // - } - catch ( Exception^ e ) - { - Console::WriteLine( "Exception: {0}", e->Message ); - } -} diff --git a/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_Read2/CPP/servicedescription_read2.cpp b/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_Read2/CPP/servicedescription_read2.cpp deleted file mode 100644 index 11b98b37d9b..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_Read2/CPP/servicedescription_read2.cpp +++ /dev/null @@ -1,44 +0,0 @@ - - -// System::Web::Services::Description.Read(StreamReader) -/* -The following example demonstrates the 'Read(StreamReader)' method of -'ServiceDescription' class.A ServiceDescription instance is -obtained from existing Wsdl. Name property of Bindings in the -ServiceDescription is displayed to console. -*/ -#using - -// #using -#using - -using namespace System; -using namespace System::Web::Services; -using namespace System::Web::Services::Description; -using namespace System::Xml; -using namespace System::IO; - -int main() -{ - try - { - // - // Create a StreamReader to read a WSDL file. - StreamReader^ myStreamReader = gcnew StreamReader( "MyWsdl.wsdl" ); - ServiceDescription^ myDescription = ServiceDescription::Read( myStreamReader ); - Console::WriteLine( "Bindings are: " ); - - // Display the Bindings present in the WSDL file. - System::Collections::IEnumerator^ myEnum = myDescription->Bindings->GetEnumerator(); - while ( myEnum->MoveNext() ) - { - Binding^ myBinding = safe_cast(myEnum->Current); - Console::WriteLine( myBinding->Name ); - } - // - } - catch ( Exception^ e ) - { - Console::WriteLine( "Exception : {0}", e->Message ); - } -} diff --git a/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_Types/CPP/servicedescription_types.cpp b/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_Types/CPP/servicedescription_types.cpp deleted file mode 100644 index 306781ed271..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_Types/CPP/servicedescription_types.cpp +++ /dev/null @@ -1,101 +0,0 @@ - - -// System.Web.Services.Description.ServiceDescription.Types -// System.Web.Services.Description.ServiceDescription.Write(Stream) -/* -The following program demonstrates the 'Write' method and 'Types' property -of ServiceDescription class.An existing WSDL document is read. -Types of the SericeDescription are removed.New Types are constructed. -Types are then added to ServiceDescription .A new WSDL file is created as output. -*/ -#using -#using -#using - -using namespace System; -using namespace System::Text; -using namespace System::Web::Services::Description; -using namespace System::Collections; -using namespace System::IO; -using namespace System::Xml; -using namespace System::Xml::Schema; - -// This function creates a XmlComplex Element. -XmlSchemaElement^ CreateComplexTypeXmlElement( String^ minoccurs, String^ maxoccurs, String^ name, XmlQualifiedName^ schemaTypeName ) -{ - XmlSchemaElement^ myXmlSchemaElement = gcnew XmlSchemaElement; - myXmlSchemaElement->MinOccursString = minoccurs; - myXmlSchemaElement->MaxOccursString = maxoccurs; - myXmlSchemaElement->Name = name; - myXmlSchemaElement->SchemaTypeName = schemaTypeName; - return myXmlSchemaElement; -} - -int main() -{ - try - { - // Read the existing WSDL. - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "Input_CS.wsdl" ); - - // - myServiceDescription->Types->Schemas->Remove( myServiceDescription->Types->Schemas[ 0 ] ); - XmlSchema^ myXmlSchema = gcnew XmlSchema; - myXmlSchema->AttributeFormDefault = XmlSchemaForm::Qualified; - myXmlSchema->ElementFormDefault = XmlSchemaForm::Qualified; - myXmlSchema->TargetNamespace = myServiceDescription->TargetNamespace; - XmlSchemaElement^ myXmlElement1 = gcnew XmlSchemaElement; - myXmlElement1->Name = "Add"; - XmlSchemaComplexType^ myXmlSchemaComplexType = gcnew XmlSchemaComplexType; - XmlSchemaSequence^ myXmlSchemaSequence = gcnew XmlSchemaSequence; - myXmlSchemaSequence->Items->Add( CreateComplexTypeXmlElement( "1", "1", "a", gcnew XmlQualifiedName( "s:float" ) ) ); - myXmlSchemaSequence->Items->Add( CreateComplexTypeXmlElement( "1", "1", "b", gcnew XmlQualifiedName( "s:float" ) ) ); - myXmlSchemaComplexType->Particle = myXmlSchemaSequence; - myXmlElement1->SchemaType = myXmlSchemaComplexType; - myXmlSchema->Items->Add( myXmlElement1 ); - XmlSchemaElement^ myXmlElement2 = gcnew XmlSchemaElement; - myXmlElement2->Name = "AddResponse"; - myXmlSchemaComplexType = gcnew XmlSchemaComplexType; - myXmlSchemaSequence = gcnew XmlSchemaSequence; - myXmlSchemaSequence->Items->Add( CreateComplexTypeXmlElement( "1", "1", "AddResult", gcnew XmlQualifiedName( "s:float" ) ) ); - myXmlSchemaComplexType->Particle = myXmlSchemaSequence; - myXmlElement2->SchemaType = myXmlSchemaComplexType; - myXmlSchema->Items->Add( myXmlElement2 ); - XmlSchemaElement^ myXmlElement3 = gcnew XmlSchemaElement; - myXmlElement3->Name = "Subtract"; - myXmlSchemaComplexType = gcnew XmlSchemaComplexType; - myXmlSchemaSequence = gcnew XmlSchemaSequence; - myXmlSchemaSequence->Items->Add( CreateComplexTypeXmlElement( "1", "1", "a", gcnew XmlQualifiedName( "s:float" ) ) ); - myXmlSchemaSequence->Items->Add( CreateComplexTypeXmlElement( "1", "1", "b", gcnew XmlQualifiedName( "s:float" ) ) ); - myXmlSchemaComplexType->Particle = myXmlSchemaSequence; - myXmlElement3->SchemaType = myXmlSchemaComplexType; - myXmlSchema->Items->Add( myXmlElement3 ); - XmlSchemaElement^ myXmlElement4 = gcnew XmlSchemaElement; - myXmlElement4->Name = "SubtractResponse"; - myXmlSchemaComplexType = gcnew XmlSchemaComplexType; - myXmlSchemaSequence = gcnew XmlSchemaSequence; - myXmlSchemaSequence->Items->Add( CreateComplexTypeXmlElement( "1", "1", "SubtractResult", gcnew XmlQualifiedName( "s:int" ) ) ); - myXmlSchemaComplexType->Particle = myXmlSchemaSequence; - myXmlElement4->SchemaType = myXmlSchemaComplexType; - myXmlSchema->Items->Add( myXmlElement4 ); - - // Add the schemas to the Types property of the ServiceDescription. - myServiceDescription->Types->Schemas->Add( myXmlSchema ); - // - - // - FileStream^ myFileStream = gcnew FileStream( "output.wsdl",FileMode::OpenOrCreate,FileAccess::Write ); - StreamWriter^ myStreamWriter = gcnew StreamWriter( myFileStream ); - - // Write the WSDL. - Console::WriteLine( "Writing a new WSDL file." ); - myServiceDescription->Write( myStreamWriter ); - myStreamWriter->Close(); - myFileStream->Close(); - // - } - catch ( Exception^ e ) - { - Console::WriteLine( "Exception Caught! {0}", e->Message ); - } -} diff --git a/snippets/cpp/VS_Snippets_Remoting/Service_Class4/CPP/service_class.cpp b/snippets/cpp/VS_Snippets_Remoting/Service_Class4/CPP/service_class.cpp deleted file mode 100644 index c6ed8c5b45d..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/Service_Class4/CPP/service_class.cpp +++ /dev/null @@ -1,95 +0,0 @@ -// System.Web.Services.Description.Service.Ports -// System.Web.Services.Description.Service.Extensions -// System.Web.Services.Description.Service.Service() -// System.Web.Services.Description.Service.Name - -/*The following sample demonstrates the properties 'Ports','Extensions','Name' and -constructor 'Service()'. This sample reads the contents of a file 'MathService_cs.wsdl' -into a 'ServiceDescription' instance. It gets the collection of Service -instances from 'ServiceDescription'. It then removes a 'Service' from the collection and -creates a new 'Service' and adds it into collection. It writes a new web service description -file 'MathService_New.wsdl'. -*/ - -// -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Xml; - -Port^ CreatePort( String^ PortName, String^ BindingName, String^ targetNamespace ) -{ - Port^ myPort = gcnew Port; - myPort->Name = PortName; - myPort->Binding = gcnew XmlQualifiedName( BindingName,targetNamespace ); - - // Create a SoapAddress extensibility element to add to the port. - SoapAddressBinding^ mySoapAddressBinding = gcnew SoapAddressBinding; - mySoapAddressBinding->Location = "http://localhost/Service_Class/MathService_CS.asmx"; - myPort->Extensions->Add( mySoapAddressBinding ); - return myPort; -} - -int main() -{ - try - { - // - // - // - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MathService_CS.wsdl" ); - ServiceCollection^ myServiceCollection = myServiceDescription->Services; - int noOfServices = myServiceCollection->Count; - Console::WriteLine( "\nTotal number of services: {0}", noOfServices ); - - // Get a reference to the service. - Service^ myOldService = myServiceCollection[ 0 ]; - Console::WriteLine( "No. of Ports in the Service{0}", myServiceCollection[ 0 ]->Ports->Count ); - Console::WriteLine( "These are the ports in the service:" ); - for ( int i = 0; i < myOldService->Ports->Count; i++ ) - Console::WriteLine( "Port name: {0}", myOldService->Ports[ i ]->Name ); - Console::WriteLine( "Service name: {0}", myOldService->Name ); - Service^ myService = gcnew Service; - myService->Name = "MathService"; - - // Add the ports to the newly created service. - for ( int i = 0; i < myOldService->Ports->Count; i++ ) - { - String^ PortName = myServiceCollection[ 0 ]->Ports[ i ]->Name; - String^ BindingName = myServiceCollection[ 0 ]->Ports[ i ]->Binding->Name; - myService->Ports->Add( CreatePort( PortName, BindingName, myServiceDescription->TargetNamespace ) ); - - } - Console::WriteLine( "Newly created ports -" ); - for ( int i = 0; i < myService->Ports->Count; i++ ) - Console::WriteLine( "Port Name: {0}", myOldService->Ports[ i ]->Name ); - - // Add the extensions to the newly created service. - int noOfExtensions = myOldService->Extensions->Count; - Console::WriteLine( "No. of extensions: {0}", noOfExtensions ); - if ( noOfExtensions > 0 ) - { - for ( int i = 0; i < myOldService->Ports->Count; i++ ) - myService->Extensions->Add( myServiceCollection[ 0 ]->Extensions[ i ] ); - } - - // Remove the service from the collection. - myServiceCollection->Remove( myOldService ); - - // Add the newly created service. - myServiceCollection->Add( myService ); - myServiceDescription->Write( "MathService_New.wsdl" ); - // - // - // - } - catch ( Exception^ e ) - { - Console::WriteLine( "Exception: {0}", e->Message ); - } - -} -// diff --git a/snippets/cpp/VS_Snippets_Remoting/SoapBindingStyle_Rpc/CPP/soapbindingstyle_rpc.cpp b/snippets/cpp/VS_Snippets_Remoting/SoapBindingStyle_Rpc/CPP/soapbindingstyle_rpc.cpp deleted file mode 100644 index 477f2e9539d..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/SoapBindingStyle_Rpc/CPP/soapbindingstyle_rpc.cpp +++ /dev/null @@ -1,110 +0,0 @@ -// System::Web::Services::Description.SoapBindingStyle::Rpc -// System::Web::Services::Description.SoapBindingUse::Encoded -// System::Web::Services::Description.SoapBodyBinding::Encoding -// System::Web::Services::Description.SoapBodyBinding::Namespace -// System::Web::Services::Description.SoapHeaderBinding::Encoding -// System::Web::Services::Description.SoapHeaderBinding::Namespace - -/* -The following example demonstrates the 'Rpc' member of 'SoapBindingStyle' -enumeration , 'Encoded' member of 'SoapBindingUse' enumeration , 'Encoding' -and 'Namespace' properties of 'SoapBodyBinding' class and 'Encoding' -and 'Namespace' properties of 'SoapHeaderBinding' class. -It takes as input a wsdl file which does not contain a binding for SOAP. -By using the 'Read' method of 'ServiceDescription' class it gets a 'ServiceDescription' Object*. -It uses the SOAP protocol related classes and creates 'Binding' element -of 'SOAP' protocol which are then added to the 'ServiceDescription' Object*. -An output wsdl file is generated from 'ServiceDescription' Object* which -could be used for generating a proxy. -*/ - -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Collections; -using namespace System::Xml; - -int main() -{ - ServiceDescription^ myServiceDescription = - ServiceDescription::Read( "SoapBindingStyleInput_cpp.wsdl" ); - Binding^ myBinding = gcnew Binding; - myBinding->Name = "SOAPSvrMgr_SOAPBinding"; - myBinding->Type = gcnew XmlQualifiedName( "tns:SOAPSvrMgr_portType" ); - -// - SoapBinding^ mySoapBinding = gcnew SoapBinding; - mySoapBinding->Transport = "http://schemas.xmlsoap.org/soap/http"; - // Message to be transmitted contains parameters to call a procedure. - mySoapBinding->Style = SoapBindingStyle::Rpc; - myBinding->Extensions->Add( mySoapBinding ); -// - - OperationBinding^ myOperationBinding = gcnew OperationBinding; - myOperationBinding->Name = "GetServerStats"; - - SoapOperationBinding^ mySoapOperationBinding = - gcnew SoapOperationBinding; - mySoapOperationBinding->SoapAction = - "http://tempuri.org/soapsvcmgr/GetServerStats"; - myOperationBinding->Extensions->Add( mySoapOperationBinding ); - - // Create InputBinding for operation for the 'SOAP' protocol. - InputBinding^ myInputBinding = gcnew InputBinding; - -// -// -// - SoapBodyBinding^ mySoapBodyBinding = gcnew SoapBodyBinding; - // Encode SOAP body using rules specified by the 'Encoding' property. - mySoapBodyBinding->Use = SoapBindingUse::Encoded; - // Set URI representing the encoding style for encoding the body. - mySoapBodyBinding->Encoding = "http://schemas.xmlsoap.org/soap/encoding/"; - // Set the Uri representing the location of the specification - // for encoding of content not defined by 'Encoding' property'. - mySoapBodyBinding->Namespace = "http://tempuri.org/soapsvcmgr/"; - myInputBinding->Extensions->Add( mySoapBodyBinding ); -// -// -// - -// -// - SoapHeaderBinding^ mySoapHeaderBinding = gcnew SoapHeaderBinding; - mySoapHeaderBinding->Message = - gcnew XmlQualifiedName( "tns:Soapsvcmgr_Headers_Request" ); - mySoapHeaderBinding->Part = "AuthCS"; - // Encode SOAP header using rules specified by the 'Encoding' property. - mySoapHeaderBinding->Use = SoapBindingUse::Encoded; - // Set URI representing the encoding style for encoding the header. - mySoapHeaderBinding->Encoding = "http://schemas.xmlsoap.org/soap/encoding/"; - // Set the Uri representing the location of the specification - // for encoding of content not defined by 'Encoding' property'. - mySoapHeaderBinding->Namespace = "http://tempuri.org/SOAPSvr/soapsvcmgr/headers.xsd"; - // Add mySoapHeaderBinding to the 'myInputBinding' Object*. - myInputBinding->Extensions->Add( mySoapHeaderBinding ); -// -// - - // Create OutputBinding for operation. - OutputBinding^ myOutputBinding = gcnew OutputBinding; - myOutputBinding->Extensions->Add( mySoapBodyBinding ); - mySoapHeaderBinding->Part = "AuthSC"; - mySoapHeaderBinding->Message = - gcnew XmlQualifiedName( "tns:Soapsvcmgr_Headers_Response" ); - myOutputBinding->Extensions->Add( mySoapHeaderBinding ); - - // Add 'InputBinding' and 'OutputBinding' to 'OperationBinding'. - myOperationBinding->Input = myInputBinding; - myOperationBinding->Output = myOutputBinding; - myBinding->Operations->Add( myOperationBinding ); - - myServiceDescription->Bindings->Add( myBinding ); - myServiceDescription->Write( "SoapBindingStyleOutput_cpp.wsdl" ); - Console::WriteLine( "'SoapBindingStyleOutput_cpp.wsdl' file is generated." ); - Console::WriteLine( "Proxy could be created using command" + - " 'wsdl SoapBindingStyleOutput_cpp.wsdl'" ); -} diff --git a/snippets/cpp/VS_Snippets_Remoting/SoapBinding_SoapOperationBinding/CPP/soapprotocol.cpp b/snippets/cpp/VS_Snippets_Remoting/SoapBinding_SoapOperationBinding/CPP/soapprotocol.cpp deleted file mode 100644 index 80ca9900bb5..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/SoapBinding_SoapOperationBinding/CPP/soapprotocol.cpp +++ /dev/null @@ -1,178 +0,0 @@ -// System.Web.Services.Description.SoapBinding.ctor -// System.Web.Services.Description.SoapBinding.Transport -// System.Web.Services.Description.SoapBinding.Style -// System.Web.Services.Description.SoapBindingStyle.Document -// System.Web.Services.Description.SoapOperationBinding.ctor -// System.Web.Services.Description.SoapOperationBinding.SoapAction -// System.Web.Services.Description.SoapOperationBinding.Style -// System.Web.Services.Description.SoapBodyBinding.ctor -// System.Web.Services.Description.SoapBodyBinding.Use -// System.Web.Services.Description.SoapBindingUse.Literal -// System.Web.Services.Description.SoapAddressBinding.ctor -// System.Web.Services.Description.SoapAddressBinding.Location - -/* -The following example demonstrates the 'SoapBinding' constructor,'Transport','Style' -properties of 'SoapBinding' class,'Document' member of 'SoapBindingStyle' enum, -'SoapOperationBinding' constructor,'SoapAction','Style' properties of 'SoapOperationBinding' -class, 'SoapBodyBinding' contructor,'Use' property of 'SoapBodyBinding' class, -'Literal' member of 'SoapBindingUse' enum and 'SoapAddressBinding' constructor, 'Location' -property of class 'SoapAddressBinding'. - -It takes as input a wsdl file which supports two protocols 'HttpGet' and 'HttpPost' . -By using the 'Read' method of 'ServiceDescription' class it gets a 'ServiceDescription' -object. It uses the SOAP protocol related classes and creates 'Binding','Port', -'PortType' and 'Message' elements of 'SOAP' protocol. It adds all these elements to -the 'ServiceDescription' object. The 'ServiceDescription' object creates another -wsdl file which supports 'SOAP' also. This wsdl file is used to generate a proxy -which is used by the .aspx file. -Note: To run the example run the makefile provided and open the '.aspx' file in browser. -*/ - -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Collections; -using namespace System::Xml; - -int main() -{ - ServiceDescription^ myDescription = ServiceDescription::Read( "AddNumbersInput_cs.wsdl" ); - - // Create a 'Binding' object for the 'SOAP' protocol. - Binding^ myBinding = gcnew Binding; - myBinding->Name = "Service1Soap"; - XmlQualifiedName^ qualifiedName = gcnew XmlQualifiedName( "s0:Service1Soap" ); - myBinding->Type = qualifiedName; - - // - // - // - // - SoapBinding^ mySoapBinding = gcnew SoapBinding; - mySoapBinding->Transport = "http://schemas.xmlsoap.org/soap/http"; - mySoapBinding->Style = SoapBindingStyle::Document; - - // Add the 'SoapBinding' object to the 'Binding' object. - myBinding->Extensions->Add( mySoapBinding ); - // - // - // - // - - // Create the 'OperationBinding' object for the 'SOAP' protocol. - OperationBinding^ myOperationBinding = gcnew OperationBinding; - myOperationBinding->Name = "AddNumbers"; - - // - // - // - // Create the 'SoapOperationBinding' object for the 'SOAP' protocol. - SoapOperationBinding^ mySoapOperationBinding = gcnew SoapOperationBinding; - mySoapOperationBinding->SoapAction = "http://tempuri.org/AddNumbers"; - mySoapOperationBinding->Style = SoapBindingStyle::Document; - - // Add the 'SoapOperationBinding' object to 'OperationBinding' object. - myOperationBinding->Extensions->Add( mySoapOperationBinding ); - // - // - // - - // - // - // - // Create the 'InputBinding' object for the 'SOAP' protocol. - InputBinding^ myInput = gcnew InputBinding; - SoapBodyBinding^ mySoapBinding1 = gcnew SoapBodyBinding; - mySoapBinding1->Use = SoapBindingUse::Literal; - myInput->Extensions->Add( mySoapBinding1 ); - - // Add the 'InputBinding' object to 'OperationBinding' object. - myOperationBinding->Input = myInput; - - // Create the 'OutputBinding' object'. - OutputBinding^ myOutput = gcnew OutputBinding; - myOutput->Extensions->Add( mySoapBinding1 ); - - // Add the 'OutputBinding' object to 'OperationBinding' object. - myOperationBinding->Output = myOutput; - - // Add the 'OperationBinding' object to 'Binding' object. - myBinding->Operations->Add( myOperationBinding ); - - // Add the 'Binding' object to the ServiceDescription instance. - myDescription->Bindings->Add( myBinding ); - // - // - // - - // - // - Port^ soapPort = gcnew Port; - soapPort->Name = "Service1Soap"; - soapPort->Binding = gcnew XmlQualifiedName( "s0:Service1Soap" ); - - // Create a 'SoapAddressBinding' object for the 'SOAP' protocol. - SoapAddressBinding^ mySoapAddressBinding = gcnew SoapAddressBinding; - mySoapAddressBinding->Location = "http://localhost/Service1_cs.asmx"; - - // Add the 'SoapAddressBinding' object to the 'Port'. - soapPort->Extensions->Add( mySoapAddressBinding ); - - // Add the 'Port' object to the ServiceDescription instance. - myDescription->Services[ 0 ]->Ports->Add( soapPort ); - // - // - - // Create a 'PortType' object. for SOAP protocol. - PortType^ soapPortType = gcnew PortType; - soapPortType->Name = "Service1Soap"; - Operation^ soapOperation = gcnew Operation; - soapOperation->Name = "AddNumbers"; - OperationMessage^ soapInput = (OperationMessage^)(gcnew OperationInput); - soapInput->Message = gcnew XmlQualifiedName( "s0:AddNumbersSoapIn" ); - OperationMessage^ soapOutput = (OperationMessage^)(gcnew OperationOutput); - soapOutput->Message = gcnew XmlQualifiedName( "s0:AddNumbersSoapOut" ); - soapOperation->Messages->Add( soapInput ); - soapOperation->Messages->Add( soapOutput ); - - // Add the 'Operation' object to 'PortType' object. - soapPortType->Operations->Add( soapOperation ); - - // Add the 'PortType' object first to 'PortTypeCollection' object - // and then to 'ServiceDescription' object. - myDescription->PortTypes->Add( soapPortType ); - - // Create the 'Message' object. - Message^ soapMessage1 = gcnew Message; - soapMessage1->Name = "AddNumbersSoapIn"; - - // Create the 'MessageParts' object. - MessagePart^ soapMessagePart1 = gcnew MessagePart; - soapMessagePart1->Name = "parameters"; - soapMessagePart1->Element = gcnew XmlQualifiedName( "s0:AddNumbers" ); - - // Add the 'MessagePart' object to 'Messages' object. - soapMessage1->Parts->Add( soapMessagePart1 ); - - // Create another 'Message' object. - Message^ soapMessage2 = gcnew Message; - soapMessage2->Name = "AddNumbersSoapOut"; - MessagePart^ soapMessagePart2 = gcnew MessagePart; - soapMessagePart2->Name = "parameters"; - soapMessagePart2->Element = gcnew XmlQualifiedName( "s0:AddNumbersResponse" ); - - // Add the 'MessagePart' object to second 'Message' object. - soapMessage2->Parts->Add( soapMessagePart2 ); - - // Add the 'Message' objects to 'ServiceDescription'. - myDescription->Messages->Add( soapMessage1 ); - myDescription->Messages->Add( soapMessage2 ); - - // Write the 'ServiceDescription' object as a WSDL file. - myDescription->Write( "AddNumbersOut_cs.wsdl" ); - Console::WriteLine( " 'AddNumbersOut_cs.Wsdl' file was generated" ); -} diff --git a/snippets/cpp/VS_Snippets_Remoting/SoapBodyBinding_Parts/CPP/soapbodybinding_parts.cpp b/snippets/cpp/VS_Snippets_Remoting/SoapBodyBinding_Parts/CPP/soapbodybinding_parts.cpp deleted file mode 100644 index 72d797fd574..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/SoapBodyBinding_Parts/CPP/soapbodybinding_parts.cpp +++ /dev/null @@ -1,89 +0,0 @@ -// System.Web.Services.Description.SoapBinding.Namespace -// System.Web.Services.Description.SoapBodyBinding.Parts - -/* -The following example demonstrates the 'Namespace' field of 'SoapBinding' class -and 'parts' property of 'SoapBodyBinding' class. -It takes a wsdl file which supports two protocols 'HttpGet' and 'HttpPost' as input. By -using the 'Read' method of 'ServiceDescription' class it gets the 'ServiceDescription' -object. It uses the SOAP protocol related classes to create 'Binding' elements of -'SOAP' protocol. It adds all the elements to the 'ServiceDescription' object. The -'ServiceDescription' object creates another wsdl file which supports 'SOAP' protocol -also. This wsdl file is used to generate a proxy which is used by the .aspx file. -*/ - -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Collections; -using namespace System::Xml; - -int main() -{ - ServiceDescription^ myDescription = - ServiceDescription::Read( "AddNumbersInput_cs.wsdl" ); - // Create a 'Binding' object for the 'SOAP' protocol. - Binding^ myBinding = gcnew Binding; - myBinding->Name = "Service1Soap"; - XmlQualifiedName^ qualifiedName = - gcnew XmlQualifiedName( "s0:Service1Soap" ); - - myBinding->Type = qualifiedName; - -// - SoapBinding^ mySoapBinding = gcnew SoapBinding; - mySoapBinding->Transport = "http://schemas.xmlsoap.org/soap/http"; - mySoapBinding->Style = SoapBindingStyle::Document; - // Get the URI for XML namespace of the SoapBinding class. - String^ myNameSpace = SoapBinding::Namespace; - Console::WriteLine( "The URI of the XML Namespace is :{0}", myNameSpace ); -// - - // Add the 'SoapBinding' object to the 'Binding' object. - myBinding->Extensions->Add( mySoapBinding ); - - // Create the 'OperationBinding' object for the 'SOAP' protocol. - OperationBinding^ myOperationBinding = gcnew OperationBinding; - myOperationBinding->Name = "AddNumbers"; - - // Create the 'SoapOperationBinding' object for the 'SOAP' protocol. - SoapOperationBinding^ mySoapOperationBinding = - gcnew SoapOperationBinding; - mySoapOperationBinding->SoapAction = "http://tempuri.org/AddNumbers"; - mySoapOperationBinding->Style = SoapBindingStyle::Document; - // Add the 'SoapOperationBinding' object to 'OperationBinding' object. - myOperationBinding->Extensions->Add( mySoapOperationBinding ); - -// - // Create the 'InputBinding' object for the 'SOAP' protocol. - InputBinding^ myInput = gcnew InputBinding; - SoapBodyBinding^ mySoapBinding1 = gcnew SoapBodyBinding; - mySoapBinding1->Use = SoapBindingUse::Literal; - - array^ myParts = gcnew array(1); - myParts[ 0 ] = "parameters"; - // Set the names of the message parts to appear in the SOAP body. - mySoapBinding1->Parts = myParts; - myInput->Extensions->Add( mySoapBinding1 ); - // Add the 'InputBinding' object to 'OperationBinding' object. - myOperationBinding->Input = myInput; - // Create the 'OutputBinding' object'. - OutputBinding^ myOutput = gcnew OutputBinding; - myOutput->Extensions->Add( mySoapBinding1 ); - // Add the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding->Output = myOutput; -// - - // Add the 'OperationBinding' to 'Binding'. - myBinding->Operations->Add( myOperationBinding ); - - // Add the 'Binding' to 'BindingCollection' of 'ServiceDescription'. - myDescription->Bindings->Add( myBinding ); - - // Write the 'ServiceDescription' as a WSDL file. - myDescription->Write( "AddNumbersOut_cs.wsdl" ); - Console::WriteLine( " 'AddNumbersOut_cs.Wsdl' file was generated" ); -} diff --git a/snippets/cpp/VS_Snippets_Remoting/SoapFaultBinding/CPP/soapfaultbinding.cpp b/snippets/cpp/VS_Snippets_Remoting/SoapFaultBinding/CPP/soapfaultbinding.cpp deleted file mode 100644 index cd2422d09e2..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/SoapFaultBinding/CPP/soapfaultbinding.cpp +++ /dev/null @@ -1,68 +0,0 @@ -// System::Web::Services::Description.SoapFaultBinding - -/* -The following example demonstrates 'SoapFaultBinding' class. -It creates an instance of 'ServiceDescription' class by reading an existing -wsdl file. Then it creates an instance of 'SoapFaultBinding' and adds it to -the collection object of 'Binding' class. It generates a new wsdl file where -the properties of 'SoapFaultBinding' objects are reflected and which could be -used for generating a proxy. -*/ - -// -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; - -int main() -{ - try - { - // Input wsdl file. - String^ myInputWsdlFile = "SoapFaultBindingInput_cpp.wsdl"; - - // Output wsdl file. - String^ myOutputWsdlFile = "SoapFaultBindingOutput_cpp.wsdl"; - - // Initialize an instance of a 'ServiceDescription' object. - ServiceDescription^ myServiceDescription = ServiceDescription::Read( myInputWsdlFile ); - - // Get a SOAP binding object with binding name S"MyService1Soap". - Binding^ myBinding = myServiceDescription->Bindings[ "MyService1Soap" ]; - - // Create a new instance of 'SoapFaultBinding' class. - SoapFaultBinding^ mySoapFaultBinding = gcnew SoapFaultBinding; - - // Encode fault message using rules specified by 'Encoding' property. - mySoapFaultBinding->Use = SoapBindingUse::Encoded; - - // Set the URI representing the encoding style. - mySoapFaultBinding->Encoding = "http://tempuri.org/stockquote"; - - // Set the URI representing the location of the specification - // for encoding of content not defined by 'Encoding' property'. - mySoapFaultBinding->Namespace = "http://tempuri.org/stockquote"; - - // Create a new instance of 'FaultBinding'. - FaultBinding^ myFaultBinding = gcnew FaultBinding; - myFaultBinding->Name = "AddFaultbinding"; - myFaultBinding->Extensions->Add( mySoapFaultBinding ); - - // Get existing 'OperationBinding' object. - OperationBinding^ myOperationBinding = myBinding->Operations[ 0 ]; - myOperationBinding->Faults->Add( myFaultBinding ); - - // Create a new wsdl file. - myServiceDescription->Write( myOutputWsdlFile ); - Console::WriteLine( "The new wsdl file created is : {0}", myOutputWsdlFile ); - Console::WriteLine( "Proxy could be created using command : wsdl {0}", myOutputWsdlFile ); - } - catch ( Exception^ e ) - { - Console::WriteLine( "Error occurred : {0}", e->Message ); - } -} -// diff --git a/snippets/cpp/VS_Snippets_Remoting/SoapFaultBinding_ctor/CPP/soapfaultbinding_ctor.cpp b/snippets/cpp/VS_Snippets_Remoting/SoapFaultBinding_ctor/CPP/soapfaultbinding_ctor.cpp deleted file mode 100644 index 0c69f5c1ea8..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/SoapFaultBinding_ctor/CPP/soapfaultbinding_ctor.cpp +++ /dev/null @@ -1,110 +0,0 @@ -// System::Web::Services::Description.SoapBodyBinding::PartsString -// System::Web::Services::Description.SoapFaultBinding::ctor -// System::Web::Services::Description.SoapFaultBinding::Use -// System::Web::Services::Description.SoapFaultBinding::Encoding -// System::Web::Services::Description.SoapFaultBinding::NameSpace - -/* -The following example demonstrates the 'PartsString' property of 'SoapBodyBinding' class -and constructor, 'Encoding', 'NameSpace' and 'Use'properties of 'SoapFaultBinding' class. - -It creates an instance of 'ServiceDescription' class by reading an existing -wsdl file. Then it creates an instance of 'SoapFaultBinding' and adds it to -the collection object of 'Binding' class. It generates a new wsdl file where -the properties of 'SoapFaultBinding' objects are reflected and which could be -used for generating a proxy. -*/ - -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -int main() -{ - try - { - // Input wsdl file. - String^ myInputWsdlFile = "SoapFaultInput_cpp.wsdl"; - - // Output wsdl file. - String^ myOutputWsdlFile = "SoapFaultOutput_cpp.wsdl"; - - // Initialize an instance of a 'ServiceDescription' object. - ServiceDescription^ myServiceDescription = ServiceDescription::Read( myInputWsdlFile ); - - // Get a SOAP binding object with binding name S"MyService1Soap". - Binding^ myBinding = myServiceDescription->Bindings[ "MyService1Soap" ]; - - // Create the 'OperationBinding' object for the 'SOAP' protocol. - OperationBinding^ myOperationBinding = gcnew OperationBinding; - myOperationBinding->Name = "Add"; - - // Create the 'SoapOperationBinding' object for the 'SOAP' protocol. - SoapOperationBinding^ mySoapOperationBinding = gcnew SoapOperationBinding; - mySoapOperationBinding->SoapAction = "http://tempuri.org/Add"; - mySoapOperationBinding->Style = SoapBindingStyle::Document; - - // Add the 'SoapOperationBinding' object to 'OperationBinding' object. - myOperationBinding->Extensions->Add( mySoapOperationBinding ); - - // - // Create the 'InputBinding' object for the 'SOAP' protocol. - InputBinding^ myInput = gcnew InputBinding; - SoapBodyBinding^ mySoapBinding1 = gcnew SoapBodyBinding; - mySoapBinding1->PartsString = "parameters"; - mySoapBinding1->Use = SoapBindingUse::Literal; - myInput->Extensions->Add( mySoapBinding1 ); - - // Assign the 'InputBinding' to 'OperationBinding'. - myOperationBinding->Input = myInput; - - // Create the 'OutputBinding' object' for the 'SOAP' protocol.. - OutputBinding^ myOutput = gcnew OutputBinding; - myOutput->Extensions->Add( mySoapBinding1 ); - - // Assign the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding->Output = myOutput; - // - - // - // - // - // - // Create a new instance of 'SoapFaultBinding' class. - SoapFaultBinding^ mySoapFaultBinding = gcnew SoapFaultBinding; - - // Encode fault message using rules specified by 'Encoding' property. - mySoapFaultBinding->Use = SoapBindingUse::Encoded; - - // Set the URI representing the encoding style. - mySoapFaultBinding->Encoding = "http://tempuri.org/stockquote"; - - // Set the URI representing the location of the specification - // for encoding of content not defined by 'Encoding' property'. - mySoapFaultBinding->Namespace = "http://tempuri.org/stockquote"; - - // Create a new instance of 'FaultBinding'. - FaultBinding^ myFaultBinding = gcnew FaultBinding; - myFaultBinding->Name = "AddFaultbinding"; - myFaultBinding->Extensions->Add( mySoapFaultBinding ); - - // Get existing 'OperationBinding' object. - myOperationBinding->Faults->Add( myFaultBinding ); - myBinding->Operations->Add( myOperationBinding ); - - // - // - // - // - // Create a new wsdl file. - myServiceDescription->Write( myOutputWsdlFile ); - Console::WriteLine( "The new wsdl file created is : {0}", myOutputWsdlFile ); - Console::WriteLine( "Proxy could be created using command : wsdl {0}", myOutputWsdlFile ); - } - catch ( Exception^ e ) - { - Console::WriteLine( "Error occurred : {0}", e->Message ); - } -} diff --git a/snippets/cpp/VS_Snippets_Remoting/SoapHeaderBinding/CPP/soapheaderbinding.cpp b/snippets/cpp/VS_Snippets_Remoting/SoapHeaderBinding/CPP/soapheaderbinding.cpp deleted file mode 100644 index ff5d56ef650..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/SoapHeaderBinding/CPP/soapheaderbinding.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// System::Web::Services::Description.SoapHeaderBinding - -/* -The following example demonstrates the class 'SoapHeaderBinding'. -It takes as input a wsdl file. By using the 'Read' method -of 'ServiceDescription' class it gets a 'ServiceDescription' object. -It uses the SOAP protocol related classes and creates 'Binding' element -of 'SOAP' protocol which are then added to the 'ServiceDescription' object. -An output wsdl file is generated from 'ServiceDescription' object which -could be used for generating a proxy. - -*/ - -// -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Collections; -using namespace System::Xml; - -int main() -{ - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "SoapHeaderBindingInput_cpp.wsdl" ); - Binding^ myBinding = gcnew Binding; - myBinding->Name = "MyWebServiceSoap"; - myBinding->Type = gcnew XmlQualifiedName( "s0:MyWebServiceSoap" ); - SoapBinding^ mySoapBinding = gcnew SoapBinding; - mySoapBinding->Transport = "http://schemas.xmlsoap.org/soap/http"; - mySoapBinding->Style = SoapBindingStyle::Document; - myBinding->Extensions->Add( mySoapBinding ); - OperationBinding^ myOperationBinding = gcnew OperationBinding; - myOperationBinding->Name = "Hello"; - SoapOperationBinding^ mySoapOperationBinding = gcnew SoapOperationBinding; - mySoapOperationBinding->SoapAction = "http://tempuri.org/Hello"; - mySoapOperationBinding->Style = SoapBindingStyle::Document; - myOperationBinding->Extensions->Add( mySoapOperationBinding ); - - // Create InputBinding for operation for the 'SOAP' protocol. - InputBinding^ myInputBinding = gcnew InputBinding; - SoapBodyBinding^ mySoapBodyBinding = gcnew SoapBodyBinding; - mySoapBodyBinding->Use = SoapBindingUse::Literal; - myInputBinding->Extensions->Add( mySoapBodyBinding ); - SoapHeaderBinding^ mySoapHeaderBinding = gcnew SoapHeaderBinding; - mySoapHeaderBinding->Message = gcnew XmlQualifiedName( "s0:HelloMyHeader" ); - mySoapHeaderBinding->Part = "MyHeader"; - mySoapHeaderBinding->Use = SoapBindingUse::Literal; - - // Add mySoapHeaderBinding to 'myInputBinding' object. - myInputBinding->Extensions->Add( mySoapHeaderBinding ); - - // Create OutputBinding for operation for the 'SOAP' protocol. - OutputBinding^ myOutputBinding = gcnew OutputBinding; - myOutputBinding->Extensions->Add( mySoapBodyBinding ); - - // Add 'InputBinding' and 'OutputBinding' to 'OperationBinding'. - myOperationBinding->Input = myInputBinding; - myOperationBinding->Output = myOutputBinding; - myBinding->Operations->Add( myOperationBinding ); - myServiceDescription->Bindings->Add( myBinding ); - myServiceDescription->Write( "SoapHeaderBindingOut_cpp.wsdl" ); - Console::WriteLine( "'SoapHeaderBindingOut_cpp.wsdl' file is generated." ); - Console::WriteLine( "Proxy could be created using 'wsdl SoapHeaderBindingOut_cpp.wsdl'." ); -} -// diff --git a/snippets/cpp/VS_Snippets_Remoting/SoapHeaderBinding_MapToProperty/CPP/soapheaderbinding_maptoproperty.cpp b/snippets/cpp/VS_Snippets_Remoting/SoapHeaderBinding_MapToProperty/CPP/soapheaderbinding_maptoproperty.cpp deleted file mode 100644 index 094bfdc3008..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/SoapHeaderBinding_MapToProperty/CPP/soapheaderbinding_maptoproperty.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// System::Web::Services::Description.SoapHeaderBinding::MapToProperty - -/* -The following example demonstrates the 'MapToProperty' property of class 'SoapHeaderBinding'. -It reads an existing wsdl file and gets 'SoapHeaderBinding' instance from it. -'MapToProperty' property of this instance is checked to see whether this instance -is mapped to a specific property in proxy class or not. -*/ - -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; - -int main() -{ - // - // Read from an existing wsdl file. - ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MapToProperty_cpp.wsdl" ); - - // Get the existing binding - Binding^ myBinding = myServiceDescription->Bindings[ "MyWebServiceSoap" ]; - OperationBinding^ myOperationBinding = (OperationBinding^)(myBinding->Operations[ 0 ]); - InputBinding^ myInputBinding = myOperationBinding->Input; - - // Get the 'SoapHeaderBinding' instance from 'myInputBinding'. - SoapHeaderBinding^ mySoapHeaderBinding = (SoapHeaderBinding^)(myInputBinding->Extensions[ 1 ]); - if ( mySoapHeaderBinding->MapToProperty ) - Console::WriteLine( "'SoapHeaderBinding' instance is mapped to a specific property in proxy generated class" ); - else - Console::WriteLine( "'SoapHeaderBinding' instance is not mapped to a specific property in proxy generated class" ); - // -} diff --git a/snippets/cpp/VS_Snippets_Remoting/SoapHeaderBinding_Use/CPP/soapheaderbinding_use.cpp b/snippets/cpp/VS_Snippets_Remoting/SoapHeaderBinding_Use/CPP/soapheaderbinding_use.cpp deleted file mode 100644 index 0223ff8c500..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/SoapHeaderBinding_Use/CPP/soapheaderbinding_use.cpp +++ /dev/null @@ -1,87 +0,0 @@ -// System::Web::Services::Description.SoapHeaderBinding::ctor -// System::Web::Services::Description.SoapHeaderBinding::Message -// System::Web::Services::Description.SoapHeaderBinding::Part -// System::Web::Services::Description.SoapHeaderBinding::Use - -/* -The following example demonstrates the constructor, 'Message' , 'Part' -and 'Use' properties of the class 'SoapHeaderBinding'. -It takes as input a wsdl file. The binding element corresponding to -SOAP protocol is removed from the input file. By using the 'Read' method -of 'ServiceDescription' class it gets a 'ServiceDescription' Object*. -It uses the SOAP protocol related classes and creates 'Binding' element -of 'SOAP' protocol which are then added to the 'ServiceDescription' Object*. -An output wsdl file is generated from 'ServiceDescription' Object* which -could be used for generating a proxy. -*/ - -#using -#using -#using - -using namespace System; -using namespace System::Collections; -using namespace System::Web::Services::Description; -using namespace System::Xml; - -int main() -{ - ServiceDescription^ myServiceDescription = - ServiceDescription::Read( "SoapHeaderBindingInput_cpp.wsdl" ); - Binding^ myBinding = gcnew Binding; - myBinding->Name = "MyWebServiceSoap"; - myBinding->Type = gcnew XmlQualifiedName( "s0:MyWebServiceSoap" ); - - SoapBinding^ mySoapBinding = gcnew SoapBinding; - mySoapBinding->Transport = "http://schemas.xmlsoap.org/soap/http"; - mySoapBinding->Style = SoapBindingStyle::Document; - myBinding->Extensions->Add( mySoapBinding ); - - OperationBinding^ myOperationBinding = gcnew OperationBinding; - myOperationBinding->Name = "Hello"; - - SoapOperationBinding^ mySoapOperationBinding = - gcnew SoapOperationBinding; - mySoapOperationBinding->SoapAction = "http://tempuri.org/Hello"; - mySoapOperationBinding->Style = SoapBindingStyle::Document; - myOperationBinding->Extensions->Add( mySoapOperationBinding ); - - // Create InputBinding for operation for the 'SOAP' protocol. - InputBinding^ myInputBinding = gcnew InputBinding; - SoapBodyBinding^ mySoapBodyBinding = gcnew SoapBodyBinding; - mySoapBodyBinding->Use = SoapBindingUse::Literal; - myInputBinding->Extensions->Add( mySoapBodyBinding ); - -// -// -// -// - SoapHeaderBinding^ mySoapHeaderBinding = gcnew SoapHeaderBinding; - // Set the Message within the XML Web service to which the - // 'SoapHeaderBinding' applies. - mySoapHeaderBinding->Message = - gcnew XmlQualifiedName( "s0:HelloMyHeader" ); - mySoapHeaderBinding->Part = "MyHeader"; - mySoapHeaderBinding->Use = SoapBindingUse::Literal; - // Add mySoapHeaderBinding to the 'myInputBinding' object. - myInputBinding->Extensions->Add( mySoapHeaderBinding ); -// -// -// -// - - // Create OutputBinding for operation for the 'SOAP' protocol. - OutputBinding^ myOutputBinding = gcnew OutputBinding; - myOutputBinding->Extensions->Add( mySoapBodyBinding ); - - // Add 'InputBinding' and 'OutputBinding' to 'OperationBinding'. - myOperationBinding->Input = myInputBinding; - myOperationBinding->Output = myOutputBinding; - myBinding->Operations->Add( myOperationBinding ); - - myServiceDescription->Bindings->Add( myBinding ); - myServiceDescription->Write( "SoapHeaderBindingOut_cpp.wsdl" ); - Console::WriteLine( "'SoapHeaderBindingOut_cpp.wsdl' file is generated." ); - Console::WriteLine( "Proxy could be created using " + - "'wsdl SoapHeaderBindingOut_cpp.wsdl'." ); -} diff --git a/snippets/cpp/VS_Snippets_Remoting/SoapOperationBinding/CPP/soapoperationbinding.cpp b/snippets/cpp/VS_Snippets_Remoting/SoapOperationBinding/CPP/soapoperationbinding.cpp deleted file mode 100644 index c0254af595f..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/SoapOperationBinding/CPP/soapoperationbinding.cpp +++ /dev/null @@ -1,104 +0,0 @@ - - -// System.Web.Services.Description.SoapBinding -// System.Web.Services.Description.SoapOperationBinding -// System.Web.Services.Description.SoapBodyBinding -// System.Web.Services.Description.SoapAddressBinding -// System.Web.Services.Description.SoapBinding.HttpTransport; -/* -The following example demonstrates the 'SoapBinding', 'SoapOperationBinding' , -'SoapBodyBinding' , SoapAddressBinding' classes and 'HttpTransport' field of 'SoapBinding' class. - -It takes a wsdl file which supports two protocols 'HttpGet' and 'HttpPost' as input. By using the -'Read' method of 'ServiceDescription' class it gets the 'ServiceDescription' object. It uses -the SOAP protocol related classes and creates 'Binding','Port' and 'PortType' elements of -'SOAP' protocol. It adds all the elements to the 'ServiceDescription' object. The 'ServiceDescription' -object creates another wsdl file which supports 'SOAP' also. This wsdl file is used to generate a proxy -which is used by the .aspx file. -*/ -// -// -// -// -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Collections; -using namespace System::Xml; -int main() -{ - ServiceDescription^ myDescription = ServiceDescription::Read( "AddNumbersInput_cs.wsdl" ); - - // Create a 'Binding' object for the 'SOAP' protocol. - Binding^ myBinding = gcnew Binding; - myBinding->Name = "Service1Soap"; - XmlQualifiedName^ qualifiedName = gcnew XmlQualifiedName( "s0:Service1Soap" ); - myBinding->Type = qualifiedName; - - // - SoapBinding^ mySoapBinding = gcnew SoapBinding; - mySoapBinding->Transport = SoapBinding::HttpTransport; - mySoapBinding->Style = SoapBindingStyle::Document; - // - - // Add the 'SoapBinding' object to the 'Binding' object. - myBinding->Extensions->Add( mySoapBinding ); - - // Create the 'OperationBinding' object for the 'SOAP' protocol. - OperationBinding^ myOperationBinding = gcnew OperationBinding; - myOperationBinding->Name = "AddNumbers"; - - // Create the 'SoapOperationBinding' object for the 'SOAP' protocol. - SoapOperationBinding^ mySoapOperationBinding = gcnew SoapOperationBinding; - mySoapOperationBinding->SoapAction = "http://tempuri.org/AddNumbers"; - mySoapOperationBinding->Style = SoapBindingStyle::Document; - - // Add the 'SoapOperationBinding' object to 'OperationBinding' object. - myOperationBinding->Extensions->Add( mySoapOperationBinding ); - - // Create the 'InputBinding' object for the 'SOAP' protocol. - InputBinding^ myInput = gcnew InputBinding; - SoapBodyBinding^ mySoapBinding1 = gcnew SoapBodyBinding; - mySoapBinding1->Use = SoapBindingUse::Literal; - myInput->Extensions->Add( mySoapBinding1 ); - - // Assign the 'InputBinding' to 'OperationBinding'. - myOperationBinding->Input = myInput; - - // Create the 'OutputBinding' object' for the 'SOAP' protocol.. - OutputBinding^ myOutput = gcnew OutputBinding; - myOutput->Extensions->Add( mySoapBinding1 ); - - // Assign the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding->Output = myOutput; - - // Add the 'OperationBinding' to 'Binding'. - myBinding->Operations->Add( myOperationBinding ); - - // Add the 'Binding' to 'BindingCollection' of 'ServiceDescription'. - myDescription->Bindings->Add( myBinding ); - Port^ soapPort = gcnew Port; - soapPort->Name = "Service1Soap"; - soapPort->Binding = gcnew XmlQualifiedName( "s0:Service1Soap" ); - - // Create a 'SoapAddressBinding' object for the 'SOAP' protocol. - SoapAddressBinding^ mySoapAddressBinding = gcnew SoapAddressBinding; - mySoapAddressBinding->Location = "http://localhost/AddNumbers.cs.asmx"; - - // Add the 'SoapAddressBinding' to the 'Port'. - soapPort->Extensions->Add( mySoapAddressBinding ); - - // Add the 'Port' to 'PortCollection' of 'ServiceDescription'. - myDescription->Services[ 0 ]->Ports->Add( soapPort ); - - // Write the 'ServiceDescription' as a WSDL file. - myDescription->Write( "AddNumbersOut_cs.wsdl" ); - Console::WriteLine( " 'AddNumbersOut_cs.Wsdl' file was generated" ); -} -// -// -// -// diff --git a/snippets/cpp/VS_Snippets_Remoting/WebServices_HttpBinding/CPP/httpbinding.cpp b/snippets/cpp/VS_Snippets_Remoting/WebServices_HttpBinding/CPP/httpbinding.cpp deleted file mode 100644 index 311e3586e48..00000000000 --- a/snippets/cpp/VS_Snippets_Remoting/WebServices_HttpBinding/CPP/httpbinding.cpp +++ /dev/null @@ -1,151 +0,0 @@ - - -//System.Web.Services.HttpBinding;System.Web.Services.HttpBinding.Verb; -//System.Web.Services.HttpAddressBinding; -//System.Web.Services.HttpAddressBinding.Location; -/* - The following example demonstrates the 'HttpBinding()' constructor - and 'Verb' property of class 'HttpBinding' and 'HttpAddressBinding() - 'constructor and 'Location' property of class 'HttpAddressBinding'. - It creates a 'ServiceDescription' instance by using the - static read method of 'ServiceDescription' by passing the - 'AddNumbers1.wsdl' name as an argument. It creates a 'Binding' - object and adds that binding object to 'ServiceDescription'. - It adds the 'PortType',Messages to the 'ServiceDescription' object. - Finally it writes the 'ServiceDescrption' as a WSDL file with name - 'AddNumbers.wsdl. - */ -#using -#using -#using - -using namespace System; -using namespace System::Web::Services::Description; -using namespace System::Collections; -using namespace System::Xml; - -int main() -{ - ServiceDescription^ myDescription = ServiceDescription::Read( "AddNumbers1.wsdl" ); - - // Create the 'Binding' object. - Binding^ myBinding = gcnew Binding; - myBinding->Name = "Service1HttpPost"; - XmlQualifiedName^ qualifiedName = gcnew XmlQualifiedName( "s0:Service1HttpPost" ); - myBinding->Type = qualifiedName; - - // - // - // Create the 'HttpBinding' object. - HttpBinding^ myHttpBinding = gcnew HttpBinding; - myHttpBinding->Verb = "POST"; - - // Add the 'HttpBinding' to the 'Binding'. - myBinding->Extensions->Add( myHttpBinding ); - // - // - - // Create the 'OperationBinding' object. - OperationBinding^ myOperationBinding = gcnew OperationBinding; - myOperationBinding->Name = "AddNumbers"; - HttpOperationBinding^ myOperation = gcnew HttpOperationBinding; - myOperation->Location = "/AddNumbers"; - - // Add the 'HttpOperationBinding' to 'OperationBinding'. - myOperationBinding->Extensions->Add( myOperation ); - - // Create the 'InputBinding' object. - InputBinding^ myInput = gcnew InputBinding; - MimeContentBinding^ postMimeContentbinding = gcnew MimeContentBinding; - postMimeContentbinding->Type = "application/x-www-form-urlencoded"; - myInput->Extensions->Add( postMimeContentbinding ); - - // Add the 'InputBinding' to 'OperationBinding'. - myOperationBinding->Input = myInput; - - // Create the 'OutputBinding' object. - OutputBinding^ myOutput = gcnew OutputBinding; - MimeXmlBinding^ postMimeXmlbinding = gcnew MimeXmlBinding; - postMimeXmlbinding->Part = "Body"; - myOutput->Extensions->Add( postMimeXmlbinding ); - - // Add the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding->Output = myOutput; - - // Add the 'OperationBinding' to 'Binding'. - myBinding->Operations->Add( myOperationBinding ); - - // Add the 'Binding' to 'BindingCollection' of 'ServiceDescription'. - myDescription->Bindings->Add( myBinding ); - - // Create a 'Port' object. - Port^ postPort = gcnew Port; - postPort->Name = "Service1HttpPost"; - postPort->Binding = gcnew XmlQualifiedName( "s0:Service1HttpPost" ); - - // - // - // Create the 'HttpAddressBinding' object. - HttpAddressBinding^ postAddressBinding = gcnew HttpAddressBinding; - postAddressBinding->Location = "http://localhost/Service1.asmx"; - - // Add the 'HttpAddressBinding' to the 'Port'. - postPort->Extensions->Add( postAddressBinding ); - // - // - - // Add the 'Port' to 'PortCollection' of 'ServiceDescription'. - myDescription->Services[ 0 ]->Ports->Add( postPort ); - - // Create a 'PortType' object. - PortType^ postPortType = gcnew PortType; - postPortType->Name = "Service1HttpPost"; - Operation^ postOperation = gcnew Operation; - postOperation->Name = "AddNumbers"; - OperationMessage^ postInput = dynamic_cast(gcnew OperationInput); - postInput->Message = gcnew XmlQualifiedName( "s0:AddNumbersHttpPostIn" ); - OperationMessage^ postOutput = dynamic_cast(gcnew OperationOutput); - postOutput->Message = gcnew XmlQualifiedName( "s0:AddNumbersHttpPostOut" ); - postOperation->Messages->Add( postInput ); - postOperation->Messages->Add( postOutput ); - - // Add the 'Operation' to 'PortType'. - postPortType->Operations->Add( postOperation ); - - // Adds the 'PortType' to 'PortTypeCollection' of 'ServiceDescription'. - myDescription->PortTypes->Add( postPortType ); - - // Create the 'Message' object. - Message^ postMessage1 = gcnew Message; - postMessage1->Name = "AddNumbersHttpPostIn"; - - // Create the 'MessageParts'. - MessagePart^ postMessagePart1 = gcnew MessagePart; - postMessagePart1->Name = "firstnumber"; - postMessagePart1->Type = gcnew XmlQualifiedName( "s:string" ); - MessagePart^ postMessagePart2 = gcnew MessagePart; - postMessagePart2->Name = "secondnumber"; - postMessagePart2->Type = gcnew XmlQualifiedName( "s:string" ); - - // Add the 'MessagePart' objects to 'Messages'. - postMessage1->Parts->Add( postMessagePart1 ); - postMessage1->Parts->Add( postMessagePart2 ); - - // Create another 'Message' object. - Message^ postMessage2 = gcnew Message; - postMessage2->Name = "AddNumbersHttpPostOut"; - MessagePart^ postMessagePart3 = gcnew MessagePart; - postMessagePart3->Name = "Body"; - postMessagePart3->Element = gcnew XmlQualifiedName( "s0:int" ); - - // Add the 'MessagePart' to 'Message' - postMessage2->Parts->Add( postMessagePart3 ); - - // Add the 'Message' objects to 'ServiceDescription'. - myDescription->Messages->Add( postMessage1 ); - myDescription->Messages->Add( postMessage2 ); - - // Write the 'ServiceDescription' as a WSDL file. - myDescription->Write( "AddNumbers.wsdl" ); - Console::WriteLine( "WSDL file with name 'AddNumber.Wsdl' file created Successfully" ); -} diff --git a/snippets/csharp/System.Web.Services.Configuration/XmlFormatExtensionAttribute/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Configuration/XmlFormatExtensionAttribute/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Configuration/XmlFormatExtensionAttribute/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Configuration/XmlFormatExtensionAttribute/Overview/source.cs b/snippets/csharp/System.Web.Services.Configuration/XmlFormatExtensionAttribute/Overview/source.cs deleted file mode 100644 index 18b89ba463a..00000000000 --- a/snippets/csharp/System.Web.Services.Configuration/XmlFormatExtensionAttribute/Overview/source.cs +++ /dev/null @@ -1,203 +0,0 @@ -// -using System; -using System.Security.Permissions; -using System.CodeDom; -using System.IO; -using System.Text; -using System.Web.Services.Configuration; -using System.Web.Services.Description; -using System.Web.Services.Protocols; -using System.Xml.Serialization; - -// The YMLAttribute allows a developer to specify that the YML SOAP -// extension run on a per-method basis. The Disabled property -// turns reversing the XML on and off. - -[AttributeUsage(AttributeTargets.Method, AllowMultiple=false)] -public class YMLAttribute : SoapExtensionAttribute { - int priority = 0; - bool disabled = false; - - public YMLAttribute() : this(false) {} - public YMLAttribute(bool disabled) - { - this.disabled = disabled; - } - - public override Type ExtensionType - { - get { return typeof(YMLExtension); } - } - public override int Priority - { - get { return priority; } - set { priority = value; } - } - - public bool Disabled - { - get { return disabled; } - set { disabled = value; } - } -} - -public class YMLExtension : SoapExtension { - bool disabled = false; - Stream oldStream; - Stream newStream; - - public override object GetInitializer(LogicalMethodInfo methodInfo, - SoapExtensionAttribute attribute) - { - YMLAttribute attr = attribute as YMLAttribute; - if (attr != null) return attr.Disabled; - return false; - } - - public override object GetInitializer(Type serviceType) - { - return false; - } - - public override void Initialize(object initializer) - { - if (initializer is Boolean) disabled = (bool)initializer; - } - - public override Stream ChainStream(Stream stream) - { - if (disabled) return base.ChainStream(stream); - oldStream = stream; - newStream = new MemoryStream(); - return newStream; - } - - public override void ProcessMessage(SoapMessage message) - { - if (disabled) return; - switch (message.Stage) - { - case SoapMessageStage.BeforeSerialize: - Encode(message); - break; - case SoapMessageStage.AfterSerialize: - newStream.Position = 0; - Reverse(newStream, oldStream); - break; - case SoapMessageStage.BeforeDeserialize: - Decode(message); - break; - case SoapMessageStage.AfterDeserialize: - break; - } - } - - void Encode(SoapMessage message) - { - message.ContentType = "text/yml"; - } - - void Decode(SoapMessage message) - { - if (message.ContentType != "text/yml") - throw new Exception( - "invalid content type:" + message.ContentType); - Reverse(oldStream, newStream); - newStream.Position = 0; - message.ContentType = "text/xml"; - } - - void Reverse(Stream from, Stream to) - { - TextReader reader = new StreamReader(from); - TextWriter writer = new StreamWriter(to); - string line; - while ((line = reader.ReadLine()) != null) - { - StringBuilder builder = new StringBuilder(); - for (int i = line.Length - 1; i >= 0; i--) - { - builder.Append(line[i]); - } - writer.WriteLine(builder.ToString()); - } - writer.Flush(); - } -} -// The YMLReflector class is part of the YML SDFE, as it is -// called during the service description generation process. -[PermissionSet(SecurityAction.Demand, Name="FullTrust")] -public class YMLReflector : SoapExtensionReflector -{ - public override void ReflectMethod() - { - ProtocolReflector reflector = ReflectionContext; - YMLAttribute attr = - (YMLAttribute)reflector.Method.GetCustomAttribute( - typeof(YMLAttribute)); - // If the YMLAttribute has been applied to this XML Web service - // method, add the XML defined in the YMLOperationBinding class. - if (attr != null) - { - YMLOperationBinding yml = new YMLOperationBinding(); - yml.Reverse = !(attr.Disabled); - reflector.OperationBinding.Extensions.Add(yml); - } - } -} - -// The YMLImporter class is part of the YML SDFE, as it is called when a -// proxy class is generated for each XML Web service method the proxy class -// communicates with. The class checks whether the service description -// contains the XML that this SDFE adds to a service description. If it -// exists, then the YMLExtension is applied to the method in the proxy class. -[PermissionSet(SecurityAction.Demand, Name="FullTrust")] -public class YMLImporter : SoapExtensionImporter -{ - public override void ImportMethod( - CodeAttributeDeclarationCollection metadata) - { - SoapProtocolImporter importer = ImportContext; - // Check whether the XML specified in the YMLOperationBinding - // is in the service description. - YMLOperationBinding yml = - (YMLOperationBinding)importer.OperationBinding.Extensions.Find( - typeof(YMLOperationBinding)); - if (yml != null) - { - // Only apply the YMLAttribute to the method when the XML should - // be reversed. - if (yml.Reverse) - { - CodeAttributeDeclaration attr = - new CodeAttributeDeclaration(typeof(YMLAttribute).FullName); - attr.Arguments.Add( - new CodeAttributeArgument(new CodePrimitiveExpression(true))); - metadata.Add(attr); - } - } - } -} - -// -// The YMLOperationBinding class is part of the YML SDFE, as it is the -// class that is serialized into XML and is placed in the service -// description. -[XmlFormatExtension("action", YMLOperationBinding.YMLNamespace, - typeof(OperationBinding))] -[XmlFormatExtensionPrefix("yml", YMLOperationBinding.YMLNamespace)] -public class YMLOperationBinding : ServiceDescriptionFormatExtension -{ - private Boolean reverse; - - public const string YMLNamespace = "http://www.contoso.com/yml"; - - [XmlElement("Reverse")] - public Boolean Reverse - { - get { return reverse; } - set { reverse = value; } - } -} -// -// diff --git a/snippets/csharp/System.Web.Services.Description/Binding/Extensions/Project.csproj b/snippets/csharp/System.Web.Services.Description/Binding/Extensions/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/Binding/Extensions/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/Binding/Extensions/bindingcollectionsample2.cs b/snippets/csharp/System.Web.Services.Description/Binding/Extensions/bindingcollectionsample2.cs deleted file mode 100644 index fb38fe24972..00000000000 --- a/snippets/csharp/System.Web.Services.Description/Binding/Extensions/bindingcollectionsample2.cs +++ /dev/null @@ -1,149 +0,0 @@ -// System.Web.Services.Description.Binding.Binding();System.Web.Services.Description.Binding.Name; -// System.Web.Services.Description.Binding.Type;System.Web.Services.Description.Binding.Extensions;System.Web.Services.Description.Binding.Operations; -// System.Web.Services.Description.BindingCollection.Insert; -// System.Web.Services.Description.Binding.ServiceDescription; - -// Grouping Clause : Snippet5 and Snippet8 go together. - -/* The following example demonstrates the 'Binding()' constructor and the 'Extensions', 'Name' , 'Operations', - 'ServiceDescription', and 'Type' properties of the 'Binding' class AND the 'Insert' method of the 'BindingCollection' class. - The input to the program is a WSDL file 'MathService_input.wsdl' with all information related to SOAP protocol - removed from it. In a way, it tries to simulate a scenario wherein a service initially did not support a protocol, however later - on happen to support it. - In this example, the WSDL file is modified to insert a new Binding for SOAP. The binding is populated based on - WSDL document structure defined in WSDL specification. The ServiceDescription instance is loaded with values - for 'Messages', 'PortTypes', 'Bindings', and 'Port'. The instance is then written to an external file 'MathService_new.wsdl'. - - * */ -using System; -using System.Web.Services.Description; -using System.Collections; -using System.Xml; - -class MyClass -{ - public static void Main() - { - ServiceDescription myServiceDescription = ServiceDescription.Read("MathService_input.wsdl"); - // Create SOAP Messages. - myServiceDescription.Messages.Add(CreateMessage("AddSoapIn","parameters","Add",myServiceDescription.TargetNamespace)); - myServiceDescription.Messages.Add(CreateMessage("AddSoapOut","parameters","AddResponse",myServiceDescription.TargetNamespace)); - myServiceDescription.Messages.Add(CreateMessage("SubtractSoapIn","parameters","Subtract",myServiceDescription.TargetNamespace)); - myServiceDescription.Messages.Add(CreateMessage("SubtractSoapOut","parameters","SubtractResponse",myServiceDescription.TargetNamespace)); - myServiceDescription.Messages.Add(CreateMessage("MultiplySoapIn","parameters","Multiply",myServiceDescription.TargetNamespace)); - myServiceDescription.Messages.Add(CreateMessage("MultiplySoapOut","parameters","MultiplyResponse",myServiceDescription.TargetNamespace)); - myServiceDescription.Messages.Add(CreateMessage("DivideSoapIn","parameters","Divide",myServiceDescription.TargetNamespace)); - myServiceDescription.Messages.Add(CreateMessage("DivideSoapOut","parameters","DivideResponse",myServiceDescription.TargetNamespace)); - - // Create a new PortType. - PortType soapPortType = new PortType(); - soapPortType.Name = "MathServiceSoap"; - soapPortType.Operations.Add(CreateOperation("Add","AddSoapIn","AddSoapOut",myServiceDescription.TargetNamespace)); - soapPortType.Operations.Add(CreateOperation("Subtract","SubtractSoapIn","SubtractSoapOut",myServiceDescription.TargetNamespace)); - soapPortType.Operations.Add(CreateOperation("Multiply","MultiplySoapIn","MultiplySoapOut",myServiceDescription.TargetNamespace)); - soapPortType.Operations.Add(CreateOperation("Divide","DivideSoapIn","DivideSoapOut",myServiceDescription.TargetNamespace)); - myServiceDescription.PortTypes.Add(soapPortType); -// -// -// - // Create a new Binding for SOAP Protocol. - Binding myBinding = new Binding(); - myBinding.Name = myServiceDescription.Services[0].Name + "Soap"; -// -// - // Pass the name of the existing porttype 'MathServiceSoap' and the Xml targetNamespace attribute of the Descriptions tag. - myBinding.Type = new XmlQualifiedName("MathServiceSoap",myServiceDescription.TargetNamespace); -// -// - // Create SOAP Extensibility element. - SoapBinding mySoapBinding = new SoapBinding(); - // SOAP over HTTP. - mySoapBinding.Transport = "http://schemas.xmlsoap.org/soap/http"; - mySoapBinding.Style = SoapBindingStyle.Document; - // Add tag soap:binding as an extensibility element. - myBinding.Extensions.Add(mySoapBinding); -// -// - // Create OperationBindings for each of the operations defined in asmx file. - OperationBinding addOperationBinding = CreateOperationBinding("Add",myServiceDescription.TargetNamespace); - myBinding.Operations.Add(addOperationBinding); - OperationBinding subtractOperationBinding = CreateOperationBinding("Subtract",myServiceDescription.TargetNamespace); - myBinding.Operations.Add(subtractOperationBinding); - OperationBinding multiplyOperationBinding = CreateOperationBinding("Multiply",myServiceDescription.TargetNamespace); - myBinding.Operations.Add(multiplyOperationBinding); - OperationBinding divideOperationBinding = CreateOperationBinding("Divide",myServiceDescription.TargetNamespace); - myBinding.Operations.Add(divideOperationBinding); -// - myServiceDescription.Bindings.Insert(0,myBinding); -// -// -// - Console.WriteLine("\nTarget Namespace of the Service Description to which the binding was added is:" + myServiceDescription.Bindings[0].ServiceDescription.TargetNamespace); -// - // Create Port. - Port soapPort = new Port(); - soapPort.Name = "MathServiceSoap"; - soapPort.Binding = new XmlQualifiedName(myBinding.Name,myServiceDescription.TargetNamespace); - // Create SoapAddress extensibility element to add to port. - SoapAddressBinding mySoapAddressBinding = new SoapAddressBinding(); - mySoapAddressBinding.Location = "http://localhost/BindingCollectionSample/MathService.asmx"; - soapPort.Extensions.Add(mySoapAddressBinding); - // Add port to the MathService which is the first service in the Service Collection. - myServiceDescription.Services[0].Ports.Add(soapPort); - // Save the ServiceDescripition instance to an external file. - myServiceDescription.Write("MathService_new.wsdl"); - Console.WriteLine("\nSuccessfully added bindings for SOAP protocol and saved results in file MathService_new.wsdl"); - Console.WriteLine("\n This file should be passed to wsdl tool as input to generate proxy"); - } - // Creates a Message with name ="messageName" having one MessagePart with name = "partName". - public static Message CreateMessage(string messageName,string partName,string element,string targetNamespace) - { - Message myMessage = new Message(); - myMessage.Name = messageName; - MessagePart myMessagePart = new MessagePart(); - myMessagePart.Name = partName; - myMessagePart.Element = new XmlQualifiedName(element,targetNamespace); - myMessage.Parts.Add(myMessagePart); - return myMessage; - } -// - // Used to create OperationBinding instances within 'Binding'. - public static OperationBinding CreateOperationBinding(string operation,string targetNamespace) - { - // Create OperationBinding instance for operation. - OperationBinding myOperationBinding = new OperationBinding(); - myOperationBinding.Name = operation; - // Create InputBinding for operation. - InputBinding myInputBinding = new InputBinding(); - SoapBodyBinding mySoapBodyBinding = new SoapBodyBinding(); - mySoapBodyBinding.Use = SoapBindingUse.Literal; - myInputBinding.Extensions.Add(mySoapBodyBinding); - // Create OutputBinding for operation. - OutputBinding myOutputBinding = new OutputBinding(); - myOutputBinding.Extensions.Add(mySoapBodyBinding); - // Add 'InputBinding' and 'OutputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInputBinding; - myOperationBinding.Output = myOutputBinding; - // Create extensibility element for 'SoapOperationBinding'. - SoapOperationBinding mySoapOperationBinding = new SoapOperationBinding(); - mySoapOperationBinding.Style = SoapBindingStyle.Document; - mySoapOperationBinding.SoapAction = targetNamespace + operation; - // Add extensibility element 'SoapOperationBinding' to 'OperationBinding'. - myOperationBinding.Extensions.Add(mySoapOperationBinding); - return myOperationBinding; - } -// - // Used to create Operations under PortType. - public static Operation CreateOperation(string operationName,string inputMessage,string outputMessage,string targetNamespace) - { - Operation myOperation = new Operation(); - myOperation.Name = operationName; - OperationMessage input = (OperationMessage) new OperationInput(); - input.Message = new XmlQualifiedName(inputMessage,targetNamespace); - OperationMessage output = (OperationMessage) new OperationOutput(); - output.Message = new XmlQualifiedName(outputMessage,targetNamespace); - myOperation.Messages.Add(input); - myOperation.Messages.Add(output); - return myOperation; - } -} diff --git a/snippets/csharp/System.Web.Services.Description/Binding/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/Binding/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/Binding/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/Binding/Overview/bindingcollectionsample1.cs b/snippets/csharp/System.Web.Services.Description/Binding/Overview/bindingcollectionsample1.cs deleted file mode 100644 index 0436b9e8554..00000000000 --- a/snippets/csharp/System.Web.Services.Description/Binding/Overview/bindingcollectionsample1.cs +++ /dev/null @@ -1,54 +0,0 @@ -// System.Web.Services.Description.BindingCollection;System.Web.Services.Description.BindingCollection.Item[Int32]; -// System.Web.Services.Description.BindingCollection.Item[String];System.Web.Services.Description.BindingCollection.CopyTo - -/* The program reads a wsdl document "MathService.wsdl" and instantiates a ServiceDescription instance - from the WSDL document.A BindingCollection instance is then retrieved from this ServiceDescription instance - and it's members are demonstrated. - */ -using System; -using System.Web.Services.Description; -using System.Collections; -using System.Xml; - -class MyClass -{ - public static void Main() - { - Binding myBinding; - ServiceDescription myServiceDescription = ServiceDescription.Read("MathService_input.wsdl"); - Console.WriteLine("Total Number of bindings :" + myServiceDescription.Bindings.Count); -// - for(int i=0; i < myServiceDescription.Bindings.Count; ++i) - { - Console.WriteLine("\nBinding " + i ); - // Get Binding at index i. - myBinding = myServiceDescription.Bindings[i]; - Console.WriteLine("\t Name : " + myBinding.Name); - Console.WriteLine("\t Type : " + myBinding.Type); - } -// -// - Binding[] myBindings = new Binding[myServiceDescription.Bindings.Count]; - // Copy BindingCollection to an Array. - myServiceDescription.Bindings.CopyTo(myBindings,0); - Console.WriteLine("\n\n Displaying array copied from BindingCollection"); - for(int i=0;i < myServiceDescription.Bindings.Count; ++i) - { - Console.WriteLine("\nBinding " + i ); - Console.WriteLine("\t Name : " + myBindings[i].Name); - Console.WriteLine("\t Type : " + myBindings[i].Type); - } -// -// - // Get Binding Name = "MathServiceSoap". - myBinding = myServiceDescription.Bindings["MathServiceHttpGet"]; - if (myBinding != null) - { - Console.WriteLine("\n\nName : " + myBinding.Name); - Console.WriteLine("Type : " + myBinding.Type); - } -// - myServiceDescription = null; - myBinding = null; - } -} \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/BindingCollection/Add/Project.csproj b/snippets/csharp/System.Web.Services.Description/BindingCollection/Add/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/BindingCollection/Add/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/BindingCollection/Add/bindingcollectionsample3.cs b/snippets/csharp/System.Web.Services.Description/BindingCollection/Add/bindingcollectionsample3.cs deleted file mode 100644 index e74b79c0496..00000000000 --- a/snippets/csharp/System.Web.Services.Description/BindingCollection/Add/bindingcollectionsample3.cs +++ /dev/null @@ -1,44 +0,0 @@ -// System.Web.Services.Description.BindingCollection;System.Web.Services.Description.Remove;System.Web.Services.Description.Add; -// System.Web.Services.Description.Contains;System.Web.Services.Description.IndexOf - -/*The following example reads the contents of a file 'MathService.wsdl' into a ServiceDescription instance. - Removes first binding in the BindingCollection of the ServiceDescription instance and writes the current - 'ServiceDescription' instance into a temporary file. - Adds the same binding back again into the instance and writes to another temporary file. -*/ -using System; -using System.Web.Services.Description; - -class MyClass -{ - public static void Main() - { - Binding myBinding; -// -// -// -// - ServiceDescription myServiceDescription = ServiceDescription.Read("MathService_input.wsdl"); - Console.WriteLine("Total Number of bindings defined are:" + myServiceDescription.Bindings.Count); - myBinding = myServiceDescription.Bindings[0]; - - // Remove the first binding in the collection. - myServiceDescription.Bindings.Remove(myBinding); - Console.WriteLine("Successfully removed binding " + myBinding.Name); - Console.WriteLine("Total Number of bindings defined now are:" + myServiceDescription.Bindings.Count); - myServiceDescription.Write("MathService_temp.wsdl"); -// - // Add binding to the ServiceDescription instance. - myServiceDescription.Bindings.Add(myBinding); -// - if (myServiceDescription.Bindings.Contains(myBinding)) - Console.WriteLine("Successfully added binding " + myBinding.Name); -// - Console.WriteLine("Binding was added at index " + myServiceDescription.Bindings.IndexOf(myBinding)); - Console.WriteLine("Total Number of bindings defined now are:" + myServiceDescription.Bindings.Count); - myServiceDescription.Write("MathService_temp1.wsdl"); -// - myServiceDescription = null; - myBinding = null; - } -} \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/DocumentableItem/Documentation/MathService_cs.wsdl b/snippets/csharp/System.Web.Services.Description/DocumentableItem/Documentation/MathService_cs.wsdl deleted file mode 100644 index 9aa220c7ed2..00000000000 --- a/snippets/csharp/System.Web.Services.Description/DocumentableItem/Documentation/MathService_cs.wsdl +++ /dev/null @@ -1,352 +0,0 @@ - - - - - All types have been defined here - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Port Type "MathServiceHttpGet" is defined here - - - - - - - - - - - - - - - - - - - - - Port Type "MathServiceHttpPost" is defined here - - - - - - - - - - - - - - - - - - - - - Port Type "MathServiceSoap" is defined here - - - - - - - - - - - - - - - - - - - - - Binding "MathServiceSoap" is defined here - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Binding "MathServiceHttpGet" is defined here - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Binding "MathServiceHttpPost" is defined here - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/DocumentableItem/Documentation/Project.csproj b/snippets/csharp/System.Web.Services.Description/DocumentableItem/Documentation/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/DocumentableItem/Documentation/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/DocumentableItem/Documentation/documentableitemsample.cs b/snippets/csharp/System.Web.Services.Description/DocumentableItem/Documentation/documentableitemsample.cs deleted file mode 100644 index f46a8ab57be..00000000000 --- a/snippets/csharp/System.Web.Services.Description/DocumentableItem/Documentation/documentableitemsample.cs +++ /dev/null @@ -1,38 +0,0 @@ -// System.Web.Services.Description.DocumentableItem.Documentation; - -/* - The following program demonstrates the property 'Documentation' of abstract class 'DocumentableItem' - The program reads a wsdl document "MathService.wsdl" and instantiates a ServiceDescription instance - from the WSDL document. - This program demonstrates a generic utility function which can accept any of Types,PortType and Binding - classes as parameters. - */ -// -using System; -using System.Web.Services.Description; - -class DocumentableItemSample -{ - public static void Main() - { - ServiceDescription myServiceDescription = ServiceDescription.Read("MathService_cs.wsdl"); - Console.WriteLine("Documentation Element for type is "); - PrintDocumentation(myServiceDescription.Types); - foreach(PortType myPortType in myServiceDescription.PortTypes) - { - Console.WriteLine("Documentation Element for Port Type {0} is ",myPortType.Name); - PrintDocumentation(myPortType); - } - foreach(Binding myBinding in myServiceDescription.Bindings) - { - Console.WriteLine("Documentation Element for Port Type {0} is ",myBinding.Name); - PrintDocumentation(myBinding); - } - } - // Prints documentation associated with a wsdl element. - public static void PrintDocumentation(DocumentableItem myItem) - { - Console.WriteLine("\t" + myItem.Documentation); - } -} -// \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/FaultBinding/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/FaultBinding/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/FaultBinding/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/FaultBinding/Overview/faultbindingcollection_add.cs b/snippets/csharp/System.Web.Services.Description/FaultBinding/Overview/faultbindingcollection_add.cs deleted file mode 100644 index ddfb07068b2..00000000000 --- a/snippets/csharp/System.Web.Services.Description/FaultBinding/Overview/faultbindingcollection_add.cs +++ /dev/null @@ -1,212 +0,0 @@ -/* The following example demonstrates the 'Add' method of the 'FaultBindingCollection' class - * and constructor and 'Extensions' property of 'FaultBinding'class and 'Documentation' - * property of 'DocumentableItem' class. - * - * This program generates a WSDL file for a service called StockQuote. The StockQuote service - * provides one method called 'GetTradePrice'. The 'GetTradePrice' method takes two arguments, - * a 'tickerSymbol' and 'time' strings. The 'tickerSymbol' is a unique representation of a - * stock and 'time' is the time for which the trading price is to be returned for the stock - * specified. The WSDL file generated for the service supports the SOAP protocol only. - */ - -using System; -using System.Web.Services.Description; -using System.Xml; -using System.Xml.Schema; -using System.Xml.Serialization; - -public class FaultBindingCollection_Add -{ - - public static void Main() - { - ServiceDescription myServiceDescription = new ServiceDescription(); - myServiceDescription.Name = "StockQuote"; - myServiceDescription.TargetNamespace = "http://www.contoso.com/stockquote.wsdl"; - - // Generate the 'Types' element. - XmlSchema myXmlSchema = new XmlSchema(); - myXmlSchema.AttributeFormDefault = XmlSchemaForm.Qualified; - myXmlSchema.ElementFormDefault = XmlSchemaForm.Qualified; - myXmlSchema.TargetNamespace = "http://www.contoso.com/stockquote.wsdl"; - - //XmlSchemaElement myXmlSchemaElement; - XmlSchemaComplexType myXmlSchemaComplexType = new XmlSchemaComplexType(); - myXmlSchemaComplexType.Name = "GetTradePriceInputType"; - XmlSchemaSequence myXmlSchemaSequence = new XmlSchemaSequence(); - myXmlSchemaSequence.Items.Add(CreateComplexTypeXmlElement("1","1","tickerSymbol",true,new XmlQualifiedName("s:string"))); - myXmlSchemaSequence.Items.Add(CreateComplexTypeXmlElement("1","1","time",true,new XmlQualifiedName("s:string"))); - myXmlSchemaComplexType.Particle = myXmlSchemaSequence; - myXmlSchema.Items.Add(myXmlSchemaComplexType); - - myXmlSchemaComplexType = new XmlSchemaComplexType(); - myXmlSchemaComplexType.Name = "GetTradePriceOutputType"; - myXmlSchemaSequence = new XmlSchemaSequence(); - myXmlSchemaSequence.Items.Add(CreateComplexTypeXmlElement("1","1","result",true,new XmlQualifiedName("s:string"))); - myXmlSchemaComplexType.Particle = myXmlSchemaSequence; - myXmlSchema.Items.Add(myXmlSchemaComplexType); - - myXmlSchemaComplexType = new XmlSchemaComplexType(); - myXmlSchemaComplexType.Name = "GetTradePriceStringFaultType"; - myXmlSchemaSequence = new XmlSchemaSequence(); - myXmlSchemaSequence.Items.Add(CreateComplexTypeXmlElement("1","1","error",true,new XmlQualifiedName("s:string"))); - myXmlSchemaComplexType.Particle = myXmlSchemaSequence; - myXmlSchema.Items.Add(myXmlSchemaComplexType); - - myXmlSchemaComplexType = new XmlSchemaComplexType(); - myXmlSchemaComplexType.Name = "GetTradePriceStringIntType"; - myXmlSchemaSequence = new XmlSchemaSequence(); - myXmlSchemaSequence.Items.Add(CreateComplexTypeXmlElement("1","1","error",true,new XmlQualifiedName("s:int"))); - myXmlSchemaComplexType.Particle = myXmlSchemaSequence; - myXmlSchema.Items.Add(myXmlSchemaComplexType); - - myXmlSchema.Items.Add(CreateOtherXmlElement("GetTradePriceSoapIn",new XmlQualifiedName("s0:GetTradePriceInputType"))); - myXmlSchema.Items.Add(CreateOtherXmlElement("GetTradePriceSoapOut",new XmlQualifiedName("s0:GetTradePriceOutputType"))); - myXmlSchema.Items.Add(CreateOtherXmlElement("GetTradePriceSoapStringFault",new XmlQualifiedName("s0:GetTradePriceStringFaultType"))); - myXmlSchema.Items.Add(CreateOtherXmlElement("GetTradePriceSoapIntFault",new XmlQualifiedName("s0:GetTradePriceIntFaultType"))); - - myServiceDescription.Types.Schemas.Add(myXmlSchema); - - // Generate the 'Message' element. - MessageCollection myMessageCollection = myServiceDescription.Messages; - myMessageCollection.Add(CreateMessage("GetTradePriceInput","parameters","GetTradePriceSoapIn",myServiceDescription.TargetNamespace)); - myMessageCollection.Add(CreateMessage("GetTradePriceOutput","parameters","GetTradePriceSoapOut",myServiceDescription.TargetNamespace)); - myMessageCollection.Add(CreateMessage("GetTradePriceStringFault","parameters","GetTradePriceStringSoapFault",myServiceDescription.TargetNamespace)); - myMessageCollection.Add(CreateMessage("GetTradePriceIntFault","parameters","GetTradePriceIntSoapFault",myServiceDescription.TargetNamespace)); - - // Generate the 'Port Type' element. - PortTypeCollection myPortTypeCollection = myServiceDescription.PortTypes; - PortType myPortType = new PortType(); - myPortType.Name = "StockQuotePortType"; - OperationCollection myOperationCollection = myPortType.Operations; - Operation myOperation = new Operation(); - myOperation.Name = "GetTradePrice"; - OperationMessage myOperationMessage; - OperationMessageCollection myOperationMessageCollection = myOperation.Messages; - myOperationMessage = (OperationMessage) new OperationInput(); - myOperationMessage.Message = new XmlQualifiedName("s0:GetTradePriceInput"); - myOperationMessageCollection.Add(myOperationMessage); - myOperationMessage = (OperationMessage) new OperationOutput(); - myOperationMessage.Message = new XmlQualifiedName("s0:GetTradePriceOutput"); - myOperationMessageCollection.Add(myOperationMessage); - OperationFault myOperationFault = new OperationFault(); - myOperationFault.Name = "ErrorString"; - myOperationFault.Message = new XmlQualifiedName("s0:GetTradePriceStringFault"); - myOperation.Faults.Add(myOperationFault); - myOperationFault = new OperationFault(); - myOperationFault.Name = "ErrorInt"; - myOperationFault.Message = new XmlQualifiedName("s0:GetTradePriceIntFault"); - myOperation.Faults.Add(myOperationFault); - myOperationCollection.Add(myOperation); - myPortTypeCollection.Add(myPortType); - - // Generate the 'Binding' element. - ServiceDescriptionFormatExtensionCollection myExtensions; - BindingCollection myBindingCollection = myServiceDescription.Bindings; - Binding myBinding = new Binding(); - myBinding.Name = "StockQuoteSoapBinding"; - myBinding.Type = new XmlQualifiedName("s0:StockQuotePortType"); - myExtensions = myBinding.Extensions; - SoapBinding mySoapBinding = new SoapBinding(); - mySoapBinding.Style = SoapBindingStyle.Document; - mySoapBinding.Transport = "http://schemas.xmlsoap.org/soap/http"; - myExtensions.Add(mySoapBinding); - OperationBindingCollection myOperationBindingCollection = myBinding.Operations; - OperationBinding myOperationBinding = new OperationBinding(); - myExtensions = myOperationBinding.Extensions; - SoapOperationBinding mySoapBindingOperation = new SoapOperationBinding(); - mySoapBindingOperation.SoapAction = "http://www.contoso.com/GetTradePrice"; - myExtensions.Add(mySoapBindingOperation); - myOperationBinding.Name = "GetTradePrice"; - myOperationBinding.Input = new InputBinding(); - myExtensions = myOperationBinding.Input.Extensions; - SoapBodyBinding mySoapBodyBinding = new SoapBodyBinding(); - mySoapBodyBinding.Use = SoapBindingUse.Literal; - mySoapBodyBinding.Namespace = "http://www.contoso.com/stockquote"; - myExtensions.Add(mySoapBodyBinding); - myOperationBinding.Output = new OutputBinding(); - myExtensions = myOperationBinding.Output.Extensions; - mySoapBodyBinding = new SoapBodyBinding(); - mySoapBodyBinding.Use = SoapBindingUse.Literal; - mySoapBodyBinding.Namespace = "http://www.contoso.com/stockquote"; - myExtensions.Add(mySoapBodyBinding); -// -// -// - FaultBindingCollection myFaultBindingCollection = myOperationBinding.Faults; - FaultBinding myFaultBinding = new FaultBinding(); - myFaultBinding.Name = "ErrorString"; - // Associate SOAP fault binding to the fault binding of the operation. - myExtensions = myFaultBinding.Extensions; - SoapFaultBinding mySoapFaultBinding = new SoapFaultBinding(); - mySoapFaultBinding.Use = SoapBindingUse.Literal; - mySoapFaultBinding.Namespace = "http://www.contoso.com/stockquote"; - myExtensions.Add(mySoapFaultBinding); - myFaultBindingCollection.Add(myFaultBinding); -// -// -// - myFaultBinding = new FaultBinding(); - myFaultBinding.Name = "ErrorInt"; - // Associate SOAP fault binding to the fault binding of the operation. - myExtensions = myFaultBinding.Extensions; - mySoapFaultBinding = new SoapFaultBinding(); - mySoapFaultBinding.Use = SoapBindingUse.Literal; - mySoapFaultBinding.Namespace = "http://www.contoso.com/stockquote"; - myExtensions.Add(mySoapFaultBinding); - myFaultBindingCollection.Add(myFaultBinding); - myOperationBindingCollection.Add(myOperationBinding); - myBindingCollection.Add(myBinding); - - // Generate the 'Service' element. - ServiceCollection myServiceCollection = myServiceDescription.Services; -// - Service myService = new Service(); - // Add a simple documentation for the service to ease the readability of the generated WSDL file. - myService.Documentation = "A Simple Stock Quote Service"; - myService.Name = "StockQuoteService"; - PortCollection myPortCollection = myService.Ports; - Port myPort = new Port(); - myPort.Name = "StockQuotePort"; - myPort.Binding = new XmlQualifiedName("s0:StockQuoteSoapBinding"); - myExtensions = myPort.Extensions; - SoapAddressBinding mySoapAddressBinding = new SoapAddressBinding(); - mySoapAddressBinding.Location = "http://www.contoso.com/stockquote"; - myExtensions.Add(mySoapAddressBinding); - myPortCollection.Add(myPort); -// - myServiceCollection.Add(myService); - - // Display the WSDL generated to the console. - myServiceDescription.Write(Console.Out); - } - - public static XmlSchemaElement CreateComplexTypeXmlElement(string minoccurs,string maxoccurs,string name,bool isNillable,XmlQualifiedName schemaTypeName) - { - XmlSchemaElement myXmlSchemaElement = new XmlSchemaElement(); - myXmlSchemaElement.MinOccursString = minoccurs; - myXmlSchemaElement.MaxOccursString = maxoccurs; - myXmlSchemaElement.Name = name; - myXmlSchemaElement.IsNillable = true; - myXmlSchemaElement.SchemaTypeName = schemaTypeName; - return myXmlSchemaElement; - } - public static XmlSchemaElement CreateOtherXmlElement(string name,XmlQualifiedName SchemaTypeName) - { - XmlSchemaElement myXmlSchemaElement = new XmlSchemaElement(); - myXmlSchemaElement.Name = name; - myXmlSchemaElement.SchemaTypeName = SchemaTypeName; - return myXmlSchemaElement; - } - // Creates a Message with name ="messageName" having one MessagePart with name = "partName". - public static Message CreateMessage(string messageName,string partName,string element,string targetNamespace) - { - Message myMessage = new Message(); - myMessage.Name = messageName; - MessagePart myMessagePart = new MessagePart(); - myMessagePart.Name = partName; - myMessagePart.Element = new XmlQualifiedName(element,targetNamespace); - myMessage.Parts.Add(myMessagePart); - return myMessage; - } -} diff --git a/snippets/csharp/System.Web.Services.Description/FaultBindingCollection/Contains/Project.csproj b/snippets/csharp/System.Web.Services.Description/FaultBindingCollection/Contains/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/FaultBindingCollection/Contains/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/FaultBindingCollection/Contains/faultbindingcollection_remove.cs b/snippets/csharp/System.Web.Services.Description/FaultBindingCollection/Contains/faultbindingcollection_remove.cs deleted file mode 100644 index 53d41db9b9c..00000000000 --- a/snippets/csharp/System.Web.Services.Description/FaultBindingCollection/Contains/faultbindingcollection_remove.cs +++ /dev/null @@ -1,84 +0,0 @@ -/* - * The following example demonstrates the 'Remove', 'CopyTo', 'Insert', - 'Contains', 'IndexOf' method and 'Item[int]' property of FaultBindingCollection - class - The program reverses the fault bindings that appear in the WSDL file. - It also reverses the operation faults and displays the resultant WSDL file - to the console. - */ - -using System; -using System.Web.Services.Description; - -public class FaultBindingCollection_Remove -{ - public static void Main() - { - // Read the 'StockQuote.wsdl' file as input. - ServiceDescription myServiceDescription = ServiceDescription.Read("StockQuote.wsdl"); - - PortTypeCollection myPortTypeCollection = myServiceDescription.PortTypes; - PortType myPortType = myPortTypeCollection[0]; - OperationCollection myOperationCollection = myPortType.Operations; - Operation myOperation = myOperationCollection[0]; - OperationFaultCollection myOperationFaultCollection = myOperation.Faults; - // Reverse the operation fault order. - if(myOperationFaultCollection.Count > 1) - { - OperationFault[] myOperationFaultArray = new OperationFault[myOperationFaultCollection.Count]; - // Copy the operation fault to a temporary array. - myOperationFaultCollection.CopyTo(myOperationFaultArray, 0); - // Remove all the operation fault instances in the fault binding collection. - for(int i = 0; i < myOperationFaultArray.Length; i++) - myOperationFaultCollection.Remove(myOperationFaultArray[i]); - // Insert the operation fault instance in the reverse order. - for(int i = 0, j = (myOperationFaultArray.Length - 1); i < myOperationFaultArray.Length; i++, j--) - myOperationFaultCollection.Insert(i, myOperationFaultArray[j]); - } - -// -// -// -// -// -// - - BindingCollection myBindingCollection = myServiceDescription.Bindings; - Binding myBinding = myBindingCollection[0]; - OperationBindingCollection myOperationBindingCollection = myBinding.Operations; - OperationBinding myOperationBinding = myOperationBindingCollection[0]; - FaultBindingCollection myFaultBindingCollection = myOperationBinding.Faults; - - // Reverse the fault bindings order. - if(myFaultBindingCollection.Count > 1) - { - FaultBinding myFaultBinding = myFaultBindingCollection[0]; - - FaultBinding[] myFaultBindingArray = new FaultBinding[myFaultBindingCollection.Count]; - // Copy the fault bindings to a temporary array. - myFaultBindingCollection.CopyTo(myFaultBindingArray, 0); - - // Remove all the fault binding instances in the fault binding collection. - for(int i = 0; i < myFaultBindingArray.Length; i++) - myFaultBindingCollection.Remove(myFaultBindingArray[i]); - - // Insert the fault binding instance in the reverse order. - for(int i = 0, j = (myFaultBindingArray.Length - 1); i < myFaultBindingArray.Length; i++, j--) - myFaultBindingCollection.Insert(i, myFaultBindingArray[j]); - // Check if the first element in the collection before the reversal is now the last element. - if(myFaultBindingCollection.Contains(myFaultBinding) && - myFaultBindingCollection.IndexOf(myFaultBinding) == (myFaultBindingCollection.Count - 1)) - // Display the WSDL generated to the console. - myServiceDescription.Write(Console.Out); - else - Console.WriteLine("Error while reversing"); - } - -// -// -// -// -// -// - } -} \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/FaultBindingCollection/Item/Project.csproj b/snippets/csharp/System.Web.Services.Description/FaultBindingCollection/Item/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/FaultBindingCollection/Item/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/FaultBindingCollection/Item/faultbindingcollection_item.cs b/snippets/csharp/System.Web.Services.Description/FaultBindingCollection/Item/faultbindingcollection_item.cs deleted file mode 100644 index 730d9d3f97c..00000000000 --- a/snippets/csharp/System.Web.Services.Description/FaultBindingCollection/Item/faultbindingcollection_item.cs +++ /dev/null @@ -1,42 +0,0 @@ -/* - * The following example demonstrates the 'Item[string]' property of - FaultBindingCollection class - * The program removes a fault binding with the name 'ErrorString' - from the WSDL file. It also removes a operation fault with the name - 'ErrorString' and displays the resultant WSDL file to the console. - * - */ - -using System; -using System.Web.Services.Description; - -public class FaultBindingCollection_Item -{ - public static void Main() - { - // Read the 'StockQuote.wsdl' file as input. - ServiceDescription myServiceDescription = ServiceDescription.Read("StockQuote.wsdl"); - - // Get the operation fault collection and remove the operation fault with the name 'ErrorString'. - PortTypeCollection myPortTypeCollection = myServiceDescription.PortTypes; - PortType myPortType = myPortTypeCollection[0]; - OperationCollection myOperationCollection = myPortType.Operations; - Operation myOperation = myOperationCollection[0]; - OperationFaultCollection myOperationFaultCollection = myOperation.Faults; - if(myOperationFaultCollection.Contains(myOperationFaultCollection["ErrorString"])) - myOperationFaultCollection.Remove(myOperationFaultCollection["ErrorString"]); - - // Get the fault binding collection and remove the fault binding with the name 'ErrorString'. -// - BindingCollection myBindingCollection = myServiceDescription.Bindings; - Binding myBinding = myBindingCollection[0]; - OperationBindingCollection myOperationBindingCollection = myBinding.Operations; - OperationBinding myOperationBinding = myOperationBindingCollection[0]; - FaultBindingCollection myFaultBindingCollection = myOperationBinding.Faults; - if(myFaultBindingCollection.Contains(myFaultBindingCollection["ErrorString"])) - myFaultBindingCollection.Remove(myFaultBindingCollection["ErrorString"]); -// - - myServiceDescription.Write(Console.Out); - } -} \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/FaultBindingCollection/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/FaultBindingCollection/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/FaultBindingCollection/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/FaultBindingCollection/Overview/StockQuoteService_cs.wsdl b/snippets/csharp/System.Web.Services.Description/FaultBindingCollection/Overview/StockQuoteService_cs.wsdl deleted file mode 100644 index 923e4417437..00000000000 --- a/snippets/csharp/System.Web.Services.Description/FaultBindingCollection/Overview/StockQuoteService_cs.wsdl +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - My first service - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/FaultBindingCollection/Overview/StockQuote_cs.wsdl b/snippets/csharp/System.Web.Services.Description/FaultBindingCollection/Overview/StockQuote_cs.wsdl deleted file mode 100644 index cdbcf6f385e..00000000000 --- a/snippets/csharp/System.Web.Services.Description/FaultBindingCollection/Overview/StockQuote_cs.wsdl +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/FaultBindingCollection/Overview/StockQuote_cs.xsd b/snippets/csharp/System.Web.Services.Description/FaultBindingCollection/Overview/StockQuote_cs.xsd deleted file mode 100644 index a43043e2f1b..00000000000 --- a/snippets/csharp/System.Web.Services.Description/FaultBindingCollection/Overview/StockQuote_cs.xsd +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/FaultBindingCollection/Overview/importsample.cs b/snippets/csharp/System.Web.Services.Description/FaultBindingCollection/Overview/importsample.cs deleted file mode 100644 index 7cc9e88c04b..00000000000 --- a/snippets/csharp/System.Web.Services.Description/FaultBindingCollection/Overview/importsample.cs +++ /dev/null @@ -1,94 +0,0 @@ -// System.Web.Services.Description.ImportCollection.Add; -// System.Web.Services.Description.ImportCollection.Insert; -// System.Web.Services.Description.Import.Import(); -// System.Web.Services.Description.Import.Location; -// System.Web.Services.Description.Import.Namespace; -// System.Web.Services.Description.Import.ServiceDescription; -// System.Web.Services.Description.Import; - -/* The following example demonstrates the constructor 'Import()' and properties 'Namespace','Location','Namespace', - 'ServiceDescription' of Import Class. Methods 'Add' and 'Insert' of Class 'ImportCollection' are also demonstrated. - This example uses a sample provided in WSDL specification to explain Import and ImportCollection. - It adds import instances to ImportCollection as suggested in the specification sample and enumerates the same to the console. - Note: This is an illustrative sample using an example from WSDL specification. The real world web service has been assumed. -*/ - -// -using System; -using System.Web.Services.Description; -using System.Collections; -using System.Xml; - -class MySample -{ - public static void Main() - { - Console.WriteLine("Import Sample"); -// - ServiceDescription myServiceDescription = - ServiceDescription.Read("StockQuote_cs.wsdl"); - myServiceDescription.Imports.Add( - CreateImport("http://localhost/stockquote/schemas", - "http://localhost/stockquote/stockquote_cs.xsd")); -// - // Save the ServiceDescripition to an external file. - myServiceDescription.Write("StockQuote_cs.wsdl"); - Console.WriteLine( - "Successfully added import to WSDL document 'StockQuote_cs.wsdl'"); - - // Print the import collection to the console. - PrintImportCollection("StockQuote_cs.wsdl"); -// - myServiceDescription = - ServiceDescription.Read("StockQuoteService_cs.wsdl"); - myServiceDescription.Imports.Insert( - 0,CreateImport("http://localhost/stockquote/definitions", - "http://localhost/stockquote/stockquote_cs.wsdl")); -// - // Save the ServiceDescripition to an external file. - myServiceDescription.Write("StockQuoteService_cs.wsdl"); - Console.WriteLine(""); - Console.WriteLine("Successfully added import to WSDL " + - "document 'StockQuoteService_cs.wsdl'"); - - //Print the import collection to the console. - PrintImportCollection("StockQuoteService_cs.wsdl"); - } -// -// -// - // Creates an Import object with namespace and location. - public static Import CreateImport(string targetNamespace, - string targetlocation) - { - Import myImport = new Import(); - myImport.Location = targetlocation; - myImport.Namespace = targetNamespace; - return myImport; - } -// -// -// - -// - public static void PrintImportCollection(string fileName_wsdl) - { - // Read import collection properties from generated WSDL file. - ServiceDescription myServiceDescription1 = - ServiceDescription.Read(fileName_wsdl); - ImportCollection myImportCollection = myServiceDescription1.Imports; - Console.WriteLine("Enumerating Import Collection for file '" + - fileName_wsdl +"'..."); - - // Print Import properties to console. - for(int i =0; i < myImportCollection.Count; ++i) - { - Console.WriteLine("Namespace : " + myImportCollection[i].Namespace); - Console.WriteLine("Location : " + myImportCollection[i].Location); - Console.WriteLine("ServiceDescription : " + - myImportCollection[i].ServiceDescription.Name); - } - } -// -} -// diff --git a/snippets/csharp/System.Web.Services.Description/HttpAddressBinding/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/HttpAddressBinding/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/HttpAddressBinding/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/HttpAddressBinding/Overview/httpbinding.cs b/snippets/csharp/System.Web.Services.Description/HttpAddressBinding/Overview/httpbinding.cs deleted file mode 100644 index dafafe6711b..00000000000 --- a/snippets/csharp/System.Web.Services.Description/HttpAddressBinding/Overview/httpbinding.cs +++ /dev/null @@ -1,152 +0,0 @@ -//System.Web.Services.HttpBinding;System.Web.Services.HttpBinding.Verb; -//System.Web.Services.HttpAddressBinding; -//System.Web.Services.HttpAddressBinding.Location; -/* - The following example demonstrates the 'HttpBinding()' constructor - and 'Verb' property of class 'HttpBinding' and 'HttpAddressBinding() - 'constructor and 'Location' property of class 'HttpAddressBinding'. - It creates a 'ServiceDescription' instance by using the - static read method of 'ServiceDescription' by passing the - 'AddNumbers1.wsdl' name as an argument. It creates a 'Binding' - object and adds that binding object to 'ServiceDescription'. - It adds the 'PortType',Messages to the 'ServiceDescription' object. - Finally it writes the 'ServiceDescrption' as a WSDL file with name - 'AddNumbers.wsdl. - */ - -using System; -using System.Web.Services.Description; -using System.Collections; -using System.Xml; - -class MyClass -{ - public static void Main() - { - ServiceDescription myDescription = ServiceDescription.Read("AddNumbers1.wsdl"); - - // Create the 'Binding' object. - Binding myBinding = new Binding(); - myBinding.Name = "Service1HttpPost"; - XmlQualifiedName qualifiedName = new XmlQualifiedName("s0:Service1HttpPost"); - myBinding.Type = qualifiedName; - -// -// - - // Create the 'HttpBinding' object. - HttpBinding myHttpBinding = new HttpBinding(); - - myHttpBinding.Verb="POST"; - // Add the 'HttpBinding' to the 'Binding'. - myBinding.Extensions.Add(myHttpBinding); -// -// - - // Create the 'OperationBinding' object. - OperationBinding myOperationBinding = new OperationBinding(); - myOperationBinding.Name = "AddNumbers"; - - HttpOperationBinding myOperation = new HttpOperationBinding(); - myOperation.Location="/AddNumbers"; - // Add the 'HttpOperationBinding' to 'OperationBinding'. - myOperationBinding.Extensions.Add(myOperation); - - // Create the 'InputBinding' object. - InputBinding myInput = new InputBinding(); - MimeContentBinding postMimeContentbinding = new MimeContentBinding(); - postMimeContentbinding.Type="application/x-www-form-urlencoded"; - myInput.Extensions.Add(postMimeContentbinding); - // Add the 'InputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInput; - // Create the 'OutputBinding' object. - OutputBinding myOutput = new OutputBinding(); - MimeXmlBinding postMimeXmlbinding = new MimeXmlBinding(); - postMimeXmlbinding .Part="Body"; - myOutput.Extensions.Add(postMimeXmlbinding); - - // Add the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding.Output = myOutput; - - // Add the 'OperationBinding' to 'Binding'. - myBinding.Operations.Add(myOperationBinding); - - // Add the 'Binding' to 'BindingCollection' of 'ServiceDescription'. - myDescription.Bindings.Add(myBinding); - - // Create a 'Port' object. - Port postPort = new Port(); - postPort.Name = "Service1HttpPost"; - postPort.Binding = new XmlQualifiedName("s0:Service1HttpPost"); - -// -// - - // Create the 'HttpAddressBinding' object. - HttpAddressBinding postAddressBinding = new HttpAddressBinding(); - - postAddressBinding.Location = "http://localhost/Service1.asmx"; - - // Add the 'HttpAddressBinding' to the 'Port'. - postPort.Extensions.Add(postAddressBinding); -// -// - - // Add the 'Port' to 'PortCollection' of 'ServiceDescription'. - myDescription.Services[0].Ports.Add(postPort); - - // Create a 'PortType' object. - PortType postPortType = new PortType(); - postPortType.Name = "Service1HttpPost"; - - Operation postOperation = new Operation(); - postOperation.Name = "AddNumbers"; - - OperationMessage postInput = (OperationMessage)new OperationInput(); - postInput.Message = new XmlQualifiedName("s0:AddNumbersHttpPostIn"); - OperationMessage postOutput = (OperationMessage)new OperationOutput(); - postOutput.Message = new XmlQualifiedName("s0:AddNumbersHttpPostOut"); - - postOperation.Messages.Add(postInput); - postOperation.Messages.Add(postOutput); - - // Add the 'Operation' to 'PortType'. - postPortType.Operations.Add(postOperation); - - // Adds the 'PortType' to 'PortTypeCollection' of 'ServiceDescription'. - myDescription.PortTypes.Add(postPortType); - - // Create the 'Message' object. - Message postMessage1 = new Message(); - postMessage1.Name="AddNumbersHttpPostIn"; - // Create the 'MessageParts'. - MessagePart postMessagePart1 = new MessagePart(); - postMessagePart1.Name = "firstnumber"; - postMessagePart1.Type = new XmlQualifiedName("s:string"); - - MessagePart postMessagePart2 = new MessagePart(); - postMessagePart2.Name = "secondnumber"; - postMessagePart2.Type = new XmlQualifiedName("s:string"); - // Add the 'MessagePart' objects to 'Messages'. - postMessage1.Parts.Add(postMessagePart1); - postMessage1.Parts.Add(postMessagePart2); - - // Create another 'Message' object. - Message postMessage2 = new Message(); - postMessage2.Name = "AddNumbersHttpPostOut"; - - MessagePart postMessagePart3 = new MessagePart(); - postMessagePart3.Name = "Body"; - postMessagePart3.Element = new XmlQualifiedName("s0:int"); - // Add the 'MessagePart' to 'Message' - postMessage2.Parts.Add(postMessagePart3); - - // Add the 'Message' objects to 'ServiceDescription'. - myDescription.Messages.Add(postMessage1); - myDescription.Messages.Add(postMessage2); - - // Write the 'ServiceDescription' as a WSDL file. - myDescription.Write("AddNumbers.wsdl"); - Console.WriteLine("WSDL file with name 'AddNumber.Wsdl' file created Successfully"); - } -} diff --git a/snippets/csharp/System.Web.Services.Description/HttpBinding/Namespace/HttpBinding_ctor_Client.cs.aspx b/snippets/csharp/System.Web.Services.Description/HttpBinding/Namespace/HttpBinding_ctor_Client.cs.aspx deleted file mode 100644 index fb4cc285694..00000000000 --- a/snippets/csharp/System.Web.Services.Description/HttpBinding/Namespace/HttpBinding_ctor_Client.cs.aspx +++ /dev/null @@ -1,31 +0,0 @@ - - - -
- Adding Two Numbers -
-
Enter the First Integer - -
- Enter the Second Integer - -
- - - - diff --git a/snippets/csharp/System.Web.Services.Description/HttpBinding/Namespace/HttpBinding_ctor_Input_CS.wsdl b/snippets/csharp/System.Web.Services.Description/HttpBinding/Namespace/HttpBinding_ctor_Input_CS.wsdl deleted file mode 100644 index 5adc74e5609..00000000000 --- a/snippets/csharp/System.Web.Services.Description/HttpBinding/Namespace/HttpBinding_ctor_Input_CS.wsdl +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/HttpBinding/Namespace/HttpBinding_ctor_Service.cs.asmx b/snippets/csharp/System.Web.Services.Description/HttpBinding/Namespace/HttpBinding_ctor_Service.cs.asmx deleted file mode 100644 index f475477fb3d..00000000000 --- a/snippets/csharp/System.Web.Services.Description/HttpBinding/Namespace/HttpBinding_ctor_Service.cs.asmx +++ /dev/null @@ -1,15 +0,0 @@ -<%@WebService Language="c#" Class="MyHttpBindingService"%> - -using System; -using System.Web.Services; - -public class MyHttpBindingService: System.Web.Services.WebService -{ - - - [WebMethod] - public int AddNumbers(int firstNumber,int secondNumber) - { - return firstNumber+secondNumber; - } -} diff --git a/snippets/csharp/System.Web.Services.Description/HttpBinding/Namespace/Project.csproj b/snippets/csharp/System.Web.Services.Description/HttpBinding/Namespace/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/HttpBinding/Namespace/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/HttpBinding/Namespace/httpbinding_ctor.cs b/snippets/csharp/System.Web.Services.Description/HttpBinding/Namespace/httpbinding_ctor.cs deleted file mode 100644 index 88ba680c878..00000000000 --- a/snippets/csharp/System.Web.Services.Description/HttpBinding/Namespace/httpbinding_ctor.cs +++ /dev/null @@ -1,75 +0,0 @@ -// System.Web.Services.Description.HttpBinding.HttpBinding() -// System.Web.Services.Description.HttpBinding.Namespace -// System.Web.Services.Description.HttpAddressBinding.HttpAddressBinding() - -/* The following program demonstrates the constructor, field 'Namespace' of - class 'HttpBinding' and constructor of class 'HttpAddressBinding'. This program writes all 'HttpPost' binding related information to the input wsdl file and genrates an output file which is later on compiled using wsdl tool. -*/ -using System; -using System.Web.Services.Description; -using System.Collections; -using System.Xml; - -class MyHttpBindingClass -{ - public static void Main() - { - ServiceDescription myDescription = ServiceDescription.Read("HttpBinding_ctor_Input_CS.wsdl"); -// -// - // Create 'Binding' object. - Binding myBinding = new Binding(); - myBinding.Name = "MyHttpBindingServiceHttpPost"; - XmlQualifiedName qualifiedName = new XmlQualifiedName("s0:MyHttpBindingServiceHttpPost"); - myBinding.Type = qualifiedName; - // Create 'HttpBinding' object. - HttpBinding myHttpBinding = new HttpBinding(); - myHttpBinding.Verb = "POST"; - Console.WriteLine("HttpBinding Namespace : "+HttpBinding.Namespace); -// - // Add 'HttpBinding' to 'Binding'. - myBinding.Extensions.Add(myHttpBinding); -// - // Create 'OperationBinding' object. - OperationBinding myOperationBinding = new OperationBinding(); - myOperationBinding.Name = "AddNumbers"; - HttpOperationBinding myOperation = new HttpOperationBinding(); - myOperation.Location = "/AddNumbers"; - // Add 'HttpOperationBinding' to 'OperationBinding'. - myOperationBinding.Extensions.Add(myOperation); - // Create 'InputBinding' object. - InputBinding myInput = new InputBinding(); - MimeContentBinding postMimeContentbinding = new MimeContentBinding(); - postMimeContentbinding.Type = "application/x-www-form-urlencoded"; - myInput.Extensions.Add(postMimeContentbinding); - // Add 'InputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInput; - // Create 'OutputBinding' object. - OutputBinding myOutput = new OutputBinding(); - MimeXmlBinding postMimeXmlbinding = new MimeXmlBinding(); - postMimeXmlbinding .Part = "Body"; - myOutput.Extensions.Add(postMimeXmlbinding); - // Add 'OutPutBinding' to 'OperationBinding'. - myOperationBinding.Output = myOutput; - // Add 'OperationBinding' to 'Binding'. - myBinding.Operations.Add(myOperationBinding); - // Add 'Binding' to 'BindingCollection' of 'ServiceDescription'. - myDescription.Bindings.Add(myBinding); -// - // Create a 'Port' object. - Port postPort = new Port(); - postPort.Name = "MyHttpBindingServiceHttpPost"; - postPort.Binding = new XmlQualifiedName("s0:MyHttpBindingServiceHttpPost"); - // Create 'HttpAddressBinding' object. - HttpAddressBinding postAddressBinding = new HttpAddressBinding(); - postAddressBinding.Location = "http://localhost/HttpBinding_ctor/HttpBinding_ctor_Service.cs.asmx"; - // Add 'HttpAddressBinding' to 'Port'. - postPort.Extensions.Add(postAddressBinding); -// - // Add 'Port' to 'PortCollection' of 'ServiceDescription'. - myDescription.Services[0].Ports.Add(postPort); - // Write 'ServiceDescription' as a WSDL file. - myDescription.Write("HttpBinding_ctor_Output_CS.wsdl"); - Console.WriteLine("WSDL file with name 'HttpBinding_ctor_Output_CS.wsdl' file created Successfully"); - } -} diff --git a/snippets/csharp/System.Web.Services.Description/ImportCollection/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/ImportCollection/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ImportCollection/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/ImportCollection/Overview/StockQuoteService_cs.wsdl b/snippets/csharp/System.Web.Services.Description/ImportCollection/Overview/StockQuoteService_cs.wsdl deleted file mode 100644 index ba2aaa247d1..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ImportCollection/Overview/StockQuoteService_cs.wsdl +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - My first service - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ImportCollection/Overview/importcollection_6.cs b/snippets/csharp/System.Web.Services.Description/ImportCollection/Overview/importcollection_6.cs deleted file mode 100644 index 0c807d876d4..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ImportCollection/Overview/importcollection_6.cs +++ /dev/null @@ -1,68 +0,0 @@ -// System.Web.Services.Description.ImportCollection -// System.Web.Services.Description.ImportCollection.Item -// System.Web.Services.Description.ImportCollection.CopyTo -// System.Web.Services.Description.ImportCollection.Contains -// System.Web.Services.Description.ImportCollection.IndexOf -// System.Web.Services.Description.ImportCollection.Remove - -/* The following program demonstrates the methods 'CopyTo', 'Contains','IndexOf','Remove' - and property 'Item' of class 'ImportCollection'. - The program reads a 'WSDL' document and gets a 'ServiceDescription' instance - An 'ImportCollection' instance is then retrieved from this 'ServiceDescription' - instance and it's members have been demonstrated. -*/ - -// -using System; -using System.Web.Services.Description; -using System.Xml; - -class ServiceDescription_ImportCollection -{ - public static void Main() - { - ServiceDescription myServiceDescription = ServiceDescription.Read("StockQuoteService_cs.wsdl"); - Console.WriteLine(" ImportCollection Sample "); -// - // Get Import Collection. - ImportCollection myImportCollection = myServiceDescription.Imports; - Console.WriteLine("Total Imports in the document = " + myServiceDescription.Imports.Count); - // Print 'Import' properties to console. - for(int i =0; i < myImportCollection.Count; ++i) - Console.WriteLine("\tImport Namespace :{0} Import Location :{1} " - ,myImportCollection[i].Namespace - ,myImportCollection[i].Location); -// -// - Import[] myImports = new Import[myServiceDescription.Imports.Count]; - // Copy 'ImportCollection' to an array. - myServiceDescription.Imports.CopyTo(myImports,0); - Console.WriteLine("Imports that are copied to Importarray ..."); - for(int i=0;i < myImports.Length; ++i) - Console.WriteLine("\tImport Namespace :{0} Import Location :{1} " - ,myImports[i].Namespace - ,myImports[i].Location); -// -// -// -// - // Get Import by Index. - Import myImport = myServiceDescription.Imports[myServiceDescription.Imports.Count-1]; - Console.WriteLine("Import by Index..."); - if (myImportCollection.Contains(myImport)) - { - Console.WriteLine("Import Namespace '" - + myImport.Namespace + "' is found in 'ImportCollection'."); - Console.WriteLine("Index of '" + myImport.Namespace + "' in 'ImportCollection' = " - + myImportCollection.IndexOf(myImport)); - Console.WriteLine("Deleting Import from 'ImportCollection'..."); - myImportCollection.Remove(myImport); - if(myImportCollection.IndexOf(myImport) == -1) - Console.WriteLine("Import is successfully removed from Import Collection."); - } -// -// -// - } -} -// \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/InputBinding/Overview/MathService.cs.asmx b/snippets/csharp/System.Web.Services.Description/InputBinding/Overview/MathService.cs.asmx deleted file mode 100644 index 3c1d1ac85f0..00000000000 --- a/snippets/csharp/System.Web.Services.Description/InputBinding/Overview/MathService.cs.asmx +++ /dev/null @@ -1,35 +0,0 @@ -<%@ WebService Language="C#" Class="MathService" %> - -using System; -using System.Web.Services; - -public class MathService : WebService - -{ - - [WebMethod] - public float Add(float a, float b) - { - return a + b; - } - - [WebMethod] - public float Subtract(float a, float b) - { - return a - b; - } - - [WebMethod] - public float Multiply(float a, float b) - { - return a * b; - } - - [WebMethod] - public float Divide(float a, float b) - { - if (b==0) return -1; - return a / b; - } - -} \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/InputBinding/Overview/MathService_input_cs.wsdl b/snippets/csharp/System.Web.Services.Description/InputBinding/Overview/MathService_input_cs.wsdl deleted file mode 100644 index 556e7526dd4..00000000000 --- a/snippets/csharp/System.Web.Services.Description/InputBinding/Overview/MathService_input_cs.wsdl +++ /dev/null @@ -1,491 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/InputBinding/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/InputBinding/Overview/Project.csproj deleted file mode 100644 index e19c93ed9ce..00000000000 --- a/snippets/csharp/System.Web.Services.Description/InputBinding/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/InputBinding/Overview/descriptionnamespacesample1.cs b/snippets/csharp/System.Web.Services.Description/InputBinding/Overview/descriptionnamespacesample1.cs deleted file mode 100644 index 9cb11e619a6..00000000000 --- a/snippets/csharp/System.Web.Services.Description/InputBinding/Overview/descriptionnamespacesample1.cs +++ /dev/null @@ -1,235 +0,0 @@ -// System.Web.Services.Description.InputBinding.InputBinding(); -// System.Web.Services.Description.InputBinding.Extensions -// System.Web.Services.Description.InputBinding - -// System.Web.Services.Description.Message.Message(); -// System.Web.Services.Description.Message.Name; -// System.Web.Services.Description.Message.Parts; - -// System.Web.Services.Description.MessageCollection.Add; -// System.Web.Services.Description.MessageCollection.Insert; -// System.Web.Services.Description.MessageCollection; - -// System.Web.Services.Description.MessagePart.MessagePart(); -// System.Web.Services.Description.MessagePart.Element; -// System.Web.Services.Description.MessagePart.Name; -// System.Web.Services.Description.MessagePart; - -// System.Web.Services.Description.MessagePartCollection.Add; -// System.Web.Services.Description.MessagePartCollection.Insert; - -/* - The following program takes input a WSDL file 'MathService_input.wsdl' with all information related to SOAP protocol - removed from it. In a way, it tries to simulate a scenario wherein a service initially did not support a protocol, however later - on happen to support it. - In this example, the WSDL file is modified to insert a new Binding for SOAP. The binding is populated based on - WSDL document structure defined in WSDL specification. The ServiceDescription instance is loaded with values - for 'Messages', 'PortTypes', 'Bindings', and 'Port'. The instance is then written to an external file 'MathService_new.wsdl'. - - */ -using System; -using System.Web.Services.Description; -using System.Collections; -using System.Xml; - -class MyClass1 -{ - public static void Main() - { -// - ServiceDescription myServiceDescription = - ServiceDescription.Read("MathService_input_cs.wsdl"); - - // Create SOAP messages. -// - Message myMessage = new Message(); - myMessage.Name = "AddSoapOut"; -// - MessagePart myMessagePart = new MessagePart(); - myMessagePart.Name = "parameters"; - myMessagePart.Element = new - XmlQualifiedName("AddResponse",myServiceDescription.TargetNamespace); - myMessage.Parts.Add(myMessagePart); -// - myServiceDescription.Messages.Add(myMessage); -// -// -// - Message myMessage1 = new Message(); - myMessage1.Name = "AddSoapIn"; -// - MessagePart myMessagePart1 = new MessagePart(); - myMessagePart1.Name = "parameters"; - myMessagePart1.Element = new XmlQualifiedName("Add",myServiceDescription.TargetNamespace); - myMessage1.Parts.Insert(0,myMessagePart1); -// - myServiceDescription.Messages.Insert(16,myMessage1); -// - - myServiceDescription.Messages.Add( - CreateMessage("SubtractSoapIn","parameters", - "Subtract",myServiceDescription.TargetNamespace)); - myServiceDescription.Messages.Add( - CreateMessage("SubtractSoapOut","parameters", - "SubtractResponse",myServiceDescription.TargetNamespace)); - myServiceDescription.Messages.Add( - CreateMessage("MultiplySoapIn","parameters", - "Multiply",myServiceDescription.TargetNamespace)); - myServiceDescription.Messages.Add( - CreateMessage("MultiplySoapOut","parameters", - "MultiplyResponse",myServiceDescription.TargetNamespace)); - myServiceDescription.Messages.Add( - CreateMessage("DivideSoapIn","parameters", - "Divide",myServiceDescription.TargetNamespace)); - myServiceDescription.Messages.Add( - CreateMessage("DivideSoapOut","parameters", - "DivideResponse",myServiceDescription.TargetNamespace)); - - // Create a new PortType. - PortType soapPortType = new PortType(); - soapPortType.Name = "MathServiceSoap"; - soapPortType.Operations.Add(CreateOperation("Add","AddSoapIn", - "AddSoapOut",myServiceDescription.TargetNamespace)); - soapPortType.Operations.Add(CreateOperation("Subtract","SubtractSoapIn", - "SubtractSoapOut",myServiceDescription.TargetNamespace)); - soapPortType.Operations.Add(CreateOperation("Multiply","MultiplySoapIn", - "MultiplySoapOut",myServiceDescription.TargetNamespace)); - soapPortType.Operations.Add(CreateOperation("Divide","DivideSoapIn", - "DivideSoapOut",myServiceDescription.TargetNamespace)); - myServiceDescription.PortTypes.Add(soapPortType); - - // Create a new Binding for the SOAP protocol. - Binding myBinding = new Binding(); - myBinding.Name = myServiceDescription.Services[0].Name + "Soap"; - - // Pass the name of the existing PortType MathServiceSoap and the - // Xml TargetNamespace attribute of the Descriptions tag. - myBinding.Type = new XmlQualifiedName("MathServiceSoap", - myServiceDescription.TargetNamespace); - - // Create a SOAP extensibility element. - SoapBinding mySoapBinding = new SoapBinding(); - mySoapBinding.Transport = "http://schemas.xmlsoap.org/soap/http"; - mySoapBinding.Style = SoapBindingStyle.Document; - - // Add tag soap:binding as an extensibility element. - myBinding.Extensions.Add(mySoapBinding); - - // Create OperationBindings for each of the operations defined - // in the .asmx file. - OperationBinding addOperationBinding = CreateOperationBinding( - "Add",myServiceDescription.TargetNamespace); - myBinding.Operations.Add(addOperationBinding); - OperationBinding subtractOperationBinding = CreateOperationBinding( - "Subtract",myServiceDescription.TargetNamespace); - myBinding.Operations.Add(subtractOperationBinding); - OperationBinding multiplyOperationBinding = CreateOperationBinding( - "Multiply",myServiceDescription.TargetNamespace); - myBinding.Operations.Add(multiplyOperationBinding); - OperationBinding divideOperationBinding = CreateOperationBinding( - "Divide",myServiceDescription.TargetNamespace); - myBinding.Operations.Add(divideOperationBinding); - myServiceDescription.Bindings.Insert(0,myBinding); - Console.WriteLine("\nTarget namespace of the service description to " + - "which the binding was added is: " + - myServiceDescription.Bindings[0].ServiceDescription.TargetNamespace); - - // Create a Port. - Port soapPort = new Port(); - soapPort.Name = "MathServiceSoap"; - soapPort.Binding = new XmlQualifiedName(myBinding.Name, - myServiceDescription.TargetNamespace); - - // Create a SoapAddress extensibility element to add to the port. - SoapAddressBinding mySoapAddressBinding = new SoapAddressBinding(); - mySoapAddressBinding.Location = "http://localhost/MathService.cs.asmx"; - soapPort.Extensions.Add(mySoapAddressBinding); - - // Add the port to the MathService, which is the first service in - // the service collection. - myServiceDescription.Services[0].Ports.Add(soapPort); - - // Save the ServiceDescription to an external file. - myServiceDescription.Write("MathService_new.wsdl"); - Console.WriteLine("\nSuccessfully added bindings for SOAP protocol " + - "and saved results in the file MathService_new.wsdl"); - Console.WriteLine("\n This file should be passed to the WSDL tool " + - "as input to generate the proxy"); - } -// - // Creates a Message with name = messageName having one MessagePart - // with name = partName. - public static Message CreateMessage(string messageName,string partName, - string element,string targetNamespace) - { -// -// - Message myMessage = new Message(); - myMessage.Name = messageName; -// -// -// -// -// - MessagePart myMessagePart = new MessagePart(); - myMessagePart.Name = partName; - myMessagePart.Element = new XmlQualifiedName(element,targetNamespace); - myMessage.Parts.Add(myMessagePart); -// -// -// -// -// - return myMessage; - } -// -// - // Used to create OperationBinding instances within 'Binding'. - public static OperationBinding CreateOperationBinding(string operation, - string targetNamespace) - { - // Create OperationBinding for operation. - OperationBinding myOperationBinding = new OperationBinding(); - myOperationBinding.Name = operation; -// -// - // Create InputBinding for operation. - InputBinding myInputBinding = new InputBinding(); - SoapBodyBinding mySoapBodyBinding = new SoapBodyBinding(); - mySoapBodyBinding.Use = SoapBindingUse.Literal; - myInputBinding.Extensions.Add(mySoapBodyBinding); -// -// - // Create OutputBinding for operation. - OutputBinding myOutputBinding = new OutputBinding(); - myOutputBinding.Extensions.Add(mySoapBodyBinding); - - // Add InputBinding and OutputBinding to OperationBinding. - myOperationBinding.Input = myInputBinding; - myOperationBinding.Output = myOutputBinding; - - // Create an extensibility element for SoapOperationBinding. - SoapOperationBinding mySoapOperationBinding = new SoapOperationBinding(); - mySoapOperationBinding.Style = SoapBindingStyle.Document; - mySoapOperationBinding.SoapAction = targetNamespace + operation; - - // Add the extensibility element SoapOperationBinding to OperationBinding. - myOperationBinding.Extensions.Add(mySoapOperationBinding); - return myOperationBinding; - } -// - // Used to create Operations under PortType. - public static Operation CreateOperation(string operationName, - string inputMessage,string outputMessage,string targetNamespace) - { - Operation myOperation = new Operation(); - myOperation.Name = operationName; - OperationMessage input = (OperationMessage) new OperationInput(); - input.Message = new XmlQualifiedName(inputMessage,targetNamespace); - OperationMessage output = (OperationMessage) new OperationOutput(); - output.Message = new XmlQualifiedName(outputMessage,targetNamespace); - myOperation.Messages.Add(input); - myOperation.Messages.Add(output); - return myOperation; - } -} diff --git a/snippets/csharp/System.Web.Services.Description/InputBinding/Overview/mathserviceclient.cs.aspx b/snippets/csharp/System.Web.Services.Description/InputBinding/Overview/mathserviceclient.cs.aspx deleted file mode 100644 index bd6aa3d83bd..00000000000 --- a/snippets/csharp/System.Web.Services.Description/InputBinding/Overview/mathserviceclient.cs.aspx +++ /dev/null @@ -1,50 +0,0 @@ - - - -

- Using a Simple Math Service -

-
-
- Operand 1: -
- -
- Operand 2: -
- -

- - - -

- -

-
- - diff --git a/snippets/csharp/System.Web.Services.Description/Message/FindPartByName/MathService_cs.wsdl b/snippets/csharp/System.Web.Services.Description/Message/FindPartByName/MathService_cs.wsdl deleted file mode 100644 index 9aa220c7ed2..00000000000 --- a/snippets/csharp/System.Web.Services.Description/Message/FindPartByName/MathService_cs.wsdl +++ /dev/null @@ -1,352 +0,0 @@ - - - - - All types have been defined here - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Port Type "MathServiceHttpGet" is defined here - - - - - - - - - - - - - - - - - - - - - Port Type "MathServiceHttpPost" is defined here - - - - - - - - - - - - - - - - - - - - - Port Type "MathServiceSoap" is defined here - - - - - - - - - - - - - - - - - - - - - Binding "MathServiceSoap" is defined here - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Binding "MathServiceHttpGet" is defined here - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Binding "MathServiceHttpPost" is defined here - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/Message/FindPartByName/Project.csproj b/snippets/csharp/System.Web.Services.Description/Message/FindPartByName/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/Message/FindPartByName/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/Message/FindPartByName/message_samples3.cs b/snippets/csharp/System.Web.Services.Description/Message/FindPartByName/message_samples3.cs deleted file mode 100644 index a8eb38126ea..00000000000 --- a/snippets/csharp/System.Web.Services.Description/Message/FindPartByName/message_samples3.cs +++ /dev/null @@ -1,58 +0,0 @@ -// System.Web.Services.Description.Message.FindPartsByName -// System.Web.Services.Description.Message.ServiceDescription -// System.Web.Services.Description.Message.FindPartByName - -/* The following program demonstrates the property ' ServiceDescription' and - methods 'FindPartsByName','FindPartByName' of class 'Message'. The program - reads a wsdl document "MathService.wsdl" and instantiates a - ServiceDescription instance from WSDL document. - The program invokes 'FindPartsByName' to obtain an array of MessageParts and also invokes - 'FindPartByName' to retrieve a specific 'MessagePart'. - */ -using System; -using System.Web.Services.Description; -using System.Collections; -using System.Xml; - -namespace MyMessage -{ - class MyClass1 - { - public static void Main() - { - try - { -// - ServiceDescription myServiceDescription = ServiceDescription.Read("MathService_cs.wsdl"); -// - // Get message from ServiceDescription. - Message myMessage1 = myServiceDescription.Messages["AddHttpPostIn"]; - Console.WriteLine("ServiceDescription :"+myMessage1.ServiceDescription); -// - string[] myParts = new string[2]; - myParts[0] = "a"; - myParts[1] = "b"; - MessagePart[] myMessageParts = myMessage1.FindPartsByName(myParts); - Console.WriteLine("Results of FindPartsByName operation:"); - for(int i=0;i -// - // Get another message from ServiceDescription. - Message myMessage2 = myServiceDescription.Messages["DivideHttpGetOut"]; - MessagePart myMessagePart=myMessage2.FindPartByName("Body"); - Console.WriteLine("Results of FindPartByName operation:"); - Console.WriteLine("Part Name: " +myMessagePart.Name); - Console.WriteLine("Part Element: " +myMessagePart.Element); -// - } - catch(Exception e) - { - Console.WriteLine("Exception: " + e.Message); - } - } - } -} diff --git a/snippets/csharp/System.Web.Services.Description/MessageBinding/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/MessageBinding/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MessageBinding/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/MessageBinding/Overview/messagebinding_sample.cs b/snippets/csharp/System.Web.Services.Description/MessageBinding/Overview/messagebinding_sample.cs deleted file mode 100644 index fb1f2491277..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MessageBinding/Overview/messagebinding_sample.cs +++ /dev/null @@ -1,86 +0,0 @@ -// System.Web.Services.Description.MessageBinding -// System.Web.Services.Description.MessageBinding.MessageBinding(); -// System.Web.Services.Description.MessageBinding.Extensions; -// System.Web.Services.Description.MessageBinding.Name; - -/* The following program demonstrates the abstract class 'MessageBinding', it's constructor MessageBinding() - and properties 'Extensions' and 'Name'. - 'MessageBinding' is an abstract class from which 'InputBinding' , 'OutputBinding' are derived. - The program contains a utility function which could be used to create either an InputBinding or OutputBinding. - This generic nature is achieved by returning an instance of 'MessageBinding'. - */ -// -using System; -using System.Web.Services.Description; -class MyClass -{ - public static void Main() - { - OperationBinding addOperationBinding = - CreateOperationBinding("Add","http://tempuri.org/"); - } - - public static MessageBinding CreateInputOutputBinding(string myBindName, - bool isInputBinding) - { -// - - // Value isInputBinding = true ---> return type = InputBinding. - // Value isInputBinding = false --> return type = OutputBinding. -// -// - MessageBinding myMessageBinding = null; - switch(isInputBinding) - { - case true: - myMessageBinding = new InputBinding(); - Console.WriteLine("Added an InputBinding"); - break; - case false: - myMessageBinding = new OutputBinding(); - Console.WriteLine("Added an OutputBinding"); - break; - } -// - myMessageBinding.Name = myBindName; - SoapBodyBinding mySoapBodyBinding = new SoapBodyBinding(); - mySoapBodyBinding.Use = SoapBindingUse.Literal; - myMessageBinding.Extensions.Add(mySoapBodyBinding); - Console.WriteLine("Added extensibility element of type : " + - mySoapBodyBinding.GetType()); -// -// - return myMessageBinding; - } - - // Used to create OperationBinding instances within Binding. - public static OperationBinding CreateOperationBinding( - string myOperation,string targetNamespace) - { - // Create OperationBinding for Operation. - OperationBinding myOperationBinding = new OperationBinding(); - myOperationBinding.Name = myOperation; - - // Create InputBinding for operation. - InputBinding myInputBinding = - (InputBinding)CreateInputOutputBinding(null,true); - - // Create OutputBinding for operation. - OutputBinding myOutputBinding = - (OutputBinding)CreateInputOutputBinding(null,false); - - // Add InputBinding and OutputBinding to OperationBinding. - myOperationBinding.Input = myInputBinding; - myOperationBinding.Output = myOutputBinding; - - // Create an extensibility element for SoapOperationBinding. - SoapOperationBinding mySoapOperationBinding = new SoapOperationBinding(); - mySoapOperationBinding.Style = SoapBindingStyle.Document; - mySoapOperationBinding.SoapAction = targetNamespace + myOperation; - - // Add the extensibility element SoapOperationBinding to OperationBinding. - myOperationBinding.Extensions.Add(mySoapOperationBinding); - return myOperationBinding; - } -} -// diff --git a/snippets/csharp/System.Web.Services.Description/MessageCollection/Contains/Project.csproj b/snippets/csharp/System.Web.Services.Description/MessageCollection/Contains/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MessageCollection/Contains/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/MessageCollection/Contains/messagecollection.cs b/snippets/csharp/System.Web.Services.Description/MessageCollection/Contains/messagecollection.cs deleted file mode 100644 index 159ac7628a2..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MessageCollection/Contains/messagecollection.cs +++ /dev/null @@ -1,80 +0,0 @@ -// System.Web.Services.Description.MessageCollection.CopyTo; -// System.Web.Services.Description.MessageCollection.Item Property(Int32); -// System.Web.Services.Description.MessageCollection.Item Property (String); -// System.Web.Services.Description.MessageCollection.Contains; -// System.Web.Services.Description.MessageCollection.IndexOf; -// System.Web.Services.Description.MessageCollection.Remove; - -/* The program reads a WSDL document "MathService.wsdl" and gets a ServiceDescription instance. - A MessageCollection instance is then retrieved from this ServiceDescription instance and it's - members are demonstrated. -*/ - -using System; -using System.Web.Services.Description; -using System.Collections; -using System.Xml; - -class MyClass1 -{ - public static void Main() - { - ServiceDescription myServiceDescription = ServiceDescription.Read("MathService_1.wsdl"); - Console.WriteLine(""); - Console.WriteLine("MessageCollection Sample"); - Console.WriteLine("========================"); - Console.WriteLine(""); -// - // Get Message Collection. - MessageCollection myMessageCollection = myServiceDescription.Messages; - Console.WriteLine("Total Messages in the document = " + myServiceDescription.Messages.Count); - Console.WriteLine(""); - Console.WriteLine("Enumerating Messages..."); - Console.WriteLine(""); - // Print messages to console. - for(int i =0; i < myMessageCollection.Count; ++i) - { - Console.WriteLine("Message Name : " + myMessageCollection[i].Name); - } -// -// - // Create a Message Array. - Message[] myMessages = new Message[myServiceDescription.Messages.Count]; - // Copy MessageCollection to an array. - myServiceDescription.Messages.CopyTo(myMessages,0); - Console.WriteLine(""); - Console.WriteLine("Displaying Messages that were copied to Messagearray ..."); - Console.WriteLine(""); - for(int i=0;i < myServiceDescription.Messages.Count; ++i) - { - Console.WriteLine("Message Name : " + myMessages[i].Name); - } -// - -// -// -// -// - // Get Message by Name = "AddSoapIn". - Message myMessage = myServiceDescription.Messages["AddSoapIn"]; - Console.WriteLine(""); - Console.WriteLine("Getting Message = 'AddSoapIn' {by Name}"); - if (myMessageCollection.Contains(myMessage)) - { - Console.WriteLine(""); - // Get Message Name = "AddSoapIn" Index. - Console.WriteLine("Message 'AddSoapIn' was found in Message Collection."); - Console.WriteLine("Index of 'AddSoapIn' in Message Collection = " + myMessageCollection.IndexOf(myMessage)); - Console.WriteLine("Deleting Message from Message Collection..."); - myMessageCollection.Remove(myMessage); - if(myMessageCollection.IndexOf(myMessage) == -1) - { - Console.WriteLine("Message 'AddSoapIn' was successfully removed from Message Collection."); - } - } -// -// -// -// - } -} \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/MessagePart/Message/Project.csproj b/snippets/csharp/System.Web.Services.Description/MessagePart/Message/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MessagePart/Message/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/MessagePart/Message/messagepartcollection.cs b/snippets/csharp/System.Web.Services.Description/MessagePart/Message/messagepartcollection.cs deleted file mode 100644 index e967fd93749..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MessagePart/Message/messagepartcollection.cs +++ /dev/null @@ -1,119 +0,0 @@ -// System.Web.Services.Description.MessagePartCollection.Item Property(Int32); -// System.Web.Services.Description.MessagePart.Message; -// System.Web.Services.Description.MessagePartCollection.CopyTo; -// System.Web.Services.Description.MessagePartCollection.Item Property (String); -// System.Web.Services.Description.MessagePartCollection.Contains; -// System.Web.Services.Description.MessagePartCollection.IndexOf; -// System.Web.Services.Description.MessagePartCollection.Remove; -// System.Web.Services.Description.MessagePartCollection; - -/* The program reads a wsdl document "MathService.wsdl" and gets ServiceDescription instance. - A MessagePartCollection instance is then retrieved from each Message and it's members are demonstrated. -*/ - -// -using System; -using System.Web.Services.Description; -using System.Collections; -using System.Xml; - -class MyClass1 -{ - public static void Main() - { - Console.WriteLine(""); - Console.WriteLine("MessagePartCollection Sample"); - Console.WriteLine("============================"); - Console.WriteLine(""); - - ServiceDescription myServiceDescription = - ServiceDescription.Read("MathService.wsdl"); - - // Get the message collection. - MessageCollection myMessageCollection = myServiceDescription.Messages; - Console.WriteLine("Total Messages in the document = " + - myServiceDescription.Messages.Count); - Console.WriteLine(""); - Console.WriteLine("Enumerating PartCollection for each message..."); - Console.WriteLine(""); -// -// - // Get the message part collection for each message. - for(int i =0; i < myMessageCollection.Count; ++i) - { - Console.WriteLine("Message : " + myMessageCollection[i].Name); - - // Get the message part collection. - MessagePartCollection myMessagePartCollection = - myMessageCollection[i].Parts; - - // Display the part collection. - for(int k = 0; k < myMessagePartCollection.Count;k++) - { - Console.WriteLine("\t Part Name : " + - myMessagePartCollection[k].Name); - Console.WriteLine("\t Message Name : " + - myMessagePartCollection[k].Message.Name); - } - Console.WriteLine(""); - } -// -// - Console.WriteLine("Displaying the array copied from the " + - "MessagePartCollection for the message AddHttpGetIn."); -// -// - Message myLocalMessage = myServiceDescription.Messages["AddHttpPostOut"]; - if (myMessageCollection.Contains(myLocalMessage)) - { - Console.WriteLine("Message : " + myLocalMessage.Name); - - // Get the message part collection. - MessagePartCollection myMessagePartCollection = myLocalMessage.Parts; - MessagePart[] myMessagePart = - new MessagePart[myMessagePartCollection.Count]; - - // Copy the MessagePartCollection to an array. - myMessagePartCollection.CopyTo(myMessagePart,0); - for(int k = 0; k < myMessagePart.Length; k++) - { - Console.WriteLine("\t Part Name : " + - myMessagePartCollection[k].Name); - } - Console.WriteLine(""); - } -// -// - -// -// -// - Console.WriteLine("Checking if message is AddHttpPostOut..."); - Message myMessage = myServiceDescription.Messages["AddHttpPostOut"]; - if (myMessageCollection.Contains(myMessage)) - { - // Get the message part collection. - MessagePartCollection myMessagePartCollection = myMessage.Parts; - - // Get the part named Body. - MessagePart myMessagePart = myMessage.Parts["Body"]; - if (myMessagePartCollection.Contains(myMessagePart)) - { - // Get the index of the part named Body. - Console.WriteLine("Index of Body in MessagePart collection = " + - myMessagePartCollection.IndexOf(myMessagePart)); - Console.WriteLine("Deleting Body from MessagePart collection..."); - myMessagePartCollection.Remove(myMessagePart); - if(myMessagePartCollection.IndexOf(myMessagePart)== -1) - { - Console.WriteLine("MessagePart Body successfully deleted " + - "from the message AddHttpPostOut."); - } - } - } -// -// -// - } -} -// diff --git a/snippets/csharp/System.Web.Services.Description/MimeContentBinding/Overview/MimeContentSample_cs.wsdl b/snippets/csharp/System.Web.Services.Description/MimeContentBinding/Overview/MimeContentSample_cs.wsdl deleted file mode 100644 index 29a1e169633..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MimeContentBinding/Overview/MimeContentSample_cs.wsdl +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/MimeContentBinding/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/MimeContentBinding/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MimeContentBinding/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/MimeContentBinding/Overview/mimecontentbinding_part_4.cs b/snippets/csharp/System.Web.Services.Description/MimeContentBinding/Overview/mimecontentbinding_part_4.cs deleted file mode 100644 index e5b34fcec28..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MimeContentBinding/Overview/mimecontentbinding_part_4.cs +++ /dev/null @@ -1,56 +0,0 @@ -// System.Web.Services.Description.MimeContentBinding.Type -// System.Web.Services.Description.MimeContentBinding.Part -// System.Web.Services.Description.MimeContentBinding.NameSpace -// System.Web.Services.Description.MimeContentBinding - -/* The following program demonstrates properties 'Type','Part' - and field 'NameSpace' of class 'MimeContentBinding'. It reads 'MimeContentSample_cs.wsdl' file - and instantiates a ServiceDescription object.'MimeContentBinding' objects are retrieved from Extension - points of OutputBinding for one of the Binding object and its properties 'Type','Part' are displayed. It also displays 'NameSpace' of the 'MimeContentBinding' object. -*/ -// -using System; -using System.Web.Services.Description; - -namespace MimeContentBinding_work -{ - class MyMimeContentClass - { - static void Main() - { -// -// -// - ServiceDescription myServiceDescription = - ServiceDescription.Read("MimeContentSample_cs.wsdl"); - - // Get the Binding. - Binding myBinding = myServiceDescription.Bindings["b1"]; - - // Get the first OperationBinding. - OperationBinding myOperationBinding = myBinding.Operations[0]; - OutputBinding myOutputBinding = myOperationBinding.Output; - ServiceDescriptionFormatExtensionCollection - myServiceDescriptionFormatExtensionCollection = - myOutputBinding.Extensions; - - // Find all MimeContentBinding objects in extensions. - MimeContentBinding[] myMimeContentBindings = (MimeContentBinding[]) - myServiceDescriptionFormatExtensionCollection.FindAll( - typeof(MimeContentBinding)); - - // Enumerate the array and display MimeContentBinding properties. - foreach(MimeContentBinding myMimeContentBinding in - myMimeContentBindings) - { - Console.WriteLine("Type: " + myMimeContentBinding.Type); - Console.WriteLine("Part: " + myMimeContentBinding.Part); - } -// -// - Console.WriteLine("Namespace: " + MimeContentBinding.Namespace); -// - } - } -} -// diff --git a/snippets/csharp/System.Web.Services.Description/MimeMultipartRelatedBinding/Overview/MimeMultiPartRelatedSample_cs.wsdl b/snippets/csharp/System.Web.Services.Description/MimeMultipartRelatedBinding/Overview/MimeMultiPartRelatedSample_cs.wsdl deleted file mode 100644 index 4ad0d84133f..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MimeMultipartRelatedBinding/Overview/MimeMultiPartRelatedSample_cs.wsdl +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/MimeMultipartRelatedBinding/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/MimeMultipartRelatedBinding/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MimeMultipartRelatedBinding/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/MimeMultipartRelatedBinding/Overview/mimemultipartrelatedbinding_parts_2.cs b/snippets/csharp/System.Web.Services.Description/MimeMultipartRelatedBinding/Overview/mimemultipartrelatedbinding_parts_2.cs deleted file mode 100644 index 1ad1a3fb055..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MimeMultipartRelatedBinding/Overview/mimemultipartrelatedbinding_parts_2.cs +++ /dev/null @@ -1,60 +0,0 @@ -// System.Web.Services.Description.MimeMultipartRelatedBinding -// System.Web.Services.Description.MimeMultipartRelatedBinding.Parts; - -/* The following program demonstrates the property 'Parts' of class 'MimeMultipartRelatedBinding'. - It reads 'MimeMultiPartRelatedSample_cs.wsdl'file and instantiates a ServiceDescription object. - 'MimeMultipartRelatedBinding' object is retrieved from Extension - points of OutputBinding for one of the Binding object and its property'Parts' has been demonstrated. -*/ -// -using System; -using System.Web.Services.Description; - -namespace MimeContentBinding_work -{ - class MyMimeContentClass - { - static void Main() - { -// - ServiceDescription myServicDescription = - ServiceDescription.Read("MimeMultiPartRelatedSample_cs.wsdl"); - - // Get the binding collection. - BindingCollection myBindingCollection = myServicDescription.Bindings; - int index =0; - for (int i= 0; i < myBindingCollection.Count;i++) - { - // Get the collection for MimeServiceHttpPost. - if( myBindingCollection[i].Name == "MimeServiceHttpPost") - { - OperationBindingCollection myOperationBindingCollection = - myBindingCollection[i].Operations; - OutputBinding myOutputBinding = - myOperationBindingCollection[0].Output; - ServiceDescriptionFormatExtensionCollection - myServiceDescriptionFormatExtensionCollection = - myOutputBinding.Extensions; - MimeMultipartRelatedBinding myMimeMultipartRelatedBinding = - (MimeMultipartRelatedBinding) - myServiceDescriptionFormatExtensionCollection.Find( - typeof(MimeMultipartRelatedBinding)); - MimePartCollection myMimePartCollection = - myMimeMultipartRelatedBinding.Parts; - foreach( MimePart myMimePart in myMimePartCollection) - { - Console.WriteLine("Extension types added to MimePart: " + - index ++); - Console.WriteLine ("----------------------------"); - foreach(object myExtension in myMimePart.Extensions) - Console.WriteLine(myExtension.GetType()); - Console.WriteLine(); - } - break; - } - } -// - } - } -} -// diff --git a/snippets/csharp/System.Web.Services.Description/MimePart/Overview/MimePart_3_Input_cs.wsdl b/snippets/csharp/System.Web.Services.Description/MimePart/Overview/MimePart_3_Input_cs.wsdl deleted file mode 100644 index 64548b47a64..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MimePart/Overview/MimePart_3_Input_cs.wsdl +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/MimePart/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/MimePart/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MimePart/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/MimePart/Overview/mimepart_3.cs b/snippets/csharp/System.Web.Services.Description/MimePart/Overview/mimepart_3.cs deleted file mode 100644 index edfc24fdebf..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MimePart/Overview/mimepart_3.cs +++ /dev/null @@ -1,63 +0,0 @@ -// System.Web.Services.Description.MimePart -// System.Web.Services.Description.MimePart.ctor() -// System.Web.Services.Description.MimePart.Extensions - -/* The following program demonstrates the 'MimePart' class, constructor - and 'Extensions' property of 'MimePart' class. It reads - 'MimePart_3_Input_cs.wsdl' file which does not have 'MimePart' object - supporting 'OutPut' of 'HttpPost'. It adds the 'MimePart' and finally - writes into 'MimePart_3_OutPut_cs.wsdl' file. -*/ - -// -using System; -using System.Xml; -using System.Web.Services.Description; - -public class MyMimePart -{ - public static void Main() - { - ServiceDescription myServiceDescription = - ServiceDescription.Read("MimePart_3_Input_cs.wsdl"); - ServiceDescriptionCollection myServiceDescriptionCol = - new ServiceDescriptionCollection(); - myServiceDescriptionCol.Add(myServiceDescription); - XmlQualifiedName myXmlQualifiedName = - new XmlQualifiedName("MimeServiceHttpPost","http://tempuri.org/"); - - // Create the Binding. - Binding myBinding = - myServiceDescriptionCol.GetBinding(myXmlQualifiedName); - OperationBinding myOperationBinding= null; - for(int i=0; i< myBinding.Operations.Count; i++) - { - if(myBinding.Operations[i].Name.Equals("AddNumbers")) - { - myOperationBinding = myBinding.Operations[i]; - } - } -// -// - // Create the OutputBinding. - OutputBinding myOutputBinding = myOperationBinding.Output; - MimeXmlBinding myMimeXmlBinding = new MimeXmlBinding(); - myMimeXmlBinding.Part = "body"; - - // Create the MimePart. - MimePart myMimePart = new MimePart(); - myMimePart.Extensions.Add(myMimeXmlBinding); - MimeMultipartRelatedBinding myMimePartRelatedBinding = - new MimeMultipartRelatedBinding(); - - // Add the MimePart to the MimePartRelatedBinding. - myMimePartRelatedBinding.Parts.Add(myMimePart); - myOutputBinding.Extensions.Add(myMimePartRelatedBinding); -// -// - myServiceDescription.Write("MimePart_3_Output_CS.wsdl"); - Console.WriteLine( - "MimePart_3_Output_CS.wsdl has been generated successfully."); - } -} -// diff --git a/snippets/csharp/System.Web.Services.Description/MimePartCollection/Add/MimePartCollection_8_Input_cs.wsdl b/snippets/csharp/System.Web.Services.Description/MimePartCollection/Add/MimePartCollection_8_Input_cs.wsdl deleted file mode 100644 index 745bfd01aee..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MimePartCollection/Add/MimePartCollection_8_Input_cs.wsdl +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/MimePartCollection/Add/Project.csproj b/snippets/csharp/System.Web.Services.Description/MimePartCollection/Add/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MimePartCollection/Add/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/MimePartCollection/Add/mimepartcollection_8.cs b/snippets/csharp/System.Web.Services.Description/MimePartCollection/Add/mimepartcollection_8.cs deleted file mode 100644 index 2f01d5f3db6..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MimePartCollection/Add/mimepartcollection_8.cs +++ /dev/null @@ -1,149 +0,0 @@ -// System.Web.Services.Description.MimePartCollection.MimePartCollection() -// System.Web.Services.Description.MimePartCollection.Item[System.Int32 index] -// System.Web.Services.Description.MimePartCollection.Insert -// System.Web.Services.Description.MimePartCollection.IndexOf -// System.Web.Services.Description.MimePartCollection.Add -// System.Web.Services.Description.MimePartCollection.Contains -// System.Web.Services.Description.MimePartCollection.CopyTo -// System.Web.Services.Description.MimePartCollection.Remove - -/* This program demonstrates constructor, 'Item' property ,'Insert','IndexOf','Add', - 'Contains','CopyTo',and 'Remove' methods of 'MimePartCollection' class. - It takes 'MimePartCollection_8_Input_cs.wsdl' as an input file which contains - one 'MimePart' object that supports 'HttpPost'. A mimepartcollection object is - created and new mimepart objects are added to mimepartcollection using 'Insert' - and 'Add' methods. A mimepart object is removed from the mimepartcollection using - 'Remove' method. The ServiceDescription is finally written into output wsdl file - 'MimePartCollection_8_out_CS.wsdl'. -*/ - -using System; -using System.Collections; -using System.Xml; -using System.Web.Services.Description; - -public class MyMimePartCollection -{ - public static void Main() - { - ServiceDescription myServiceDescription = - ServiceDescription.Read("MimePartCollection_8_Input_cs.wsdl"); - ServiceDescriptionCollection myServiceDescriptionCol = - new ServiceDescriptionCollection(); - myServiceDescriptionCol.Add(myServiceDescription); - XmlQualifiedName myXmlQualifiedName = - new XmlQualifiedName("MimeServiceHttpPost","http://tempuri.org/"); - // Create a binding object. - Binding myBinding = myServiceDescriptionCol.GetBinding(myXmlQualifiedName); - OperationBinding myOperationBinding= null; - for(int i=0; i -// -// -// - MimeMultipartRelatedBinding myMimeMultipartRelatedBinding = null; - IEnumerator myIEnumerator = myOutputBinding.Extensions.GetEnumerator(); - while(myIEnumerator.MoveNext()) - { - myMimeMultipartRelatedBinding=(MimeMultipartRelatedBinding)myIEnumerator.Current; - } - // Create an instance of 'MimePartCollection'. - MimePartCollection myMimePartCollection = new MimePartCollection(); - myMimePartCollection= myMimeMultipartRelatedBinding.Parts; - Console.WriteLine("Total number of mimepart elements in the collection initially"+ - " is: " +myMimePartCollection.Count); - // Get the type of first 'Item' in collection. - Console.WriteLine("The first object in collection is of type: " - +myMimePartCollection[0].ToString()); - MimePart myMimePart1=new MimePart(); - // Create an instance of 'MimeXmlBinding'. - MimeXmlBinding myMimeXmlBinding1 = new MimeXmlBinding(); - myMimeXmlBinding1.Part = "body"; - myMimePart1.Extensions.Add(myMimeXmlBinding1); - // a mimepart at first position. - myMimePartCollection.Insert(0,myMimePart1); - Console.WriteLine("Inserting a mimepart object..."); - // Check whether 'Insert' was successful or not. - if(myMimePartCollection.Contains(myMimePart1)) - { - // Display the index of inserted 'MimePart'. - Console.WriteLine("'MimePart' is successfully inserted at position: " - +myMimePartCollection.IndexOf(myMimePart1)); - } -// -// -// -// - Console.WriteLine("Total number of mimepart elements after inserting is: " - + myMimePartCollection.Count); - -// -// - MimePart myMimePart2=new MimePart(); - MimeXmlBinding myMimeXmlBinding2 = new MimeXmlBinding(); - myMimeXmlBinding2.Part = "body"; - myMimePart2.Extensions.Add(myMimeXmlBinding2); - // Add a mimepart to the mimepartcollection. - myMimePartCollection.Add(myMimePart2); - Console.WriteLine("Adding a mimepart object..."); - // Check if collection contains added mimepart object. - if(myMimePartCollection.Contains(myMimePart2)) - { - Console.WriteLine("'MimePart' is successfully added at position: " - +myMimePartCollection.IndexOf(myMimePart2)); - } -// -// - Console.WriteLine("Total number of mimepart elements after adding is: " - +myMimePartCollection.Count); - -// - MimePart[] myArray = new MimePart[myMimePartCollection.Count]; - // Copy the mimepartcollection to an array. - myMimePartCollection.CopyTo(myArray,0); - Console.WriteLine("Displaying the array copied from mimepartcollection"); - for(int j=0;j -// - Console.WriteLine("Removing a mimepart object..."); - // Remove the mimepart from the mimepartcollection. - myMimePartCollection.Remove(myMimePart1); - // Check whether the mimepart is removed or not. - if(!myMimePartCollection.Contains(myMimePart1)) - { - Console.WriteLine("Mimepart is successfully removed from mimepartcollection"); - } -// - Console.WriteLine("Total number of elements in collection after removing is: " - +myMimePartCollection.Count); - MimePart[] myArray1 = new MimePart[myMimePartCollection.Count]; - myMimePartCollection.CopyTo(myArray1,0); - Console.WriteLine("Dispalying the 'MimePartCollection' after removing"); - for(int j=0;j - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/MimePartCollection/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/MimePartCollection/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MimePartCollection/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/MimePartCollection/Overview/mimepartcollection_1.cs b/snippets/csharp/System.Web.Services.Description/MimePartCollection/Overview/mimepartcollection_1.cs deleted file mode 100644 index 6f67889dba2..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MimePartCollection/Overview/mimepartcollection_1.cs +++ /dev/null @@ -1,71 +0,0 @@ -// System.Web.Services.Description.MimePartCollection - -/* The following program demostrates 'MimePartCollection' class. It - takes 'MimePartCollection_1_Input_cs.wsdl' as input which - contains one 'MimePart' object that supports 'HttpPost'. - A mimepartcollection object is created and mimepart is added to the - mimepartcollection at the specified location, finally writes - into the file'MimePartCollection_1_Output_CS.wsdl'. -*/ - -// -using System; -using System.Collections; -using System.Xml; -using System.Web.Services.Description; - -public class MyMimePartCollection -{ - public static void Main() - { - ServiceDescription myServiceDescription = - ServiceDescription.Read("MimePartCollection_1_Input_cs.wsdl"); - ServiceDescriptionCollection myServiceDescriptionCol = - new ServiceDescriptionCollection(); - myServiceDescriptionCol.Add(myServiceDescription); - XmlQualifiedName myXmlQualifiedName = - new XmlQualifiedName("MimeServiceHttpPost","http://tempuri.org/"); - // Create a 'Binding' object. - Binding myBinding = myServiceDescriptionCol.GetBinding(myXmlQualifiedName); - OperationBinding myOperationBinding= null; - for(int i=0; i \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/MimeTextBinding/Overview/MimeText_Binding_MatchService.CS.asmx b/snippets/csharp/System.Web.Services.Description/MimeTextBinding/Overview/MimeText_Binding_MatchService.CS.asmx deleted file mode 100644 index e84d065ae3f..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MimeTextBinding/Overview/MimeText_Binding_MatchService.CS.asmx +++ /dev/null @@ -1,18 +0,0 @@ -<%@WebService Language="c#" Class="MimeText_Binding_MatchService"%> - -using System; -using System.Collections; -using System.ComponentModel; -using System.Data; -using System.Diagnostics; -using System.Web; -using System.Web.Services; - -public class MimeText_Binding_MatchService: System.Web.Services.WebService -{ - [WebMethod] - public int AddNumbers(int firstNumber,int secondNumber) - { - return firstNumber+secondNumber; - } -} diff --git a/snippets/csharp/System.Web.Services.Description/MimeTextBinding/Overview/MimeText_Binding_Match_8_Input_CS.wsdl b/snippets/csharp/System.Web.Services.Description/MimeTextBinding/Overview/MimeText_Binding_Match_8_Input_CS.wsdl deleted file mode 100644 index 521d34c6e62..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MimeTextBinding/Overview/MimeText_Binding_Match_8_Input_CS.wsdl +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/MimeTextBinding/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/MimeTextBinding/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MimeTextBinding/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/MimeTextBinding/Overview/mimetext_binding_match_8.cs b/snippets/csharp/System.Web.Services.Description/MimeTextBinding/Overview/mimetext_binding_match_8.cs deleted file mode 100644 index efd5de85313..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MimeTextBinding/Overview/mimetext_binding_match_8.cs +++ /dev/null @@ -1,130 +0,0 @@ -// System.Web.Services.Description.MimeTextBinding -// System.Web.Services.Description.MimeTextBinding() -// System.Web.Services.Description.MimeTextMatch() -// System.Web.Services.Description.MimeTextMatch.Name -// System.Web.Services.Description.MimeTextMatch.Type -// System.Web.Services.Description.MimeTextMatch.Pattern -// System.Web.Services.Description.MimeTextMatch.IgnoreCase -// System.Web.Services.Description.MimeTextBinding.Matches - -/* This program demostrates constructor and 'Matches' property - of 'MimeTextBinding' class and 'Name', 'Type', 'Pattern', - 'IgnoreCase' properties of 'MimeTextMatch' class. - It takes 'MimeText_Binding_Match_8_Input_CS.wsdl' as an - input file which does not contain 'Binding' object that supports - 'HttpPost'. A text pattern ''TITLE>(.*?)<' with text name - as 'Title' and with type name set, is added to the wsdl file. Finally the -' modified ServiceDescription is written to 'MimeText_Binding_Match_8_Output_CS.wsdl'. -*/ - -// -using System; -using System.Web.Services.Description; -using System.Collections; -using System.Xml; - -class MyTextBinding -{ - public static void Main() - { - try - { - ServiceDescription myServiceDescription = - ServiceDescription.Read("MimeText_Binding_Match_8_Input_CS.wsdl"); - - // Create a Binding. - Binding myBinding = new Binding(); - - // Initialize the Name property of the Binding. - myBinding.Name = "MimeText_Binding_MatchServiceHttpPost"; - XmlQualifiedName myXmlQualifiedName = - new XmlQualifiedName("s0:MimeText_Binding_MatchServiceHttpPost"); - myBinding.Type = myXmlQualifiedName; - - // Create an HttpBinding. - HttpBinding myHttpBinding = new HttpBinding(); - myHttpBinding.Verb="POST"; - - // Add the HttpBinding to the Binding. - myBinding.Extensions.Add(myHttpBinding); - - // Create an OperationBinding. - OperationBinding myOperationBinding = new OperationBinding(); - myOperationBinding.Name = "AddNumbers"; - - HttpOperationBinding myHttpOperationBinding = - new HttpOperationBinding(); - myHttpOperationBinding.Location="/AddNumbers"; - - // Add the HttpOperationBinding to the OperationBinding. - myOperationBinding.Extensions.Add(myHttpOperationBinding); - - // Create an InputBinding. - InputBinding myInputBinding = new InputBinding(); - MimeContentBinding postMimeContentbinding = new MimeContentBinding(); - postMimeContentbinding.Type = "application/x-www-form-urlencoded"; - myInputBinding.Extensions.Add(postMimeContentbinding); - - // Add the InputBinding to the OperationBinding. - myOperationBinding.Input = myInputBinding; -// -// -// -// -// -// -// - // Create an OutputBinding. - OutputBinding myOutputBinding = new OutputBinding(); - - // Create a MimeTextBinding. - MimeTextBinding myMimeTextBinding = new MimeTextBinding(); - - // Create a MimeTextMatch. - MimeTextMatch myMimeTextMatch = new MimeTextMatch(); - MimeTextMatchCollection myMimeTextMatchCollection ; - - // Initialize properties of the MimeTextMatch. - myMimeTextMatch.Name = "Title"; - myMimeTextMatch.Type = "*/*"; - myMimeTextMatch.Pattern = "'TITLE>(.*?)<"; - myMimeTextMatch.IgnoreCase = true; - - // Initialize a MimeTextMatchCollection. - myMimeTextMatchCollection = myMimeTextBinding.Matches; - - // Add the MimeTextMatch to the MimeTextMatchCollection. - myMimeTextMatchCollection.Add( myMimeTextMatch ); - myOutputBinding.Extensions.Add( myMimeTextBinding ); - - // Add the OutputBinding to the OperationBinding. - myOperationBinding.Output = myOutputBinding; -// -// -// -// -// -// -// - // Add the OutputBinding to the OperationBinding. - myOperationBinding.Output = myOutputBinding; - - // Add the OperationBinding to the Binding. - myBinding.Operations.Add(myOperationBinding); - - // Add the Binding to the BindingCollection of the ServiceDescription. - myServiceDescription.Bindings.Add(myBinding); - - // Write the ServiceDescription as a WSDL file. - myServiceDescription.Write("MimeText_Binding_Match_8_Output_CS.wsdl"); - Console.WriteLine( - "WSDL file named 'MimeText_Binding_Match_8_Output_CS.wsdl' was" - + " created successfully."); - } - catch(Exception e) - { - Console.WriteLine( "Exception: {0}", e.Message ); - } - } -} -// diff --git a/snippets/csharp/System.Web.Services.Description/MimeTextMatch/Capture/MimeTextMatchService.CS.asmx b/snippets/csharp/System.Web.Services.Description/MimeTextMatch/Capture/MimeTextMatchService.CS.asmx deleted file mode 100644 index b7451cfe100..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MimeTextMatch/Capture/MimeTextMatchService.CS.asmx +++ /dev/null @@ -1,18 +0,0 @@ -<%@WebService Language="c#" Class="MimeText_Match_MatchCollService"%> - -using System; -using System.Collections; -using System.ComponentModel; -using System.Data; -using System.Diagnostics; -using System.Web; -using System.Web.Services; - -public class MimeText_Match_MatchCollService: System.Web.Services.WebService -{ - [WebMethod] - public int AddNumbers(int firstNumber,int secondNumber) - { - return firstNumber+secondNumber; - } -} diff --git a/snippets/csharp/System.Web.Services.Description/MimeTextMatch/Capture/MimeTextMatch_5_Input_CS.wsdl b/snippets/csharp/System.Web.Services.Description/MimeTextMatch/Capture/MimeTextMatch_5_Input_CS.wsdl deleted file mode 100644 index b0b37666a68..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MimeTextMatch/Capture/MimeTextMatch_5_Input_CS.wsdl +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/MimeTextMatch/Capture/Project.csproj b/snippets/csharp/System.Web.Services.Description/MimeTextMatch/Capture/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MimeTextMatch/Capture/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/MimeTextMatch/Capture/mimetextmatch_5.cs b/snippets/csharp/System.Web.Services.Description/MimeTextMatch/Capture/mimetextmatch_5.cs deleted file mode 100644 index f3f947ec4c5..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MimeTextMatch/Capture/mimetextmatch_5.cs +++ /dev/null @@ -1,121 +0,0 @@ -// System.Web.Services.Description.MimeTextMatch -// System.Web.Services.Description.MimeTextMatch.Capture -// System.Web.Services.Description.MimeTextMatch.Group -// System.Web.Services.Description.MimeTextMatch.Repeats -// System.Web.Services.Description.MimeTextMatch.RepeatsString - -/* The following program demostrates constructor, 'Capture', 'Group', - 'Repeats' and 'RepeatsString' properties of 'MimeTextMatch'class. - It takes 'MimeTextMatch_5_Input_CS.wsdl' as input which does not - contain 'Binding' object supporting 'HttpPost'. A text pattern - ''TITLE>(.*?)<' with text name as 'Title' and type - name set which is to be searched in a HTTP transmission is added to the ServiceDescription. - The modified ServiceDescription is written into 'MimeTextMatch_5_Output_CS.wsdl'. -*/ - -// -using System; -using System.Web.Services.Description; -using System.Collections; -using System.Xml; - -class MyMimeTextMatchClass -{ - public static void Main() - { - try - { - int myInt = 0; - ServiceDescription myServiceDescription = - ServiceDescription.Read("MimeTextMatch_5_Input_CS.wsdl"); - // Create the 'Binding' object. - Binding myBinding = new Binding(); - // Initialize 'Name' property of 'Binding' class. - myBinding.Name = "MimeTextMatchServiceHttpPost"; - XmlQualifiedName myXmlQualifiedName = - new XmlQualifiedName("s0:MimeTextMatchServiceHttpPost"); - myBinding.Type = myXmlQualifiedName; - // Create the 'HttpBinding' object. - HttpBinding myHttpBinding = new HttpBinding(); - myHttpBinding.Verb="POST"; - // Add the 'HttpBinding' to the 'Binding'. - myBinding.Extensions.Add(myHttpBinding); - // Create the 'OperationBinding' object. - OperationBinding myOperationBinding = new OperationBinding(); - myOperationBinding.Name = "AddNumbers"; - HttpOperationBinding myHttpOperationBinding = new HttpOperationBinding(); - myHttpOperationBinding.Location="/AddNumbers"; - // Add the 'HttpOperationBinding' object to 'OperationBinding'. - myOperationBinding.Extensions.Add(myHttpOperationBinding); -// -// -// -// - // Create an InputBinding. - InputBinding myInputBinding = new InputBinding(); - MimeTextBinding myMimeTextBinding = new MimeTextBinding(); - MimeTextMatchCollection myMimeTextMatchCollection1 = - new MimeTextMatchCollection(); - MimeTextMatch[] myMimeTextMatch = new MimeTextMatch[3]; - myMimeTextMatchCollection1 = myMimeTextBinding.Matches; - - // Intialize the MimeTextMatch. - for( myInt = 0 ; myInt < 3 ; myInt++ ) - { - // Get a new MimeTextMatch. - myMimeTextMatch[ myInt ] = new MimeTextMatch(); - - // Assign values to properties of the MimeTextMatch. - myMimeTextMatch[ myInt ].Name = "Title" + Convert.ToString( myInt ); - myMimeTextMatch[ myInt ].Type = "*/*"; - myMimeTextMatch[ myInt ].Pattern = "TITLE>(.*?)<"; - myMimeTextMatch[ myInt ].IgnoreCase = true; - myMimeTextMatch[ myInt ].Capture = 2; - myMimeTextMatch[ myInt ].Group = 2; - if( myInt != 0 ) - { - // Assign the Repeats property if the index is not 0. - myMimeTextMatch[ myInt ].Repeats = 2; - } - else - { - // Assign the RepeatsString property if the index is 0. - myMimeTextMatch[ myInt ].RepeatsString = "4"; - } - // Add the MimeTextMatch to the collection. - myMimeTextMatchCollection1.Add( myMimeTextMatch[ myInt ] ); - } -// -// -// -// - myInputBinding.Extensions.Add(myMimeTextBinding); - // Add the 'InputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInputBinding; - // Create the 'OutputBinding' instance. - OutputBinding myOutput = new OutputBinding(); - MimeXmlBinding postMimeXmlbinding = new MimeXmlBinding(); - // Initialize 'Part' property of 'MimeXmlBinding' class. - postMimeXmlbinding.Part="Body"; - // Add 'MimeXmlBinding' instance to 'OutputBinding' instance. - myOutput.Extensions.Add( postMimeXmlbinding ); - // Add the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding.Output = myOutput; - // Add the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding.Output = myOutput; - // Add the 'OperationBinding' to 'Binding'. - myBinding.Operations.Add(myOperationBinding); - // Add the 'Binding' to 'BindingCollection' of 'ServiceDescription'. - myServiceDescription.Bindings.Add(myBinding); - // Write the 'ServiceDescription' as a WSDL file. - myServiceDescription.Write("MimeTextMatch_5_Output_CS.wsdl"); - Console.WriteLine("WSDL file with name 'MimeTextMatch_5_Output_CS.wsdl' is" - + " created successfully."); - } - catch(Exception e) - { - Console.WriteLine( "Exception: {0}", e.Message ); - } - } -} -// diff --git a/snippets/csharp/System.Web.Services.Description/MimeTextMatchCollection/Overview/MimeText_Match_MatchCollService.CS.asmx b/snippets/csharp/System.Web.Services.Description/MimeTextMatchCollection/Overview/MimeText_Match_MatchCollService.CS.asmx deleted file mode 100644 index b7451cfe100..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MimeTextMatchCollection/Overview/MimeText_Match_MatchCollService.CS.asmx +++ /dev/null @@ -1,18 +0,0 @@ -<%@WebService Language="c#" Class="MimeText_Match_MatchCollService"%> - -using System; -using System.Collections; -using System.ComponentModel; -using System.Data; -using System.Diagnostics; -using System.Web; -using System.Web.Services; - -public class MimeText_Match_MatchCollService: System.Web.Services.WebService -{ - [WebMethod] - public int AddNumbers(int firstNumber,int secondNumber) - { - return firstNumber+secondNumber; - } -} diff --git a/snippets/csharp/System.Web.Services.Description/MimeTextMatchCollection/Overview/MimeText_Match_MatchColl_9_Input_CS.wsdl b/snippets/csharp/System.Web.Services.Description/MimeTextMatchCollection/Overview/MimeText_Match_MatchColl_9_Input_CS.wsdl deleted file mode 100644 index f547e501386..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MimeTextMatchCollection/Overview/MimeText_Match_MatchColl_9_Input_CS.wsdl +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/MimeTextMatchCollection/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/MimeTextMatchCollection/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MimeTextMatchCollection/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/MimeTextMatchCollection/Overview/mimetext_match_matchcoll_9.cs b/snippets/csharp/System.Web.Services.Description/MimeTextMatchCollection/Overview/mimetext_match_matchcoll_9.cs deleted file mode 100644 index 3c1ee413d57..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MimeTextMatchCollection/Overview/mimetext_match_matchcoll_9.cs +++ /dev/null @@ -1,160 +0,0 @@ -// System.Web.Services.Description.MimeTextMatchCollection -// System.Web.Services.Description.MimeTextMatchCollection() -// System.Web.Services.Description.MimeTextMatchCollection.Contains -// System.Web.Services.Description.MimeTextMatchCollection.Add -// System.Web.Services.Description.MimeTextMatchCollection.CopyTo -// System.Web.Services.Description.MimeTextMatchCollection.Remove -// System.Web.Services.Description.MimeTextMatchCollection.Item -// System.Web.Services.Description.MimeTextMatchCollection.IndexOf -// System.Web.Services.Description.MimeTextMatchCollection.Insert - -/* This program demostrates constructor, Contains, Add, Item, - IndexOf, Insert and Remove property of 'MimeTextMatchCollection'. - This program takes 'MimeText_Match_MatchColl_9_Input_CS.wsdl' as an - input file which does not contain 'Binding' object that supports - 'HttpPost'. A name, type, Group and Capture properties are set - which are to be searched in a HTTP transmission and - 'MimeTextMatchCollection' collection object is created - for input and output of 'HttpPost' and finally writes into - 'MimeText_Match_MatchColl_9_Output_CS.wsdl'. -*/ - -using System; -using System.Web.Services.Description; -using System.Collections; -using System.Xml; - -class MyMimeTextMatchCollection -{ - public static void Main() - { - try - { - int myInt = 0; - ServiceDescription myServiceDescription = ServiceDescription.Read - ("MimeText_Match_MatchColl_9_Input_CS.wsdl"); - // Create the 'Binding' object. - Binding myBinding = new Binding(); - // Initialize 'Name' property of 'Binding' class. - myBinding.Name = "MimeText_Match_MatchCollServiceHttpPost"; - XmlQualifiedName - myXmlQualifiedName = new XmlQualifiedName - ("s0:MimeText_Match_MatchCollServiceHttpPost"); - myBinding.Type = myXmlQualifiedName; - // Create the 'HttpBinding' object. - HttpBinding myHttpBinding = new HttpBinding(); - myHttpBinding.Verb="POST"; - // Add the 'HttpBinding' to the 'Binding'. - myBinding.Extensions.Add(myHttpBinding); - // Create the 'OperationBinding' object. - OperationBinding myOperationBinding = new OperationBinding(); - myOperationBinding.Name = "AddNumbers"; - HttpOperationBinding myHttpOperationBinding = new HttpOperationBinding(); - myHttpOperationBinding.Location="/AddNumbers"; - // Add the 'HttpOperationBinding' to 'OperationBinding'. - myOperationBinding.Extensions.Add(myHttpOperationBinding); -// - // Create the 'InputBinding' object. - InputBinding myInputBinding = new InputBinding(); - MimeTextBinding myMimeTextBinding = new MimeTextBinding(); - MimeTextMatchCollection myMimeTextMatchCollection; -// -// -// - // Get an array instance of 'MimeTextMatch' class. - MimeTextMatch[] myMimeTextMatch = new MimeTextMatch[4]; - myMimeTextMatchCollection = myMimeTextBinding.Matches; - // Initialize properties of 'MimeTextMatch' class. - for( myInt = 0 ; myInt < 4 ; myInt++ ) - { - // Create the 'MimeTextMatch' instance. - myMimeTextMatch[ myInt ] = new MimeTextMatch(); - myMimeTextMatch[ myInt ].Name = "Title"; - myMimeTextMatch[ myInt ].Type = "*/*"; - myMimeTextMatch[ myInt ].IgnoreCase = true; - - if( true == myMimeTextMatchCollection.Contains( myMimeTextMatch[ 0 ] ) ) - { - myMimeTextMatch[ myInt ].Name = "Title" + Convert.ToString( myInt ); - myMimeTextMatch[ myInt ].Capture = 2; - myMimeTextMatch[ myInt ].Group = 2; - myMimeTextMatchCollection.Add( myMimeTextMatch[ myInt ] ); - } - else - { - myMimeTextMatchCollection.Add( myMimeTextMatch[ myInt ] ); - myMimeTextMatchCollection[ myInt ].RepeatsString = "2"; - } - } - myMimeTextMatchCollection = myMimeTextBinding.Matches; - // Copy collection to 'MimeTextMatch' array instance. - myMimeTextMatchCollection.CopyTo( myMimeTextMatch, 0 ); -// -// -// - myInputBinding.Extensions.Add(myMimeTextBinding); - // Add the 'InputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInputBinding; - - // Create the 'OutputBinding' instance. - OutputBinding myOutputBinding = new OutputBinding(); - // Create the 'MimeTextBinding' instance. - MimeTextBinding myMimeTextBinding1 = new MimeTextBinding(); -// -// -// -// -// - // Get an instance of 'MimeTextMatchCollection'. - MimeTextMatchCollection myMimeTextMatchCollection1 = new MimeTextMatchCollection(); - MimeTextMatch[] myMimeTextMatch1 = new MimeTextMatch[5]; - myMimeTextMatchCollection1 = myMimeTextBinding1.Matches; - for( myInt = 0 ; myInt < 4 ; myInt++ ) - { - myMimeTextMatch1[ myInt ] = new MimeTextMatch(); - myMimeTextMatch1[ myInt ].Name = "Title" + Convert.ToString( myInt ); - if( myInt != 0 ) - { - myMimeTextMatch1[ myInt ].RepeatsString = "7"; - } - myMimeTextMatchCollection1.Add( myMimeTextMatch1[ myInt ] ); - } - myMimeTextMatch1[4] = new MimeTextMatch(); - // Remove 'MimeTextMatch' instance from collection. - myMimeTextMatchCollection1.Remove( myMimeTextMatch1[ 1 ] ); - // Using MimeTextMatchCollection.Item indexer to comapre. - if( myMimeTextMatch1[ 2 ] == myMimeTextMatchCollection1[ 1 ] ) - { - // Check whether 'MimeTextMatch' instance exists. - myInt = myMimeTextMatchCollection1.IndexOf( myMimeTextMatch1[ 2 ] ); - // Insert 'MimeTextMatch' instance at a desired position. - myMimeTextMatchCollection1.Insert( 1, myMimeTextMatch1[ myInt ] ); - myMimeTextMatchCollection1[ 1 ].RepeatsString = "5"; - myMimeTextMatchCollection1.Insert( 4, myMimeTextMatch1[ myInt ] ); - } -// -// -// -// -// -// - myOutputBinding.Extensions.Add( myMimeTextBinding1 ); - // Add the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding.Output = myOutputBinding; - // Add the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding.Output = myOutputBinding; - // Add the 'OperationBinding' to 'Binding'. - myBinding.Operations.Add(myOperationBinding); - // Add the 'Binding' to 'BindingCollection' of 'ServiceDescription'. - myServiceDescription.Bindings.Add(myBinding); - // Write the 'ServiceDescription' as a WSDL file. - myServiceDescription.Write("MimeText_Match_MatchColl_9_Output_CS.wsdl"); - Console.WriteLine("WSDL file with name 'MimeText_Match_MatchColl_9_Output_CS.wsdl' is" - + " created successfully."); - } - catch(Exception e) - { - Console.WriteLine( "Exception: {0}", e.Message ); - } - } -} diff --git a/snippets/csharp/System.Web.Services.Description/MimeXmlBinding/Overview/MimeXmlBinding_Part_3_Input_CS.wsdl b/snippets/csharp/System.Web.Services.Description/MimeXmlBinding/Overview/MimeXmlBinding_Part_3_Input_CS.wsdl deleted file mode 100644 index 6f44c8aff5f..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MimeXmlBinding/Overview/MimeXmlBinding_Part_3_Input_CS.wsdl +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/MimeXmlBinding/Overview/MimeXmlBinding_Part_3_Service.CS.asmx b/snippets/csharp/System.Web.Services.Description/MimeXmlBinding/Overview/MimeXmlBinding_Part_3_Service.CS.asmx deleted file mode 100644 index a2cc3765d67..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MimeXmlBinding/Overview/MimeXmlBinding_Part_3_Service.CS.asmx +++ /dev/null @@ -1,18 +0,0 @@ -<%@WebService Language="c#" Class="MimeXmlBinding_Part_3_Service"%> - -using System; -using System.Collections; -using System.ComponentModel; -using System.Data; -using System.Diagnostics; -using System.Web; -using System.Web.Services; - -public class MimeXmlBinding_Part_3_Service: System.Web.Services.WebService -{ - [WebMethod] - public int AddNumbers(int firstNumber,int secondNumber) - { - return firstNumber+secondNumber; - } -} diff --git a/snippets/csharp/System.Web.Services.Description/MimeXmlBinding/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/MimeXmlBinding/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MimeXmlBinding/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/MimeXmlBinding/Overview/makefile_MimeXmlBinding_Part_3_cs.dat b/snippets/csharp/System.Web.Services.Description/MimeXmlBinding/Overview/makefile_MimeXmlBinding_Part_3_cs.dat deleted file mode 100644 index 0e5454271a7..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MimeXmlBinding/Overview/makefile_MimeXmlBinding_Part_3_cs.dat +++ /dev/null @@ -1,18 +0,0 @@ -cc = csc -vb = vbc -IISRoot = C:\InetPub\wwwroot - - -makefile: MimeXmlBinding_Part_3_Output_cs.wsdl -MimeXmlBinding_Part_3_Output_cs.wsdl:MimeXmlBinding_Part_3.exe -MimeXmlBinding_Part_3.exe: MimeXmlBinding_Part_3.cs - $(cc) MimeXmlBinding_Part_3.cs - MimeXmlBinding_Part_3.exe - wsdl MimeXmlBinding_Part_3_Output_cs.wsdl - $(cc) /t:library MimeXmlBinding_Part_3_Service.cs - if not exist $(IISRoot)\MimeXmlClass md $(IISRoot)\MimeXmlClass - if not exist $(IISRoot)\bin mkdir $(IISRoot)\bin - copy MimeXmlBinding_Part_3_Service.cs.asmx $(IISRoot)\MimeXmlClass - copy MimeXmlBinding_Part_3_Client.cs.aspx $(IISRoot)\MimeXmlClass - move MimeXmlBinding_Part_3_Service.dll $(IISRoot)\bin - echo Invoke aspx file at http://localhost/MimeXmlClass/MimeXmlBinding_Part_3_Client.cs.aspx diff --git a/snippets/csharp/System.Web.Services.Description/MimeXmlBinding/Overview/mimexmlbinding_part_3.cs b/snippets/csharp/System.Web.Services.Description/MimeXmlBinding/Overview/mimexmlbinding_part_3.cs deleted file mode 100644 index 56f874e6e0f..00000000000 --- a/snippets/csharp/System.Web.Services.Description/MimeXmlBinding/Overview/mimexmlbinding_part_3.cs +++ /dev/null @@ -1,82 +0,0 @@ -// System.Web.Services.Description.MimeXmlBinding -// System.Web.Services.Description.MimeXmlBinding.MimeXmlBinding() -// System.Web.Services.Description.MimeXmlBinding.Part - -/* The following program demonstrates constructor and 'Part'property - of 'MimeXmlBinding' class. This program takes 'MimeXmlBinding_Part_3_Input_CS.wsdl' - as input, which does not contain 'Binding' object that supports 'HttpPost'. - It sets message part property to 'Body' on which 'MimeXmlBinding' is - applied and finally writes into 'MimeXmlBinding_Part_3_Output_CS.wsdl'. -*/ - -// -using System; -using System.Web.Services.Description; -using System.Collections; -using System.Xml; - -class MyXmlBinding -{ - public static void Main() - { - try - { - ServiceDescription myDescription = - ServiceDescription.Read("MimeXmlBinding_Part_3_Input_CS.wsdl"); - // Create the 'Binding' object. - Binding myBinding = new Binding(); - // Initialize 'Name' property of 'Binding' class. - myBinding.Name = "MimeXmlBinding_Part_3_ServiceHttpPost"; - XmlQualifiedName - myXmlQualifiedName = new XmlQualifiedName("s0:MimeXmlBinding_Part_3_ServiceHttpPost"); - myBinding.Type = myXmlQualifiedName; - // Create the 'HttpBinding' object. - HttpBinding myHttpBinding = new HttpBinding(); - myHttpBinding.Verb="POST"; - // Add the 'HttpBinding' to the 'Binding'. - myBinding.Extensions.Add(myHttpBinding); - // Create the 'OperationBinding' object. - OperationBinding myOperationBinding = new OperationBinding(); - myOperationBinding.Name = "AddNumbers"; - HttpOperationBinding myHttpOperationBinding = new HttpOperationBinding(); - myHttpOperationBinding.Location="/AddNumbers"; - // Add the 'HttpOperationBinding' to 'OperationBinding'. - myOperationBinding.Extensions.Add(myHttpOperationBinding); - // Create the 'InputBinding' object. - InputBinding myInputBinding = new InputBinding(); - MimeContentBinding myMimeContentBinding = new MimeContentBinding(); - myMimeContentBinding.Type="application/x-www-form-urlencoded"; - myInputBinding.Extensions.Add(myMimeContentBinding); - // Add the 'InputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInputBinding; -// -// - // Create an OutputBinding. - OutputBinding myOutputBinding = new OutputBinding(); - MimeXmlBinding myMimeXmlBinding = new MimeXmlBinding(); - - // Initialize the Part property of the MimeXmlBinding. - myMimeXmlBinding.Part="Body"; - - // Add the MimeXmlBinding to the OutputBinding. - myOutputBinding.Extensions.Add(myMimeXmlBinding); -// -// - // Add the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding.Output = myOutputBinding; - // Add the 'OperationBinding' to 'Binding'. - myBinding.Operations.Add(myOperationBinding); - // Add the 'Binding' to 'BindingCollection' of 'ServiceDescription'. - myDescription.Bindings.Add(myBinding); - // Write the 'ServiceDescription' as a WSDL file. - myDescription.Write("MimeXmlBinding_Part_3_Output_CS.wsdl"); - Console.WriteLine("WSDL file with name 'MimeXmlBinding_Part_3_Output_CS.wsdl' is" - + " created successfully."); - } - catch(Exception e) - { - Console.WriteLine( "Exception: {0}", e.Message ); - } - } -} -// diff --git a/snippets/csharp/System.Web.Services.Description/Operation/Faults/Operation_Faults_Input_CS.wsdl b/snippets/csharp/System.Web.Services.Description/Operation/Faults/Operation_Faults_Input_CS.wsdl deleted file mode 100644 index 6cef360e898..00000000000 --- a/snippets/csharp/System.Web.Services.Description/Operation/Faults/Operation_Faults_Input_CS.wsdl +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/Operation/Faults/Project.csproj b/snippets/csharp/System.Web.Services.Description/Operation/Faults/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/Operation/Faults/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/Operation/Faults/operation_faults.cs b/snippets/csharp/System.Web.Services.Description/Operation/Faults/operation_faults.cs deleted file mode 100644 index 7db4e3ca370..00000000000 --- a/snippets/csharp/System.Web.Services.Description/Operation/Faults/operation_faults.cs +++ /dev/null @@ -1,46 +0,0 @@ -// System.Web.Services.Description.Operation.Faults - -/* The following program demonstrates the 'Faults' property of 'Operation' - class. It reads from a 'Operation_Faults_Input_CS.wsdl' file removes fault - binding and operation fault with the name 'ErrorString'. The modified - ServiceDescriptor is written to 'Operation_Faults_Output_CS.wsdl' file. -*/ - -using System; -using System.Web.Services.Description; - -public class MyOperationClass -{ - public static void Main() - { -// - // Read the 'Operation_Faults_Input_CS.wsdl' file as input. - ServiceDescription myServiceDescription = - ServiceDescription.Read("Operation_Faults_Input_CS.wsdl"); - - // Get the operation fault collection. - PortTypeCollection myPortTypeCollection = myServiceDescription.PortTypes; - PortType myPortType = myPortTypeCollection[0]; - OperationCollection myOperationCollection = myPortType.Operations; - - // Remove the operation fault with the name 'ErrorString'. - Operation myOperation = myOperationCollection[0]; - OperationFaultCollection myOperationFaultCollection = myOperation.Faults; - if(myOperationFaultCollection.Contains(myOperationFaultCollection["ErrorString"])) - myOperationFaultCollection.Remove(myOperationFaultCollection["ErrorString"]); -// - - // Get the fault binding collection. - BindingCollection myBindingCollection = myServiceDescription.Bindings; - Binding myBinding = myBindingCollection[0]; - OperationBindingCollection myOperationBindingCollection = myBinding.Operations; - // Remove the fault binding with the name 'ErrorString'. - OperationBinding myOperationBinding = myOperationBindingCollection[0]; - FaultBindingCollection myFaultBindingCollection = myOperationBinding.Faults; - if(myFaultBindingCollection.Contains(myFaultBindingCollection["ErrorString"])) - myFaultBindingCollection.Remove(myFaultBindingCollection["ErrorString"]); - - myServiceDescription.Write("Operation_Faults_Output_CS.wsdl"); - Console.WriteLine("WSDL file with name 'Operation_Faults_Output_CS.wsdl' file created Successfully"); - } -} \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/Operation/IsBoundBy/Operation_IsBoundBy_Input_CS.wsdl b/snippets/csharp/System.Web.Services.Description/Operation/IsBoundBy/Operation_IsBoundBy_Input_CS.wsdl deleted file mode 100644 index 27c26fed54c..00000000000 --- a/snippets/csharp/System.Web.Services.Description/Operation/IsBoundBy/Operation_IsBoundBy_Input_CS.wsdl +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/Operation/IsBoundBy/Operation_IsBoundBy_Service.cs.asmx b/snippets/csharp/System.Web.Services.Description/Operation/IsBoundBy/Operation_IsBoundBy_Service.cs.asmx deleted file mode 100644 index a5ba6e95137..00000000000 --- a/snippets/csharp/System.Web.Services.Description/Operation/IsBoundBy/Operation_IsBoundBy_Service.cs.asmx +++ /dev/null @@ -1,20 +0,0 @@ -<%@WebService Language="c#" Class="MyOperationIsBoundByService"%> - -using System; -using System.Collections; -using System.ComponentModel; -using System.Data; -using System.Diagnostics; -using System.Web; -using System.Web.Services; - -public class MyOperationIsBoundByService: System.Web.Services.WebService -{ - - - [WebMethod] - public int AddNumbers(int firstNumber,int secondNumber) - { - return firstNumber+secondNumber; - } -} diff --git a/snippets/csharp/System.Web.Services.Description/Operation/IsBoundBy/Project.csproj b/snippets/csharp/System.Web.Services.Description/Operation/IsBoundBy/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/Operation/IsBoundBy/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/Operation/IsBoundBy/operation_isboundby.cs b/snippets/csharp/System.Web.Services.Description/Operation/IsBoundBy/operation_isboundby.cs deleted file mode 100644 index 628088682c9..00000000000 --- a/snippets/csharp/System.Web.Services.Description/Operation/IsBoundBy/operation_isboundby.cs +++ /dev/null @@ -1,88 +0,0 @@ -// System.Web.Services.Description.Operation.IsBoundBy - -/* The following program demonstrates the 'IsBoundBy' method of - 'Operation' class. It takes "Operation_IsBoundBy_Input_CS.wsdl" - as input which does not contain 'PortType' and 'Binding' objects - supporting 'HttpPost'. It then adds those objects and writes into - 'Operation_IsBoundBy_Output_CS.wsdl'. -*/ - -using System; -using System.Web.Services.Description; -using System.Collections; -using System.Xml; - -class MyOperationClass -{ - public static void Main() - { - ServiceDescription myServiceDescription = ServiceDescription.Read("Operation_IsBoundBy_Input_CS.wsdl"); - // Create the 'Binding' object. - Binding myBinding = new Binding(); - myBinding.Name = "MyOperationIsBoundByServiceHttpPost"; - XmlQualifiedName myXmlQualifiedName = new XmlQualifiedName("s0:OperationServiceHttpPost"); - myBinding.Type = myXmlQualifiedName; - // Create the 'HttpBinding' object. - HttpBinding myHttpBinding = new HttpBinding(); - myHttpBinding.Verb="POST"; - // Add the 'HttpBinding' to the 'Binding'. - myBinding.Extensions.Add(myHttpBinding); - // Create the 'OperationBinding' object. - OperationBinding myOperationBinding = new OperationBinding(); - myOperationBinding.Name = "AddNumbers"; - - HttpOperationBinding myHttpOperationBinding = new HttpOperationBinding(); - myHttpOperationBinding.Location="/AddNumbers"; - // Add the 'HttpOperationBinding' to 'OperationBinding'. - myOperationBinding.Extensions.Add(myHttpOperationBinding); - - // Create the 'InputBinding' object. - InputBinding myInputBinding = new InputBinding(); - MimeContentBinding myPostMimeContentBinding = new MimeContentBinding(); - myPostMimeContentBinding.Type="application/x-www-form-urlencoded"; - myInputBinding.Extensions.Add(myPostMimeContentBinding); - // Add the 'InputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInputBinding; - // Create the 'OutputBinding' object. - OutputBinding myOutputBinding = new OutputBinding(); - MimeXmlBinding myPostMimeXmlBinding = new MimeXmlBinding(); - myPostMimeXmlBinding .Part="Body"; - myOutputBinding.Extensions.Add(myPostMimeXmlBinding); - - // Add the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding.Output = myOutputBinding; - - // Add the 'OperationBinding' to 'Binding'. - myBinding.Operations.Add(myOperationBinding); - - // Add the 'Binding' to 'BindingCollection' of 'ServiceDescription'. - myServiceDescription.Bindings.Add(myBinding); - - // Create a 'PortType' object. - PortType myPostPortType = new PortType(); - myPostPortType.Name = "OperationServiceHttpPost"; -// - Operation myPostOperation = new Operation(); - myPostOperation.Name = myOperationBinding.Name; - Console.WriteLine("'Operation' instance uses 'OperationBinding': " - +myPostOperation.IsBoundBy(myOperationBinding)); -// - OperationMessage myOperationMessage = (OperationMessage)new OperationInput(); - myOperationMessage.Message = new XmlQualifiedName("s0:AddNumbersHttpPostIn"); - OperationMessage myOperationMessage1 = (OperationMessage)new OperationOutput(); - myOperationMessage1.Message = new XmlQualifiedName("s0:AddNumbersHttpPostOut"); - - myPostOperation.Messages.Add(myOperationMessage); - myPostOperation.Messages.Add(myOperationMessage1); - - // Add the 'Operation' to 'PortType'. - myPostPortType.Operations.Add(myPostOperation); - - // Adds the 'PortType' to 'PortTypeCollection' of 'ServiceDescription'. - myServiceDescription.PortTypes.Add(myPostPortType); - - // Write the 'ServiceDescription' as a WSDL file. - myServiceDescription.Write("Operation_IsBoundBy_Output_CS.wsdl"); - Console.WriteLine("WSDL file with name 'Operation_IsBoundBy_Output_CS.wsdl' created Successfully"); - } -} \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/Operation/Overview/Operation_5_Input_CS.wsdl b/snippets/csharp/System.Web.Services.Description/Operation/Overview/Operation_5_Input_CS.wsdl deleted file mode 100644 index 7e301828350..00000000000 --- a/snippets/csharp/System.Web.Services.Description/Operation/Overview/Operation_5_Input_CS.wsdl +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/Operation/Overview/Operation_5_Service.cs.asmx b/snippets/csharp/System.Web.Services.Description/Operation/Overview/Operation_5_Service.cs.asmx deleted file mode 100644 index 2cc604ad64f..00000000000 --- a/snippets/csharp/System.Web.Services.Description/Operation/Overview/Operation_5_Service.cs.asmx +++ /dev/null @@ -1,18 +0,0 @@ -<%@WebService Language="c#" Class="OperationService"%> - -using System; -using System.Collections; -using System.ComponentModel; -using System.Data; -using System.Diagnostics; -using System.Web; -using System.Web.Services; - -public class OperationService: System.Web.Services.WebService -{ - [WebMethod] - public int AddNumbers(int firstNumber,int secondNumber) - { - return firstNumber+secondNumber; - } -} diff --git a/snippets/csharp/System.Web.Services.Description/Operation/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/Operation/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/Operation/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/Operation/Overview/operation_5.cs b/snippets/csharp/System.Web.Services.Description/Operation/Overview/operation_5.cs deleted file mode 100644 index 8b361e047ab..00000000000 --- a/snippets/csharp/System.Web.Services.Description/Operation/Overview/operation_5.cs +++ /dev/null @@ -1,67 +0,0 @@ -// System.Web.Services.Description.Operation -// System.Web.Services.Description.Operation.Operation -// System.Web.Services.Description.Operation.Messages -// System.Web.Services.Description.Operation.Name -// System.Web.Services.Description.Operation.PortType - -/* The following program demonstrates 'Operation' class, its contructor - and 'Messages','Name' and 'PortType' properties. It reads the file - 'Operation_5_Input_CS.wsdl' which does not have 'PortType' object that - supports 'HttpPost'. It adds a 'PortType' object that supports 'HttpPost' - protocol and writes into 'Operation_5_Output_CS.wsdl'. -*/ - -// -using System; -using System.Web.Services.Description; -using System.Collections; -using System.Xml; - -class MyOperationClass -{ - public static void Main() - { - ServiceDescription myDescription = ServiceDescription.Read("Operation_5_Input_CS.wsdl"); - // Create a 'PortType' object. - PortType myPortType = new PortType(); - myPortType.Name = "OperationServiceHttpPost"; - Operation myOperation = CreateOperation - ("AddNumbers","s0:AddNumbersHttpPostIn","s0:AddNumbersHttpPostOut"); - myPortType.Operations.Add(myOperation); -// - // Get the PortType of the Operation. - PortType myPort = myOperation.PortType; - Console.WriteLine( - "The port type of the operation is: " + myPort.Name); -// - // Add the 'PortType's to 'PortTypeCollection' of 'ServiceDescription'. - myDescription.PortTypes.Add(myPortType); - - // Write the 'ServiceDescription' as a WSDL file. - myDescription.Write("Operation_5_Output_CS.wsdl"); - Console.WriteLine("WSDL file with name 'Operation_5_Output_CS.wsdl' file created Successfully"); - } - public static Operation CreateOperation(string myOperationName,string myInputMesg,string myOutputMesg) - { -// -// -// - // Create an Operation. - Operation myOperation = new Operation(); - myOperation.Name = myOperationName; - OperationMessage myInput = (OperationMessage)new OperationInput(); - myInput.Message = new XmlQualifiedName(myInputMesg); - OperationMessage myOutput = (OperationMessage)new OperationOutput(); - myOutput.Message = new XmlQualifiedName(myOutputMesg); - - // Add messages to the OperationMessageCollection. - myOperation.Messages.Add(myInput); - myOperation.Messages.Add(myOutput); - Console.WriteLine("Operation name is: " + myOperation.Name); -// -// -// - return myOperation; - } -} -// diff --git a/snippets/csharp/System.Web.Services.Description/Operation/ParameterOrder/Operation_2_Input_CS.wsdl b/snippets/csharp/System.Web.Services.Description/Operation/ParameterOrder/Operation_2_Input_CS.wsdl deleted file mode 100644 index 72b905a5e77..00000000000 --- a/snippets/csharp/System.Web.Services.Description/Operation/ParameterOrder/Operation_2_Input_CS.wsdl +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/Operation/ParameterOrder/Operation_2_Service.cs.asmx b/snippets/csharp/System.Web.Services.Description/Operation/ParameterOrder/Operation_2_Service.cs.asmx deleted file mode 100644 index 833df65cd36..00000000000 --- a/snippets/csharp/System.Web.Services.Description/Operation/ParameterOrder/Operation_2_Service.cs.asmx +++ /dev/null @@ -1,16 +0,0 @@ -<%@ WebService Language="C#" Class="Operation_2_Service" %> -using System; -using System.Collections; -using System.ComponentModel; -using System.Data; -using System.Diagnostics; -using System.Web; -using System.Web.Services; - public class Operation_2_Service: System.Web.Services.WebService - { - [WebMethod] - public int AddNumbers(int firstNumber,int secondNumber) - { - return firstNumber+secondNumber; - } - } \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/Operation/ParameterOrder/Project.csproj b/snippets/csharp/System.Web.Services.Description/Operation/ParameterOrder/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/Operation/ParameterOrder/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/Operation/ParameterOrder/operation_2.cs b/snippets/csharp/System.Web.Services.Description/Operation/ParameterOrder/operation_2.cs deleted file mode 100644 index 850a10dd3e3..00000000000 --- a/snippets/csharp/System.Web.Services.Description/Operation/ParameterOrder/operation_2.cs +++ /dev/null @@ -1,144 +0,0 @@ -// System.Web.Services.Description Operation.ParameterOrderString -// System.Web.Services.Description Operation.ParameterOrder - -/* The following program demonstrates the 'ParameterOrderString' and - 'ParameterOrder' properties of 'Operation' class. It collects the - message part names from the input WSDL file and sets to the - 'ParameterOrderString'. It then displays the same using 'ParameterOrder' - property. -*/ - -using System; -using System.Web.Services.Description; -using System.Collections; -using System.Xml; - -class MyOperationClass -{ - public static void Main() - { - try - { - ServiceDescription myDescription = - ServiceDescription.Read("Operation_2_Input_CS.wsdl"); - Binding myBinding = new Binding(); - myBinding.Name = "Operation_2_ServiceHttpPost"; - XmlQualifiedName myQualifiedName = - new XmlQualifiedName("s0:Operation_2_ServiceHttpPost"); - myBinding.Type = myQualifiedName; - HttpBinding myHttpBinding = new HttpBinding(); - myHttpBinding.Verb="POST"; - // Add the 'HttpBinding' to the 'Binding'. - myBinding.Extensions.Add(myHttpBinding); - OperationBinding myOperationBinding = new OperationBinding(); - myOperationBinding.Name = "AddNumbers"; - HttpOperationBinding myHttpOperationBinding = new HttpOperationBinding(); - myHttpOperationBinding.Location="/AddNumbers"; - // Add the 'HttpOperationBinding' to 'OperationBinding'. - myOperationBinding.Extensions.Add(myHttpOperationBinding); - InputBinding myInputBinding = new InputBinding(); - MimeContentBinding myPostMimeContentbinding = new MimeContentBinding(); - myPostMimeContentbinding.Type="application/x-www-form-urlencoded"; - myInputBinding.Extensions.Add(myPostMimeContentbinding); - // Add the 'InputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInputBinding; - OutputBinding myOutputBinding = new OutputBinding(); - MimeXmlBinding myPostMimeXmlbinding = new MimeXmlBinding(); - myPostMimeXmlbinding .Part="Body"; - myOutputBinding.Extensions.Add(myPostMimeXmlbinding); - // Add the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding.Output = myOutputBinding; - // Add the 'OperationBinding' to 'Binding'. - myBinding.Operations.Add(myOperationBinding); - // Add the 'Binding' to 'BindingCollection' of 'ServiceDescription'. - myDescription.Bindings.Add(myBinding); - Port myPostPort = new Port(); - myPostPort.Name = "Operation_2_ServiceHttpPost"; - myPostPort.Binding = new XmlQualifiedName("s0:Operation_2_ServiceHttpPost"); - HttpAddressBinding myPostAddressBinding = new HttpAddressBinding(); - myPostAddressBinding.Location = - "http://localhost/Operation_2/Operation_2_Service.cs.asmx"; - // Add the 'HttpAddressBinding' to the 'Port'. - myPostPort.Extensions.Add(myPostAddressBinding); - // Add the 'Port' to 'PortCollection' of 'ServiceDescription'. - myDescription.Services[0].Ports.Add(myPostPort); - PortType myPostPortType = new PortType(); - myPostPortType.Name = "Operation_2_ServiceHttpPost"; - Operation myPostOperation = new Operation(); - myPostOperation.Name = "AddNumbers"; - OperationMessage myPostOperationInput = (OperationMessage)new OperationInput(); - myPostOperationInput.Message = new XmlQualifiedName("s0:AddNumbersHttpPostIn"); - OperationMessage myPostOperationOutput = (OperationMessage)new OperationOutput(); - myPostOperationOutput.Message = new XmlQualifiedName("s0:AddNumbersHttpPostout"); - myPostOperation.Messages.Add(myPostOperationInput); - myPostOperation.Messages.Add(myPostOperationOutput); - // Add the 'Operation' to 'PortType'. - myPostPortType.Operations.Add(myPostOperation); - // Adds the 'PortType' to 'PortTypeCollection' of 'ServiceDescription'. - myDescription.PortTypes.Add(myPostPortType); - Message myPostMessage1 = new Message(); - myPostMessage1.Name="AddNumbersHttpPostIn"; - MessagePart myPostMessagePart1 = new MessagePart(); - myPostMessagePart1.Name = "firstnumber"; - myPostMessagePart1.Type = new XmlQualifiedName("s:string"); - MessagePart myPostMessagePart2 = new MessagePart(); - myPostMessagePart2.Name = "secondnumber"; - myPostMessagePart2.Type = new XmlQualifiedName("s:string"); - // Add the 'MessagePart' objects to 'Messages'. - myPostMessage1.Parts.Add(myPostMessagePart1); - myPostMessage1.Parts.Add(myPostMessagePart2); - Message myPostMessage2 = new Message(); - myPostMessage2.Name = "AddNumbersHttpPostout"; - MessagePart myPostMessagePart3 = new MessagePart(); - myPostMessagePart3.Name = "Body"; - myPostMessagePart3.Element = new XmlQualifiedName("s0:int"); - // Add the 'MessagePart' to 'Message'. - myPostMessage2.Parts.Add(myPostMessagePart3 ); - // Add the 'Message' objects to 'ServiceDescription'. - myDescription.Messages.Add(myPostMessage1); - myDescription.Messages.Add(myPostMessage2); - // Write the 'ServiceDescription' as a WSDL file. - myDescription.Write("Operation_2_Output_CS.wsdl"); - Console.WriteLine(" 'Operation_2_Output_CS.wsdl' file created Successfully"); -// -// - string myString = null ; - Operation myOperation = new Operation(); - myDescription = ServiceDescription.Read("Operation_2_Input_CS.wsdl"); - Message[] myMessage = new Message[ myDescription.Messages.Count ] ; - - // Copy the messages from the service description. - myDescription.Messages.CopyTo( myMessage, 0 ); - for( int i = 0 ; i < myDescription.Messages.Count; i++ ) - { - MessagePart[] myMessagePart = - new MessagePart[ myMessage[i].Parts.Count ]; - - // Copy the message parts into a MessagePart. - myMessage[i].Parts.CopyTo( myMessagePart, 0 ); - for( int j = 0 ; j < myMessage[i].Parts.Count; j++ ) - { - myString += myMessagePart[j].Name; - myString += " " ; - } - } - // Set the ParameterOrderString equal to the list of - // message part names. - myOperation.ParameterOrderString = myString; - string[] myString1 = myOperation.ParameterOrder; - int k = 0 ; - Console.WriteLine("The list of message part names is as follows:"); - while( k<5 ) - { - Console.WriteLine( myString1[k] ); - k++; - } -// -// - } - catch( Exception e ) - { - Console.WriteLine( "The following Exception is raised : " + e.Message ); - } - } -} diff --git a/snippets/csharp/System.Web.Services.Description/OperationBinding/Overview/MathService_cs.asmx b/snippets/csharp/System.Web.Services.Description/OperationBinding/Overview/MathService_cs.asmx deleted file mode 100644 index 1e882c1d6b9..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationBinding/Overview/MathService_cs.asmx +++ /dev/null @@ -1,33 +0,0 @@ -<%@ WebService Language="C#" Class="MathService" %> - -using System; -using System.Web.Services; - -public class MathService : WebService { - - [WebMethod] - public float Add(float a, float b) - { - return a + b; - } - - [WebMethod] - public float Subtract(float a, float b) - { - return a - b; - } - - [WebMethod] - public float Multiply(float a, float b) - { - return a * b; - } - - [WebMethod] - public float Divide(float a, float b) - { - if (b==0) return -1; - return a / b; - } - -} \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/OperationBinding/Overview/MathService_input_cs.wsdl b/snippets/csharp/System.Web.Services.Description/OperationBinding/Overview/MathService_input_cs.wsdl deleted file mode 100644 index 778e4c80455..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationBinding/Overview/MathService_input_cs.wsdl +++ /dev/null @@ -1,312 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/OperationBinding/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/OperationBinding/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationBinding/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/OperationBinding/Overview/operationbinding_operationbinding.cs b/snippets/csharp/System.Web.Services.Description/OperationBinding/Overview/operationbinding_operationbinding.cs deleted file mode 100644 index c2ef3ddccdb..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationBinding/Overview/operationbinding_operationbinding.cs +++ /dev/null @@ -1,132 +0,0 @@ -// System.Web.Services.Description.OperationBinding -// System.Web.Services.Description.OperationBinding.OperationBinding -// System.Web.Services.Description.OperationBinding.Name -// System.Web.Services.Description.OperationBinding.Input -// System.Web.Services.Description.OperationBinding.Output -// System.Web.Services.Description.OperationBinding.Extensions -// System.Web.Services.Description.OperationBinding.Faults -// System.Web.Services.Description.OperationBinding.Binding - -/* - The following example demonstrates the usage of the 'OperationBinding' - class, the 'OperationBinding()' constructor, and various properties of the class. The - input to the program is a WSDL file 'MathService_input_cs.wsdl' without the - add operation binding for SOAP protocol. In the example, the WSDL file is modified to insert - a new 'OperationBinding' instance for SOAP. The 'OperationBinding' instance - is populated based on the WSDL document structure defined in the WSDL specification. The updated - instance is then written to 'MathService_new_cs.wsdl'. -*/ - -// -using System; -using System.Web.Services.Description; - -class MyOperationBindingSample -{ - static void Main() - { - try - { - ServiceDescription myServiceDescription = - ServiceDescription.Read("MathService_input_cs.wsdl"); - string myTargetNamespace = myServiceDescription.TargetNamespace; - -// -// - // Create an OperationBinding for the Add operation. - OperationBinding addOperationBinding = new OperationBinding(); - string addOperation = "Add"; - addOperationBinding.Name = addOperation; -// - -// - // Create an InputBinding for the Add operation. - InputBinding myInputBinding = new InputBinding(); - SoapBodyBinding mySoapBodyBinding = new SoapBodyBinding(); - mySoapBodyBinding.Use = SoapBindingUse.Literal; - myInputBinding.Extensions.Add(mySoapBodyBinding); - - // Add the InputBinding to the OperationBinding. - addOperationBinding.Input = myInputBinding; -// - -// - // Create an OutputBinding for the Add operation. - OutputBinding myOutputBinding = new OutputBinding(); - myOutputBinding.Extensions.Add(mySoapBodyBinding); - - // Add the OutputBinding to the OperationBinding. - addOperationBinding.Output = myOutputBinding; -// - -// - // Create an extensibility element for a SoapOperationBinding. - SoapOperationBinding mySoapOperationBinding = - new SoapOperationBinding(); - mySoapOperationBinding.Style = SoapBindingStyle.Document; - mySoapOperationBinding.SoapAction = myTargetNamespace + addOperation; - - // Add the extensibility element SoapOperationBinding to - // the OperationBinding. - addOperationBinding.Extensions.Add(mySoapOperationBinding); -// -// - -// - ServiceDescriptionFormatExtensionCollection myExtensions; - - // Get the FaultBindingCollection from the OperationBinding. - FaultBindingCollection myFaultBindingCollection = - addOperationBinding.Faults; - FaultBinding myFaultBinding = new FaultBinding(); - myFaultBinding.Name = "ErrorFloat"; - - // Associate SOAP fault binding to the fault binding of the operation. - myExtensions = myFaultBinding.Extensions; - SoapFaultBinding mySoapFaultBinding = new SoapFaultBinding(); - mySoapFaultBinding.Use = SoapBindingUse.Literal; - mySoapFaultBinding.Namespace = myTargetNamespace; - myExtensions.Add(mySoapFaultBinding); - myFaultBindingCollection.Add(myFaultBinding); -// - - // Get the BindingCollection from the ServiceDescription. - BindingCollection myBindingCollection = - myServiceDescription.Bindings; - - // Get the OperationBindingCollection of SOAP binding - // from the BindingCollection. - OperationBindingCollection myOperationBindingCollection = - myBindingCollection[0].Operations; - myOperationBindingCollection.Add(addOperationBinding); - - Console.WriteLine( - "The operations supported by this service are:"); - foreach(OperationBinding myOperationBinding in - myOperationBindingCollection) - { -// - Binding myBinding = myOperationBinding.Binding; - Console.WriteLine(" Binding : " + myBinding.Name + - " :: Name of operation : " + myOperationBinding.Name); -// - FaultBindingCollection myFaultBindingCollection1 = - myOperationBinding.Faults; - foreach(FaultBinding myFaultBinding1 in - myFaultBindingCollection1) - { - Console.WriteLine(" Fault : " + myFaultBinding1.Name); - } - } - // Save the ServiceDescription to an external file. - myServiceDescription.Write("MathService_new_cs.wsdl"); - } - catch(Exception e) - { - Console.WriteLine("Exception caught!!!"); - Console.WriteLine("Source : " + e.Source); - Console.WriteLine("Message : " + e.Message); - } - } -} -// diff --git a/snippets/csharp/System.Web.Services.Description/OperationBindingCollection/Overview/MathService_cs.asmx b/snippets/csharp/System.Web.Services.Description/OperationBindingCollection/Overview/MathService_cs.asmx deleted file mode 100644 index 1e882c1d6b9..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationBindingCollection/Overview/MathService_cs.asmx +++ /dev/null @@ -1,33 +0,0 @@ -<%@ WebService Language="C#" Class="MathService" %> - -using System; -using System.Web.Services; - -public class MathService : WebService { - - [WebMethod] - public float Add(float a, float b) - { - return a + b; - } - - [WebMethod] - public float Subtract(float a, float b) - { - return a - b; - } - - [WebMethod] - public float Multiply(float a, float b) - { - return a * b; - } - - [WebMethod] - public float Divide(float a, float b) - { - if (b==0) return -1; - return a / b; - } - -} \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/OperationBindingCollection/Overview/MathService_input_cs.wsdl b/snippets/csharp/System.Web.Services.Description/OperationBindingCollection/Overview/MathService_input_cs.wsdl deleted file mode 100644 index fa9de60ff9a..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationBindingCollection/Overview/MathService_input_cs.wsdl +++ /dev/null @@ -1,312 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/OperationBindingCollection/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/OperationBindingCollection/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationBindingCollection/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/OperationBindingCollection/Overview/operationbindingcollection_operationbindingcollection.cs b/snippets/csharp/System.Web.Services.Description/OperationBindingCollection/Overview/operationbindingcollection_operationbindingcollection.cs deleted file mode 100644 index 752d86e746d..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationBindingCollection/Overview/operationbindingcollection_operationbindingcollection.cs +++ /dev/null @@ -1,141 +0,0 @@ -// System.Web.Services.Description.OperationBindingCollection -// System.Web.Services.Description.OperationBindingCollection.Contains -// System.Web.Services.Description.OperationBindingCollection.Add -// System.Web.Services.Description.OperationBindingCollection.Item -// System.Web.Services.Description.OperationBindingCollection.Remove -// System.Web.Services.Description.OperationBindingCollection.Insert -// System.Web.Services.Description.OperationBindingCollection.IndexOf -// System.Web.Services.Description.OperationBindingCollection.CopyTo - -/* - The following example demonstrates the usage of the - 'OperationBindingCollection' class, the 'Item' property and various methods of the - class. The input to the program is a WSDL file 'MathService_input_cs.wsdl' without - the add operation binding of SOAP protocol. In this example the WSDL file - is modified to insert a new 'OperationBinding' for SOAP. The - 'OperationBindingCollection' is populated based on WSDL document - structure defined in WSDL specification. The updated instance is then - written to 'MathService_new_cs.wsdl'. -*/ - -// -using System; -using System.Web.Services.Description; - -class MyOperationBindingCollectionSample -{ - static void Main() - { - try - { - ServiceDescription myServiceDescription = - ServiceDescription.Read("MathService_input_cs.wsdl"); - - // Add the OperationBinding for the Add operation. - OperationBinding addOperationBinding = new OperationBinding(); - string addOperation = "Add"; - string myTargetNamespace = myServiceDescription.TargetNamespace; - addOperationBinding.Name = addOperation; - - // Add the InputBinding for the operation. - InputBinding myInputBinding = new InputBinding(); - SoapBodyBinding mySoapBodyBinding = new SoapBodyBinding(); - mySoapBodyBinding.Use = SoapBindingUse.Literal; - myInputBinding.Extensions.Add(mySoapBodyBinding); - addOperationBinding.Input = myInputBinding; - - // Add the OutputBinding for the operation. - OutputBinding myOutputBinding = new OutputBinding(); - myOutputBinding.Extensions.Add(mySoapBodyBinding); - addOperationBinding.Output = myOutputBinding; - - // Add the extensibility element for the SoapOperationBinding. - SoapOperationBinding mySoapOperationBinding = - new SoapOperationBinding(); - mySoapOperationBinding.Style = SoapBindingStyle.Document; - mySoapOperationBinding.SoapAction = myTargetNamespace + addOperation; - addOperationBinding.Extensions.Add(mySoapOperationBinding); - - // Get the BindingCollection from the ServiceDescription. - BindingCollection myBindingCollection = - myServiceDescription.Bindings; - - // Get the OperationBindingCollection of SOAP binding from - // the BindingCollection. - OperationBindingCollection myOperationBindingCollection = - myBindingCollection[0].Operations; - -// - // Check for the Add OperationBinding in the collection. - bool contains = myOperationBindingCollection.Contains - (addOperationBinding); - Console.WriteLine("\nWhether the collection contains the Add " + - "OperationBinding : " + contains); -// - -// - // Add the Add OperationBinding to the collection. - myOperationBindingCollection.Add(addOperationBinding); - Console.WriteLine("\nAdded the OperationBinding of the Add" + - " operation to the collection."); -// - -// -// - // Get the OperationBinding of the Add operation from the collection. - OperationBinding myOperationBinding = - myOperationBindingCollection[3]; - - // Remove the OperationBinding of the Add operation from - // the collection. - myOperationBindingCollection.Remove(myOperationBinding); - Console.WriteLine("\nRemoved the OperationBinding of the " + - "Add operation from the collection."); -// -// - -// -// - // Insert the OperationBinding of the Add operation at index 0. - myOperationBindingCollection.Insert(0, addOperationBinding); - Console.WriteLine("\nInserted the OperationBinding of the " + - "Add operation in the collection."); - - // Get the index of the OperationBinding of the Add - // operation from the collection. - int index = myOperationBindingCollection.IndexOf(addOperationBinding); - Console.WriteLine("\nThe index of the OperationBinding of the " + - "Add operation : " + index); -// -// - Console.WriteLine(""); - -// - OperationBinding[] operationBindingArray = new - OperationBinding[myOperationBindingCollection.Count]; - - // Copy this collection to the OperationBinding array. - myOperationBindingCollection.CopyTo(operationBindingArray, 0); - Console.WriteLine("The operations supported by this service " + - "are :"); - foreach(OperationBinding myOperationBinding1 in - operationBindingArray) - { - Binding myBinding = myOperationBinding1.Binding; - Console.WriteLine(" Binding : "+ myBinding.Name + " Name of " + - "operation : " + myOperationBinding1.Name); - } -// - - // Save the ServiceDescription to an external file. - myServiceDescription.Write("MathService_new_cs.wsdl"); - } - catch(Exception e) - { - Console.WriteLine("Exception caught!!!"); - Console.WriteLine("Source : " + e.Source); - Console.WriteLine("Message : " + e.Message); - } - } -} -// diff --git a/snippets/csharp/System.Web.Services.Description/OperationCollection/Overview/MathService.cs.asmx b/snippets/csharp/System.Web.Services.Description/OperationCollection/Overview/MathService.cs.asmx deleted file mode 100644 index 1e882c1d6b9..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationCollection/Overview/MathService.cs.asmx +++ /dev/null @@ -1,33 +0,0 @@ -<%@ WebService Language="C#" Class="MathService" %> - -using System; -using System.Web.Services; - -public class MathService : WebService { - - [WebMethod] - public float Add(float a, float b) - { - return a + b; - } - - [WebMethod] - public float Subtract(float a, float b) - { - return a - b; - } - - [WebMethod] - public float Multiply(float a, float b) - { - return a * b; - } - - [WebMethod] - public float Divide(float a, float b) - { - if (b==0) return -1; - return a / b; - } - -} \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/OperationCollection/Overview/MathService_input_cs.wsdl b/snippets/csharp/System.Web.Services.Description/OperationCollection/Overview/MathService_input_cs.wsdl deleted file mode 100644 index da8d4a9591a..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationCollection/Overview/MathService_input_cs.wsdl +++ /dev/null @@ -1,326 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/OperationCollection/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/OperationCollection/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationCollection/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/OperationCollection/Overview/operationcollection_methods.cs b/snippets/csharp/System.Web.Services.Description/OperationCollection/Overview/operationcollection_methods.cs deleted file mode 100644 index 951df6ebe66..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationCollection/Overview/operationcollection_methods.cs +++ /dev/null @@ -1,99 +0,0 @@ -// System.Web.Sevices.Description.OperationCollection -// System.Web.Sevices.Description.OperationCollection.Add -// System.Web.Sevices.Description.OperationCollection.Contains -// System.Web.Sevices.Description.OperationCollection.IndexOf -// System.Web.Sevices.Description.OperationCollection.Remove -// System.Web.Sevices.Description.OperationCollection.Insert -// System.Web.Sevices.Description.OperationCollection.Item -// System.Web.Sevices.Description.OperationCollection.CopyTo - -/* - The following example demonstrates the usage of the - 'OperationCollection' class , its property 'Item' and its methods - 'Add', 'Contains', 'CopyTo', 'IndexOf', 'Insert' and 'Remove'. - The input to the program is a WSDL file 'MathService_input_cs.wsdl'with - information related to the 'Add' operation for the SOAP protocol, - removed from it. It creates a new file 'MathService_new_cs.wsdl' with - the added information about the 'Add' method. -*/ - -// -using System; -using System.Web.Services; -using System.Xml; -using System.Web.Services.Description; - -class MyOperationCollectionSample -{ - public static void Main() - { - try - { - // Read the 'MathService_Input_cs.wsdl' file. - ServiceDescription myDescription = - ServiceDescription.Read("MathService_Input_cs.wsdl"); - PortTypeCollection myPortTypeCollection =myDescription.PortTypes; - // Get the 'OperationCollection' for 'SOAP' protocol. -// - OperationCollection myOperationCollection = - myPortTypeCollection[0].Operations; - Operation myOperation = new Operation(); - myOperation.Name = "Add"; - OperationMessage myOperationMessageInput = - (OperationMessage) new OperationInput(); - myOperationMessageInput.Message = new XmlQualifiedName - ("AddSoapIn",myDescription.TargetNamespace); - OperationMessage myOperationMessageOutput = - (OperationMessage) new OperationOutput(); - myOperationMessageOutput.Message = new XmlQualifiedName( - "AddSoapOut",myDescription.TargetNamespace); - myOperation.Messages.Add(myOperationMessageInput); - myOperation.Messages.Add(myOperationMessageOutput); - myOperationCollection.Add(myOperation); -// - -// -// - if (myOperationCollection.Contains(myOperation)) - { - Console.WriteLine("The index of the added 'myOperation' " + - "operation is : " + - myOperationCollection.IndexOf(myOperation)); - } -// -// - -// -// -// - myOperationCollection.Remove(myOperation); - // Insert the 'myOpearation' operation at the index '0'. - myOperationCollection.Insert(0, myOperation); - Console.WriteLine("The operation at index '0' is : " + - myOperationCollection[0].Name); -// -// -// - -// - Operation[] myOperationArray = new Operation[ - myOperationCollection.Count]; - myOperationCollection.CopyTo(myOperationArray, 0); - Console.WriteLine("The operation(s) in the collection are :"); - for(int i = 0; i < myOperationCollection.Count; i++) - { - Console.WriteLine(" " + myOperationArray[i].Name); - } -// - - myDescription.Write("MathService_New_cs.wsdl"); - } - catch(Exception e) - { - Console.WriteLine("Exception caught!!!"); - Console.WriteLine("Source : " + e.Source); - Console.WriteLine("Message : " + e.Message); - } - } -} -// \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/OperationFault/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/OperationFault/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationFault/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/OperationFault/Overview/operationfault_operationfault.cs b/snippets/csharp/System.Web.Services.Description/OperationFault/Overview/operationfault_operationfault.cs deleted file mode 100644 index a35ff6f20a1..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationFault/Overview/operationfault_operationfault.cs +++ /dev/null @@ -1,60 +0,0 @@ -// System.Web.Services.Description.OperationFault -// System.Web.Services.Description.OperationFault.OperationFault - -/* The following example demonstrates the usage of the 'OperationFault' - class and its constructor. The program generates a WSDL file - 'StockQuoteNew_cs.wsdl' which contains 'Fault' information written - out. -*/ - -// -using System; -using System.Web.Services.Description; -using System.Xml; -using System.Xml.Schema; -using System.Xml.Serialization; - -public class MyOperationFaultSample -{ - public static void Main() - { - try - { - // Read the 'StockQuote_cs.wsdl' file as input. - ServiceDescription myServiceDescription = ServiceDescription. - Read("StockQuote_cs.wsdl"); - PortTypeCollection myPortTypeCollection = myServiceDescription. - PortTypes; - PortType myPortType = myPortTypeCollection[0]; - OperationCollection myOperationCollection = myPortType.Operations; - Operation myOperation = myOperationCollection[0]; -// - OperationFault myOperationFault = new OperationFault(); - myOperationFault.Name = "ErrorString"; - myOperationFault.Message = new XmlQualifiedName - ("s0:GetTradePriceStringFault"); - myOperation.Faults.Add(myOperationFault); - Console.WriteLine("Added OperationFault with Name: " - + myOperationFault.Name); - myOperationFault = new OperationFault(); - myOperationFault.Name = "ErrorInt"; - myOperationFault.Message = new XmlQualifiedName - ("s0:GetTradePriceIntFault"); - myOperation.Faults.Add(myOperationFault); -// - myOperationCollection.Add(myOperation); - Console.WriteLine("Added Second OperationFault with Name: " - +myOperationFault.Name); - myServiceDescription.Write("StockQuoteNew_cs.wsdl"); - Console.WriteLine("\nThe file 'StockQuoteNew_cs.wsdl' is " + - "created successfully."); - } - catch(Exception e) - { - Console.WriteLine("Exception caught!!!"); - Console.WriteLine("Source : " + e.Source); - Console.WriteLine("Message : " + e.Message); - } - } -} -// \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/OperationFault/Overview/stockquote_cs.wsdl b/snippets/csharp/System.Web.Services.Description/OperationFault/Overview/stockquote_cs.wsdl deleted file mode 100644 index 1fb1f33ce60..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationFault/Overview/stockquote_cs.wsdl +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/OperationFaultCollection/Add/Project.csproj b/snippets/csharp/System.Web.Services.Description/OperationFaultCollection/Add/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationFaultCollection/Add/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/OperationFaultCollection/Add/operationfaultcollection_add.cs b/snippets/csharp/System.Web.Services.Description/OperationFaultCollection/Add/operationfaultcollection_add.cs deleted file mode 100644 index 41378806f07..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationFaultCollection/Add/operationfaultcollection_add.cs +++ /dev/null @@ -1,58 +0,0 @@ -// System.Web.Services.Description.OperationFaultCollection.Add - -/* - The following example demonstrates the 'Add' method of the - 'OperationFaultCollection' class. Based on 'StockQuote_cs.wsdl', the program generates a WSDL file - 'StockQuoteNew_cs.wsdl' which contains 'Fault' information written out. -*/ - -using System; -using System.Web.Services.Description; -using System.Xml; -using System.Xml.Schema; -using System.Xml.Serialization; - -public class MyFaultCollectionSample -{ - public static void Main() - { - try - { - // Read the 'StockQuote.wsdl' file as input. - ServiceDescription myServiceDescription = ServiceDescription. - Read("StockQuote_cs.wsdl"); - PortTypeCollection myPortTypeCollection = myServiceDescription. - PortTypes; - PortType myPortType = myPortTypeCollection[0]; - OperationCollection myOperationCollection = myPortType.Operations; - Operation myOperation = myOperationCollection[0]; -// - OperationFaultCollection myOperationFaultCollection = myOperation.Faults; - OperationFault myOperationFault = new OperationFault(); - myOperationFault.Name = "ErrorString"; - myOperationFault.Message = new XmlQualifiedName("s0:GetTradePriceStringFault"); - myOperationFaultCollection.Add(myOperationFault); -// - Console.WriteLine("Added OperationFault with Name: " + - myOperationFault.Name); - myOperationFault = new OperationFault(); - myOperationFault.Name = "ErrorInt"; - myOperationFault.Message = new XmlQualifiedName - ("s0:GetTradePriceIntFault"); - myOperationFaultCollection.Add(myOperationFault); - - myOperationCollection.Add(myOperation); - Console.WriteLine("Added Second OperationFault with Name: " + - myOperationFault.Name); - myServiceDescription.Write("StockQuoteNew_cs.wsdl"); - Console.WriteLine("\nThe file 'StockQuoteNew_cs.wsdl' is created" + - " successfully."); - } - catch(Exception e) - { - Console.WriteLine("Exception caught!!!"); - Console.WriteLine("Source : " + e.Source); - Console.WriteLine("Message : " + e.Message); - } - } -} diff --git a/snippets/csharp/System.Web.Services.Description/OperationFaultCollection/Add/stockquote_cs.wsdl b/snippets/csharp/System.Web.Services.Description/OperationFaultCollection/Add/stockquote_cs.wsdl deleted file mode 100644 index 1fb1f33ce60..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationFaultCollection/Add/stockquote_cs.wsdl +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/OperationFaultCollection/Item/Project.csproj b/snippets/csharp/System.Web.Services.Description/OperationFaultCollection/Item/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationFaultCollection/Item/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/OperationFaultCollection/Item/operationfaultcollection_item.cs b/snippets/csharp/System.Web.Services.Description/OperationFaultCollection/Item/operationfaultcollection_item.cs deleted file mode 100644 index 10586e7b249..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationFaultCollection/Item/operationfaultcollection_item.cs +++ /dev/null @@ -1,68 +0,0 @@ -// System.Web.Services.Description.OperationFaultCollection.Item[string] - -/* - The following example demonstrates the 'Item' property of the - 'OperationFaultCollection' class. The program removes a fault binding - with the name 'ErrorString' from the WSDL file. It also removes an - operation fault with the name 'ErrorString' and generates a WSDL file. -*/ - -using System; -using System.Web.Services.Description; - -public class MySample -{ - public static void Main() - { - try - { - // Read the 'StockQuote.wsdl' file as input. - ServiceDescription myServiceDescription = ServiceDescription. - Read("StockQuote_cs.wsdl"); - // Remove the operation fault with the name 'ErrorString'. - PortTypeCollection myPortTypeCollection = myServiceDescription. - PortTypes; - PortType myPortType = myPortTypeCollection[0]; - OperationCollection myOperationCollection = myPortType.Operations; - Operation myOperation = myOperationCollection[0]; - -// - OperationFaultCollection myOperationFaultCollection = - myOperation.Faults; - OperationFault myOperationFault = - myOperationFaultCollection["ErrorString"]; - if( myOperationFault != null ) - { - myOperationFaultCollection.Remove(myOperationFault); - } -// - - // Remove the fault binding with the name 'ErrorString'. - BindingCollection myBindingCollection = myServiceDescription. - Bindings; - Binding myBinding = myBindingCollection[0]; - OperationBindingCollection myOperationBindingCollection = - myBinding.Operations; - OperationBinding myOperationBinding = - myOperationBindingCollection[0]; - FaultBindingCollection myFaultBindingCollection = - myOperationBinding.Faults; - if(myFaultBindingCollection.Contains( - myFaultBindingCollection["ErrorString"])) - { - myFaultBindingCollection.Remove( - myFaultBindingCollection["ErrorString"]); - } - - myServiceDescription.Write("OperationFaultCollection_out.wsdl"); - Console.WriteLine("WSDL file with name 'OperationFaultCollection_out.wsdl'" + - " created Successfully"); - } - catch(Exception e) - { - Console.WriteLine("Exception caught!!!"); - Console.WriteLine("Source : " + e.Source); - Console.WriteLine("Message : " + e.Message); - } - } -} diff --git a/snippets/csharp/System.Web.Services.Description/OperationFaultCollection/Item/stockquote_cs.wsdl b/snippets/csharp/System.Web.Services.Description/OperationFaultCollection/Item/stockquote_cs.wsdl deleted file mode 100644 index c48d6636898..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationFaultCollection/Item/stockquote_cs.wsdl +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/OperationFaultCollection/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/OperationFaultCollection/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationFaultCollection/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/OperationFaultCollection/Overview/operationfaultcollection_7.cs b/snippets/csharp/System.Web.Services.Description/OperationFaultCollection/Overview/operationfaultcollection_7.cs deleted file mode 100644 index e792676f4da..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationFaultCollection/Overview/operationfaultcollection_7.cs +++ /dev/null @@ -1,146 +0,0 @@ -// System.Web.Services.Description.OperationFaultCollection -// System.Web.Services.Description.OperationFaultCollection.Contains -// System.Web.Services.Description.OperationFaultCollection.CopyTo -// System.Web.Services.Description.OperationFaultCollection.IndexOf -// System.Web.Services.Description.OperationFaultCollection.Insert -// System.Web.Services.Description.OperationFaultCollection.Item -// System.Web.Services.Description.OperationFaultCollection.Remove - -/* - The following example demonstrates the usage of the - 'OperationFaultCollection' class, the 'Contains', 'CopyTo', 'IndexOf', - 'Insert', 'Remove', methods and the 'Item' property of the class. - The program reverses the fault bindings that appear in the WSDL file. - It also reverses the operation faults and writes the resultant WSDL - file. -*/ - -// -using System; -using System.Web.Services.Description; - -public class MyOperationFaultCollectionSample -{ - public static void Main() - { - try - { - // Read the StockQuote.wsdl file as input. - ServiceDescription myServiceDescription = - ServiceDescription.Read("StockQuote_cs.wsdl"); -// -// -// -// -// -// - PortTypeCollection myPortTypeCollection = - myServiceDescription.PortTypes; - PortType myPortType = myPortTypeCollection[0]; - OperationCollection myOperationCollection = myPortType.Operations; - Operation myOperation = myOperationCollection[0]; - OperationFaultCollection myOperationFaultCollection = - myOperation.Faults; - - // Reverse the operation fault order. - if(myOperationFaultCollection.Count > 1) - { - OperationFault myOperationFault = myOperationFaultCollection[0]; - OperationFault[] myOperationFaultArray = - new OperationFault[myOperationFaultCollection.Count]; - - // Copy the operation faults to a temporary array. - myOperationFaultCollection.CopyTo(myOperationFaultArray, 0); - - // Remove all the operation faults from the collection. - for(int i = 0; i < myOperationFaultArray.Length; i++) - { - myOperationFaultCollection.Remove(myOperationFaultArray[i]); - } - - // Insert the operation faults in the reverse order. - for(int i = 0, j = (myOperationFaultArray.Length - 1); - i < myOperationFaultArray.Length; i++, j--) - { - myOperationFaultCollection.Insert( - i, myOperationFaultArray[j]); - } - if ( myOperationFaultCollection.Contains(myOperationFault) && - (myOperationFaultCollection.IndexOf(myOperationFault) - == myOperationFaultCollection.Count-1)) - { - Console.WriteLine( - "Succeeded in reversing the operation faults."); - } - else - { - Console.WriteLine("Error while reversing the faults."); - } - } -// -// -// -// -// -// - BindingCollection myBindingCollection = - myServiceDescription.Bindings; - Binding myBinding = myBindingCollection[0]; - OperationBindingCollection myOperationBindingCollection = - myBinding.Operations; - OperationBinding myOperationBinding = - myOperationBindingCollection[0]; - FaultBindingCollection myFaultBindingCollection = - myOperationBinding.Faults; - - // Reverse the fault binding order. - if(myFaultBindingCollection.Count > 1) - { - FaultBinding myFaultBinding = myFaultBindingCollection[0]; - - FaultBinding[] myFaultBindingArray = - new FaultBinding[myFaultBindingCollection.Count]; - - // Copy the fault bindings to a temporary array. - myFaultBindingCollection.CopyTo(myFaultBindingArray, 0); - - // Remove all the fault bindings. - for(int i = 0; i < myFaultBindingArray.Length; i++) - { - myFaultBindingCollection.Remove(myFaultBindingArray[i]); - } - - // Insert the fault bindings in the reverse order. - for(int i = 0, j = (myFaultBindingArray.Length - 1); - i < myFaultBindingArray.Length; i++, j--) - { - myFaultBindingCollection.Insert(i, myFaultBindingArray[j]); - } - - // Check whether the first element before the reversal - // is now the last element. - if(myFaultBindingCollection.Contains(myFaultBinding) && - myFaultBindingCollection.IndexOf(myFaultBinding) == - (myFaultBindingCollection.Count - 1)) - { - // Write the WSDL generated to a file. - myServiceDescription.Write("StockQuoteOut_cs.wsdl"); - Console.WriteLine( - "The file StockQuoteOut_cs.wsdl was successfully written."); - } - else - { - Console.WriteLine( - "An error occurred while reversing the input WSDL file."); - } - } - } - catch(Exception e) - { - Console.WriteLine("Exception caught!!!"); - Console.WriteLine("Source : " + e.Source); - Console.WriteLine("Message : " + e.Message); - } - } -} -// diff --git a/snippets/csharp/System.Web.Services.Description/OperationFaultCollection/Overview/stockquote_cs.wsdl b/snippets/csharp/System.Web.Services.Description/OperationFaultCollection/Overview/stockquote_cs.wsdl deleted file mode 100644 index f2219ebfb18..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationFaultCollection/Overview/stockquote_cs.wsdl +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/OperationFlow/Overview/MathService.cs.asmx b/snippets/csharp/System.Web.Services.Description/OperationFlow/Overview/MathService.cs.asmx deleted file mode 100644 index 1e882c1d6b9..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationFlow/Overview/MathService.cs.asmx +++ /dev/null @@ -1,33 +0,0 @@ -<%@ WebService Language="C#" Class="MathService" %> - -using System; -using System.Web.Services; - -public class MathService : WebService { - - [WebMethod] - public float Add(float a, float b) - { - return a + b; - } - - [WebMethod] - public float Subtract(float a, float b) - { - return a - b; - } - - [WebMethod] - public float Multiply(float a, float b) - { - return a * b; - } - - [WebMethod] - public float Divide(float a, float b) - { - if (b==0) return -1; - return a / b; - } - -} \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/OperationFlow/Overview/MathService_input_cs.wsdl b/snippets/csharp/System.Web.Services.Description/OperationFlow/Overview/MathService_input_cs.wsdl deleted file mode 100644 index bd7a0fc2934..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationFlow/Overview/MathService_input_cs.wsdl +++ /dev/null @@ -1,328 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/OperationFlow/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/OperationFlow/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationFlow/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/OperationFlow/Overview/operationflow_enum.cs b/snippets/csharp/System.Web.Services.Description/OperationFlow/Overview/operationflow_enum.cs deleted file mode 100644 index de2d787002c..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationFlow/Overview/operationflow_enum.cs +++ /dev/null @@ -1,148 +0,0 @@ -// System.Web.Sevices.Description.OperationFlow -// System.Web.Sevices.Description.OperationFlow.None -// System.Web.Sevices.Description.OperationFlow.OneWay -// System.Web.Sevices.Description.OperationFlow.Notification -// System.Web.Sevices.Description.OperationFlow.SolicitResponse -// System.Web.Sevices.Description.OperationFlow.RequestResponse - -/* - The following example demonstrates the usage of the 'OperationFlow' - Enumeration, its members 'None', 'OneWay', 'Notification', - 'SolicitResponse', 'RequestResponse'. The input to the program is a - WSDL file 'MathService_input_cs.wsdl' It creates a new file - 'MathService_new_cs.wsdl' by adding the operation messages - 'OperationInput' and 'OperationOutput' are added to the - 'OperationInput' and 'OperationOutput' in such way that all members of - the 'OperationFlow' enumeration are generated. -*/ - -// -using System; -using System.Xml; -using System.Web.Services; -using System.Web.Services.Description; - -class MyOperationFlowSample -{ - public static void Main() - { - try - { - ServiceDescription myDescription = - ServiceDescription.Read("MathService_Input_cs.wsdl"); - PortTypeCollection myPortTypeCollection = - myDescription.PortTypes; - - // Get the OperationCollection for SOAP protocol. - OperationCollection myOperationCollection = - myPortTypeCollection[0].Operations; - - // Get the OperationMessageCollection for the Add operation. - OperationMessageCollection myOperationMessageCollection = - myOperationCollection[0].Messages; - - // Indicate that the endpoint or service receives no - // transmissions (None). - Console.WriteLine("myOperationMessageCollection does not " + - "contain any operation messages."); - DisplayOperationFlowDescription(myOperationMessageCollection.Flow); - Console.WriteLine(); - - // Indicate that the endpoint or service receives a message (OneWay). - OperationMessage myInputOperationMessage = - (OperationMessage) new OperationInput(); - XmlQualifiedName myXmlQualifiedName = - new XmlQualifiedName("AddSoapIn", myDescription.TargetNamespace); - myInputOperationMessage.Message = myXmlQualifiedName; - myOperationMessageCollection.Add(myInputOperationMessage); - Console.WriteLine("myOperationMessageCollection contains " + - "only input operation messages."); - DisplayOperationFlowDescription(myOperationMessageCollection.Flow); - Console.WriteLine(); - - myOperationMessageCollection.Remove(myInputOperationMessage); - - // Indicate that an endpoint or service sends a message (Notification). - OperationMessage myOutputOperationMessage = - (OperationMessage) new OperationOutput(); - XmlQualifiedName myXmlQualifiedName1 = new XmlQualifiedName - ("AddSoapOut", myDescription.TargetNamespace); - myOutputOperationMessage.Message = myXmlQualifiedName1; - myOperationMessageCollection.Add(myOutputOperationMessage); - Console.WriteLine("myOperationMessageCollection contains " + - "only output operation messages."); - DisplayOperationFlowDescription(myOperationMessageCollection.Flow); - Console.WriteLine(); - - // Indicate that an endpoint or service sends a message, then - // receives a correlated message (SolicitResponse). - myOperationMessageCollection.Add(myInputOperationMessage); - Console.WriteLine("'myOperationMessageCollection' contains " + - "an output operation message first, then " + - "an input operation message."); - DisplayOperationFlowDescription(myOperationMessageCollection.Flow); - Console.WriteLine(); - - // Indicate that an endpoint or service receives a message, - // then sends a correlated message (RequestResponse). - myOperationMessageCollection.Remove(myInputOperationMessage); - myOperationMessageCollection.Insert(0, myInputOperationMessage); - Console.WriteLine("myOperationMessageCollection contains " + - "an input operation message first, then " + - "an output operation message."); - DisplayOperationFlowDescription(myOperationMessageCollection.Flow); - Console.WriteLine(); - - myDescription.Write("MathService_new_cs.wsdl"); - Console.WriteLine( - "The file MathService_new_cs.wsdl was successfully written."); - } - catch(Exception e) - { - Console.WriteLine("Exception caught!!!"); - Console.WriteLine("Source : " + e.Source); - Console.WriteLine("Message : " + e.Message); - } - } - -// -// -// -// -// - public static void DisplayOperationFlowDescription( - OperationFlow myOperationFlow) - { - switch(myOperationFlow) - { - case OperationFlow.None: - Console.WriteLine("Indicates that the endpoint or service " + - "receives no transmissions (None)."); - break; - case OperationFlow.OneWay: - Console.WriteLine("Indicates that the endpoint or service " + - "receives a message (OneWay)."); - break; - case OperationFlow.Notification: - Console.WriteLine("Indicates that the endpoint or service " + - "sends a message (Notification)."); - break; - case OperationFlow.SolicitResponse: - Console.WriteLine("Indicates that the endpoint or service " + - "sends a message, then receives a " + - "correlated message (SolicitResponse)."); - break; - case OperationFlow.RequestResponse: - Console.WriteLine("Indicates that the endpoint or service " + - "receives a message, then sends a " + - "correlated message (RequestResponse)."); - break; - } - } -// -// -// -// -// -} -// diff --git a/snippets/csharp/System.Web.Services.Description/OperationInput/Overview/AddNumbersIn_cs.wsdl b/snippets/csharp/System.Web.Services.Description/OperationInput/Overview/AddNumbersIn_cs.wsdl deleted file mode 100644 index 4dca3720b6f..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationInput/Overview/AddNumbersIn_cs.wsdl +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/OperationInput/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/OperationInput/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationInput/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/OperationInput/Overview/Service.cs.asmx b/snippets/csharp/System.Web.Services.Description/OperationInput/Overview/Service.cs.asmx deleted file mode 100644 index a636570ec5d..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationInput/Overview/Service.cs.asmx +++ /dev/null @@ -1,17 +0,0 @@ -<%@ WebService Language="C#" Class="Service" %> -using System; -using System.Collections; -using System.ComponentModel; -using System.Data; -using System.Diagnostics; -using System.Web; -using System.Web.Services; - -public class Service: System.Web.Services.WebService -{ - [WebMethod] - public int AddNumbers(int firstNumber,int secondNumber) - { - return firstNumber+secondNumber; - } -} diff --git a/snippets/csharp/System.Web.Services.Description/OperationInput/Overview/operationinput_operationinput.cs b/snippets/csharp/System.Web.Services.Description/OperationInput/Overview/operationinput_operationinput.cs deleted file mode 100644 index d91179459e3..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationInput/Overview/operationinput_operationinput.cs +++ /dev/null @@ -1,133 +0,0 @@ -// System.Web.Services.Description.OperationInput -// System.Web.Services.Description.OperationInput.OperationInput - -/* - The following example demonstrates the usage of the 'OperationInput' - class and its constructor 'OperationInput'. It instantiates the - 'ServiceDescription' object by reading a file 'AddNumbersIn_cs.wsdl' - and then creates 'AddNumbersOut_cs.wsdl' file which corresponds to - added attributes in the 'ServiceDescription' instance. -*/ - -// -using System; -using System.Web.Services.Description; -using System.Collections; -using System.Xml; - -class MyOperationInputSample -{ - public static void Main() - { - try - { - ServiceDescription myDescription = - ServiceDescription.Read("AddNumbersIn_cs.wsdl"); - - // Add the ServiceHttpPost binding. - Binding myBinding = new Binding(); - myBinding.Name = "ServiceHttpPost"; - XmlQualifiedName myXmlQualifiedName = - new XmlQualifiedName ("s0:ServiceHttpPost"); - myBinding.Type = myXmlQualifiedName; - HttpBinding myHttpBinding = new HttpBinding(); - myHttpBinding.Verb = "POST"; - myBinding.Extensions.Add(myHttpBinding); - - // Add the operation name AddNumbers. - OperationBinding myOperationBinding = new OperationBinding(); - myOperationBinding.Name = "AddNumbers"; - HttpOperationBinding myOperation = new HttpOperationBinding(); - myOperation.Location = "/AddNumbers"; - myOperationBinding.Extensions.Add(myOperation); - - // Add the input binding. - InputBinding myInput = new InputBinding(); - MimeContentBinding postMimeContentbinding = - new MimeContentBinding(); - postMimeContentbinding.Type= "application/x-www-form-urlencoded"; - myInput.Extensions.Add(postMimeContentbinding); - - // Add the InputBinding to the OperationBinding. - myOperationBinding.Input = myInput; - - // Add the ouput binding. - OutputBinding myOutput = new OutputBinding(); - MimeXmlBinding postMimeXmlBinding = new MimeXmlBinding(); - postMimeXmlBinding.Part= "Body"; - myOutput.Extensions.Add(postMimeXmlBinding); - - // Add the OutputBinding to the OperationBinding. - myOperationBinding.Output = myOutput; - - myBinding.Operations.Add(myOperationBinding); - myDescription.Bindings.Add(myBinding); - - // Add the port definition. - Port postPort = new Port(); - postPort.Name = "ServiceHttpPost"; - postPort.Binding = new XmlQualifiedName("s0:ServiceHttpPost"); - HttpAddressBinding postAddressBinding = new HttpAddressBinding(); - postAddressBinding.Location = "http://localhost/Service.cs.asmx"; - postPort.Extensions.Add(postAddressBinding); - myDescription.Services[0].Ports.Add(postPort); - - // Add the post port type definition. - PortType postPortType = new PortType(); - postPortType.Name = "ServiceHttpPost"; - Operation postOperation = new Operation(); - postOperation.Name = "AddNumbers"; - OperationMessage postOutput = - (OperationMessage)new OperationOutput(); - postOutput.Message = - new XmlQualifiedName ("s0:AddNumbersHttpPostOut"); -// - OperationInput postInput = new OperationInput(); - postInput.Message = - new XmlQualifiedName ("s0:AddNumbersHttpPostIn"); - - postOperation.Messages.Add(postInput); - postOperation.Messages.Add(postOutput); - postPortType.Operations.Add(postOperation); -// - myDescription.PortTypes.Add(postPortType); - - // Add the first message information. - Message postMessage1 = new Message(); - postMessage1.Name="AddNumbersHttpPostIn"; - MessagePart postMessagePart1 = new MessagePart(); - postMessagePart1.Name = "firstnumber"; - postMessagePart1.Type = new XmlQualifiedName("s:string"); - - // Add the second message information. - MessagePart postMessagePart2 = new MessagePart(); - postMessagePart2.Name = "secondnumber"; - postMessagePart2.Type = new XmlQualifiedName("s:string"); - postMessage1.Parts.Add(postMessagePart1); - postMessage1.Parts.Add(postMessagePart2); - Message postMessage2 = new Message(); - postMessage2.Name = "AddNumbersHttpPostOut"; - - // Add the third message information. - MessagePart postMessagePart3 = new MessagePart(); - postMessagePart3.Name = "Body"; - postMessagePart3.Element = new XmlQualifiedName("s0:int"); - postMessage2.Parts.Add(postMessagePart3); - - myDescription.Messages.Add(postMessage1); - myDescription.Messages.Add(postMessage2); - - // Write the ServiceDescription as a WSDL file. - myDescription.Write("AddNumbersOut_cs.wsdl"); - Console.WriteLine("WSDL file named AddNumberOut_cs.Wsdl" + - " created successfully."); - } - catch(Exception e) - { - Console.WriteLine("Exception caught!!!"); - Console.WriteLine("Source : " + e.Source); - Console.WriteLine("Message : " + e.Message); - } - } -} -// diff --git a/snippets/csharp/System.Web.Services.Description/OperationMessage/Overview/MathService_cs.asmx b/snippets/csharp/System.Web.Services.Description/OperationMessage/Overview/MathService_cs.asmx deleted file mode 100644 index 1e882c1d6b9..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationMessage/Overview/MathService_cs.asmx +++ /dev/null @@ -1,33 +0,0 @@ -<%@ WebService Language="C#" Class="MathService" %> - -using System; -using System.Web.Services; - -public class MathService : WebService { - - [WebMethod] - public float Add(float a, float b) - { - return a + b; - } - - [WebMethod] - public float Subtract(float a, float b) - { - return a - b; - } - - [WebMethod] - public float Multiply(float a, float b) - { - return a * b; - } - - [WebMethod] - public float Divide(float a, float b) - { - if (b==0) return -1; - return a / b; - } - -} \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/OperationMessage/Overview/MathService_input_cs.wsdl b/snippets/csharp/System.Web.Services.Description/OperationMessage/Overview/MathService_input_cs.wsdl deleted file mode 100644 index 3ebb5a6557d..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationMessage/Overview/MathService_input_cs.wsdl +++ /dev/null @@ -1,329 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/OperationMessage/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/OperationMessage/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationMessage/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/OperationMessage/Overview/operationmessage_properties.cs b/snippets/csharp/System.Web.Services.Description/OperationMessage/Overview/operationmessage_properties.cs deleted file mode 100644 index 353fd646c65..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationMessage/Overview/operationmessage_properties.cs +++ /dev/null @@ -1,69 +0,0 @@ -// System.Web.Services.Description.OperationMessage -// System.Web.Services.Description.OperationMessage.OperationMessage -// System.Web.Services.Description.OperationMessage.Message -// System.Web.Services.Description.OperationMessage.Operation - -/* - The following example demonstrates the usage of the 'OperationMessage' - class, its constructor and the properties 'Message' and 'Operation'. - The input to the program is a WSDL file 'MathService_input_cs.wsdl' without - the input message of 'Add' operation for the SOAP - protocol. In this example a new input message for the 'Add' operation is created. - The input message in the ServiceDescription instance is loaded with values for - 'InputMessage'. The instance is then written to 'MathService_new_cs.wsdl'. -*/ - -// -using System; -using System.Xml; -using System.Web.Services; -using System.Web.Services.Description; - -class MyOperationMessageSample -{ - static void Main() - { - try - { - ServiceDescription myDescription = - ServiceDescription.Read("MathService_input_cs.wsdl"); - PortTypeCollection myPortTypeCollection = - myDescription.PortTypes; - - // Get the OperationCollection for the SOAP protocol. - OperationCollection myOperationCollection = - myPortTypeCollection[0].Operations; - - // Get the OperationMessageCollection for the Add operation. - OperationMessageCollection myOperationMessageCollection = - myOperationCollection[0].Messages; - -// -// -// - OperationMessage myInputOperationMessage = - (OperationMessage) new OperationInput(); - XmlQualifiedName myXmlQualifiedName = new XmlQualifiedName( - "AddSoapIn", myDescription.TargetNamespace); - myInputOperationMessage.Message = myXmlQualifiedName; -// - myOperationMessageCollection.Insert(0, myInputOperationMessage); - - // Display the operation name of the InputMessage. - Console.WriteLine("The operation name is " + - myInputOperationMessage.Operation.Name); - -// -// - // Add the OperationMessage to the collection. - myDescription.Write("MathService_new_cs.wsdl"); - } - catch(Exception e) - { - Console.WriteLine("Exception caught!!!"); - Console.WriteLine("Source : " + e.Source); - Console.WriteLine("Message : " + e.Message); - } - } -} -// diff --git a/snippets/csharp/System.Web.Services.Description/OperationMessageCollection/Overview/MathService_cs.asmx b/snippets/csharp/System.Web.Services.Description/OperationMessageCollection/Overview/MathService_cs.asmx deleted file mode 100644 index 1e882c1d6b9..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationMessageCollection/Overview/MathService_cs.asmx +++ /dev/null @@ -1,33 +0,0 @@ -<%@ WebService Language="C#" Class="MathService" %> - -using System; -using System.Web.Services; - -public class MathService : WebService { - - [WebMethod] - public float Add(float a, float b) - { - return a + b; - } - - [WebMethod] - public float Subtract(float a, float b) - { - return a - b; - } - - [WebMethod] - public float Multiply(float a, float b) - { - return a * b; - } - - [WebMethod] - public float Divide(float a, float b) - { - if (b==0) return -1; - return a / b; - } - -} \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/OperationMessageCollection/Overview/MathService_input_cs.wsdl b/snippets/csharp/System.Web.Services.Description/OperationMessageCollection/Overview/MathService_input_cs.wsdl deleted file mode 100644 index 506e00172b5..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationMessageCollection/Overview/MathService_input_cs.wsdl +++ /dev/null @@ -1,329 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/OperationMessageCollection/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/OperationMessageCollection/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationMessageCollection/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/OperationMessageCollection/Overview/operationmessagecollection_sample.cs b/snippets/csharp/System.Web.Services.Description/OperationMessageCollection/Overview/operationmessagecollection_sample.cs deleted file mode 100644 index c042511d34c..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationMessageCollection/Overview/operationmessagecollection_sample.cs +++ /dev/null @@ -1,139 +0,0 @@ -// System.Web.Services.Description.OperationMessageCollection -// System.Web.Services.Description.OperationMessageCollection.Item -// System.Web.Services.Description.OperationMessageCollection.CopyTo -// System.Web.Services.Description.OperationMessageCollection.Add -// System.Web.Services.Description.OperationMessageCollection.Contains -// System.Web.Services.Description.OperationMessageCollection.IndexOf -// System.Web.Services.Description.OperationMessageCollection.Remove -// System.Web.Services.Description.OperationMessageCollection.Insert -// System.Web.Services.Description.OperationMessageCollection.Flow -// System.Web.Services.Description.OperationMessageCollection.Input -// System.Web.Services.Description.OperationMessageCollection.Output - -/* - The following example demonstrates the usage of the - 'OperationMessageCollection' class and various methods and properties of it. - The input to the program is a WSDL file 'MathService_input_vb.wsdl' without - the input message of 'Add' operation for the SOAP - protocol. In a way, it tries to simulate a scenario - wherein the operation flow was 'Notification', however later operation - flow changed to 'Request-Response'. The WSDL file is - modified by inserting a new input message for the 'Add' operation. The - input message in the ServiceDescription instance is loaded with values for - 'Input Message'. The instance is then written to 'MathService_new_vb.wsdl'. - -*/ - -// -using System; -using System.Xml; -using System.Web.Services; -using System.Web.Services.Description; - -class MyOperationMessageCollectionSample -{ - static void Main() - { - try - { - ServiceDescription myDescription = - ServiceDescription.Read("MathService_input_cs.wsdl"); - PortTypeCollection myPortTypeCollection = - myDescription.PortTypes; - - // Get the OperationCollection for the SOAP protocol. - OperationCollection myOperationCollection = - myPortTypeCollection[0].Operations; - - // Get the OperationMessageCollection for the Add operation. - OperationMessageCollection myOperationMessageCollection = - myOperationCollection[0].Messages; - - // Display the Flow, Input, and Output properties. - DisplayFlowInputOutput(myOperationMessageCollection, "Start"); - -// -// - // Get the operation message for the Add operation. - OperationMessage myOperationMessage = - myOperationMessageCollection[0]; - OperationMessage myInputOperationMessage = - (OperationMessage) new OperationInput(); - XmlQualifiedName myXmlQualifiedName = new XmlQualifiedName( - "AddSoapIn", myDescription.TargetNamespace); - myInputOperationMessage.Message = myXmlQualifiedName; - -// - OperationMessage[] myCollection = - new OperationMessage[myOperationMessageCollection.Count]; - myOperationMessageCollection.CopyTo(myCollection, 0); - Console.WriteLine("Operation name(s) :"); - for (int i = 0; i < myCollection.Length ; i++) - { - Console.WriteLine(" " + myCollection[i].Operation.Name); - } - -// - // Add the OperationMessage to the collection. - myOperationMessageCollection.Add(myInputOperationMessage); -// - DisplayFlowInputOutput(myOperationMessageCollection, "Add"); - -// -// - if(myOperationMessageCollection.Contains(myOperationMessage)) - { - int myIndex = - myOperationMessageCollection.IndexOf(myOperationMessage); - Console.WriteLine(" The index of the Add operation " + - "message in the collection is : " + myIndex); - } -// -// -// - -// -// - myOperationMessageCollection.Remove(myInputOperationMessage); - - // Display Flow, Input, and Output after removing. - DisplayFlowInputOutput(myOperationMessageCollection, "Remove"); - - // Insert the message at index 0 in the collection. - myOperationMessageCollection.Insert(0, myInputOperationMessage); - - // Display Flow, Input, and Output after inserting. - DisplayFlowInputOutput(myOperationMessageCollection, "Insert"); -// -// - - myDescription.Write("MathService_new_cs.wsdl"); - } - catch(Exception e) - { - Console.WriteLine("Exception caught!!!"); - Console.WriteLine("Source : " + e.Source); - Console.WriteLine("Message : " + e.Message); - } - } - -// -// -// - // Displays the properties of the OperationMessageCollection. - public static void DisplayFlowInputOutput( OperationMessageCollection - myOperationMessageCollection, string myOperation) - { - Console.WriteLine("After " + myOperation + ":"); - Console.WriteLine("Flow : " + myOperationMessageCollection.Flow); - Console.WriteLine("The first occurrence of operation Input " + - "in the collection " + myOperationMessageCollection.Input); - Console.WriteLine("The first occurrence of operation Output " + - "in the collection " + myOperationMessageCollection.Output); - Console.WriteLine(); - } -// -// -// -} -// diff --git a/snippets/csharp/System.Web.Services.Description/OperationOutput/Overview/AddNumbersIn_cs.wsdl b/snippets/csharp/System.Web.Services.Description/OperationOutput/Overview/AddNumbersIn_cs.wsdl deleted file mode 100644 index a88208911a3..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationOutput/Overview/AddNumbersIn_cs.wsdl +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/OperationOutput/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/OperationOutput/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationOutput/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/OperationOutput/Overview/Service_cs.asmx b/snippets/csharp/System.Web.Services.Description/OperationOutput/Overview/Service_cs.asmx deleted file mode 100644 index a636570ec5d..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationOutput/Overview/Service_cs.asmx +++ /dev/null @@ -1,17 +0,0 @@ -<%@ WebService Language="C#" Class="Service" %> -using System; -using System.Collections; -using System.ComponentModel; -using System.Data; -using System.Diagnostics; -using System.Web; -using System.Web.Services; - -public class Service: System.Web.Services.WebService -{ - [WebMethod] - public int AddNumbers(int firstNumber,int secondNumber) - { - return firstNumber+secondNumber; - } -} diff --git a/snippets/csharp/System.Web.Services.Description/OperationOutput/Overview/operationoutput_operationoutput.cs b/snippets/csharp/System.Web.Services.Description/OperationOutput/Overview/operationoutput_operationoutput.cs deleted file mode 100644 index 9ad41104153..00000000000 --- a/snippets/csharp/System.Web.Services.Description/OperationOutput/Overview/operationoutput_operationoutput.cs +++ /dev/null @@ -1,133 +0,0 @@ -// System.Web.Services.Description.OperationOutput -// System.Web.Services.Description.OperationOutput.OperationOutput - -/* - The following example demonstrates the usage of the 'OperationOutput' - class and its constructor 'OperationOutput'. It creates a - 'ServiceDescription' object by reading the file 'AddNumbersIn_cs.wsdl' and - then creates 'AddNumbersOut_cs.wsdl' file which corresponds to added - attributes in the 'ServiceDescription' instance. -*/ - -// -using System; -using System.Web.Services.Description; -using System.Collections; -using System.Xml; - -class MyOperationOutputSample -{ - public static void Main() - { - try - { - ServiceDescription myDescription = - ServiceDescription.Read("AddNumbersIn_cs.wsdl"); - - // Add the ServiceHttpPost binding. - Binding myBinding = new Binding(); - myBinding.Name = "ServiceHttpPost"; - XmlQualifiedName myXmlQualifiedName = - new XmlQualifiedName("s0:ServiceHttpPost"); - myBinding.Type = myXmlQualifiedName; - HttpBinding myHttpBinding = new HttpBinding(); - myHttpBinding.Verb = "POST"; - myBinding.Extensions.Add(myHttpBinding); - - // Add the operation name AddNumbers. - OperationBinding myOperationBinding = new OperationBinding(); - myOperationBinding.Name = "AddNumbers"; - HttpOperationBinding myOperation = new HttpOperationBinding(); - myOperation.Location = "/AddNumbers"; - myOperationBinding.Extensions.Add(myOperation); - - // Add the input binding. - InputBinding myInput = new InputBinding(); - MimeContentBinding postMimeContentbinding = - new MimeContentBinding(); - postMimeContentbinding.Type= "application/x-www-form-urlencoded"; - myInput.Extensions.Add(postMimeContentbinding); - - // Add the InputBinding to the OperationBinding. - myOperationBinding.Input = myInput; - - // Add the ouput binding. - OutputBinding myOutput = new OutputBinding(); - MimeXmlBinding postMimeXmlbinding = new MimeXmlBinding(); - postMimeXmlbinding .Part="Body"; - myOutput.Extensions.Add(postMimeXmlbinding); - - // Add the OutPutBinding to the OperationBinding. - myOperationBinding.Output = myOutput; - - myBinding.Operations.Add(myOperationBinding); - myDescription.Bindings.Add(myBinding); - - // Add the port definition. - Port postPort = new Port(); - postPort.Name = "ServiceHttpPost"; - postPort.Binding = new XmlQualifiedName("s0:ServiceHttpPost"); - HttpAddressBinding postAddressBinding = new HttpAddressBinding(); - postAddressBinding.Location = "http://localhost/Service_cs.asmx"; - postPort.Extensions.Add(postAddressBinding); - myDescription.Services[0].Ports.Add(postPort); - - // Add the post port type definition. - PortType postPortType = new PortType(); - postPortType.Name = "ServiceHttpPost"; - Operation postOperation = new Operation(); - postOperation.Name = "AddNumbers"; - OperationMessage postInput = - (OperationMessage)new OperationInput(); - postInput.Message = - new XmlQualifiedName("s0:AddNumbersHttpPostIn"); -// - OperationOutput postOutput = new OperationOutput(); - postOutput.Message = - new XmlQualifiedName("s0:AddNumbersHttpPostOut"); - - postOperation.Messages.Add(postInput); - postOperation.Messages.Add(postOutput); - postPortType.Operations.Add(postOperation); -// - myDescription.PortTypes.Add(postPortType); - - // Add the first message information. - Message postMessage1 = new Message(); - postMessage1.Name="AddNumbersHttpPostIn"; - MessagePart postMessagePart1 = new MessagePart(); - postMessagePart1.Name = "firstnumber"; - postMessagePart1.Type = new XmlQualifiedName("s:string"); - - // Add the second message information. - MessagePart postMessagePart2 = new MessagePart(); - postMessagePart2.Name = "secondnumber"; - postMessagePart2.Type = new XmlQualifiedName("s:string"); - postMessage1.Parts.Add(postMessagePart1); - postMessage1.Parts.Add(postMessagePart2); - Message postMessage2 = new Message(); - postMessage2.Name = "AddNumbersHttpPostOut"; - - // Add the third message information. - MessagePart postMessagePart3 = new MessagePart(); - postMessagePart3.Name = "Body"; - postMessagePart3.Element = new XmlQualifiedName("s0:int"); - postMessage2.Parts.Add(postMessagePart3); - - myDescription.Messages.Add(postMessage1); - myDescription.Messages.Add(postMessage2); - - // Write the ServiceDescription as a WSDL file. - myDescription.Write("AddNumbersOut_cs.wsdl"); - Console.WriteLine("WSDL file named AddNumbersOut_cs.Wsdl" + - " created successfully."); - } - catch(Exception e) - { - Console.WriteLine("Exception caught!!!"); - Console.WriteLine("Source : " + e.Source); - Console.WriteLine("Message : " + e.Message); - } - } -} -// diff --git a/snippets/csharp/System.Web.Services.Description/Port/Overview/AddNumbers_cs.wsdl b/snippets/csharp/System.Web.Services.Description/Port/Overview/AddNumbers_cs.wsdl deleted file mode 100644 index 68b05124601..00000000000 --- a/snippets/csharp/System.Web.Services.Description/Port/Overview/AddNumbers_cs.wsdl +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/Port/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/Port/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/Port/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/Port/Overview/portclass.cs b/snippets/csharp/System.Web.Services.Description/Port/Overview/portclass.cs deleted file mode 100644 index 288d490e7fa..00000000000 --- a/snippets/csharp/System.Web.Services.Description/Port/Overview/portclass.cs +++ /dev/null @@ -1,151 +0,0 @@ -// System.Web.Services.Description.Port.ctor(). -// System.Web.Services.Description.Port.Binding(). -// System.Web.Services.Description.Portt.Extensions. -// System.Web.Services.Description.Port.Name. -// System.Web.Services.Description.Port.Service. - -/* The following example demonstrates the constructor and the properties 'Binding', - 'Extensions','Name', and 'Service' of the 'Port' class. - The input to the program is a WSDL file 'AddNumbers_cs.wsdl'. - It creates a 'ServiceDescription' instance by using the static read method - of 'ServiceDescription' by passing the 'AddNumbers.wsdl' name as an argument. - It creates a 'Binding' object and adds that binding object to - 'ServiceDescription'. It adds the 'PortType',Messages to the 'ServiceDescription' - object. Finally it writes the 'ServiceDescrption' as a WSDL file with - name 'AddNumbersOne.wsdl. - */ - -using System; -using System.Web.Services.Description; -using System.Web; -using System.Collections; -using System.Xml; - -class PortClass -{ - public static void Main() - { - try - { - ServiceDescription myDescription = ServiceDescription.Read("AddNumbers_cs.wsdl"); - // Create the 'Binding' object. - Binding myBinding = new Binding(); - myBinding.Name = "PortServiceHttpPost"; - XmlQualifiedName qualifiedName = new XmlQualifiedName("s0:PortServiceHttpPost"); - myBinding.Type = qualifiedName; - - // Create the 'HttpBinding' object. - HttpBinding myHttpBinding = new HttpBinding(); - myHttpBinding.Verb="POST"; - // Add the 'HttpBinding' to the 'Binding'. - myBinding.Extensions.Add(myHttpBinding); - // Create the 'OperationBinding' object. - OperationBinding myOperationBinding = new OperationBinding(); - myOperationBinding.Name = "AddNumbers"; - HttpOperationBinding myOperation = new HttpOperationBinding(); - myOperation.Location="/AddNumbers"; - // Add the 'HttpOperationBinding' to 'OperationBinding'. - myOperationBinding.Extensions.Add(myOperation); - - // Create the 'InputBinding' object. - InputBinding myInput = new InputBinding(); - MimeContentBinding postMimeContentbinding = new MimeContentBinding(); - postMimeContentbinding.Type="application/x-www-form-urlencoded"; - myInput.Extensions.Add(postMimeContentbinding); - // Add the 'InputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInput; - // Create the 'OutputBinding' object. - OutputBinding myOutput = new OutputBinding(); - MimeXmlBinding postMimeXmlbinding = new MimeXmlBinding(); - postMimeXmlbinding .Part="Body"; - myOutput.Extensions.Add(postMimeXmlbinding); - - // Add the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding.Output = myOutput; - // Add the 'OperationBinding' to 'Binding'. - myBinding.Operations.Add(myOperationBinding); - - // Add the 'Binding' to 'BindingCollection' of 'ServiceDescription'. - myDescription.Bindings.Add(myBinding); -// -// -// -// -// - // Create a Port. - Port postPort = new Port(); - postPort.Name = "PortServiceHttpPost"; - postPort.Binding = new XmlQualifiedName("s0:PortServiceHttpPost"); -// -// - - // Create an HttpAddressBinding. - HttpAddressBinding postAddressBinding = new HttpAddressBinding(); - postAddressBinding.Location = - "http://localhost/PortClass/PortService_cs.asmx"; - - // Add the HttpAddressBinding to the Port. - postPort.Extensions.Add(postAddressBinding); -// - - // Get the Service of the postPort. - Service myService = postPort.Service; - - // Print the service name for the port. - Console.WriteLine("This is the service name of the postPort:*" + - myDescription.Services[0].Ports[0].Service.Name + "*"); - - // Add the Port to the PortCollection of the ServiceDescription. - myDescription.Services[0].Ports.Add(postPort); -// -// - // Create a 'PortType' object. - PortType postPortType = new PortType(); - postPortType.Name = "PortServiceHttpPost"; - Operation postOperation = new Operation(); - postOperation.Name = "AddNumbers"; - OperationMessage postInput = (OperationMessage)new OperationInput(); - postInput.Message = new XmlQualifiedName("s0:AddNumbersHttpPostIn"); - OperationMessage postOutput = (OperationMessage)new OperationOutput(); - postOutput.Message = new XmlQualifiedName("s0:AddNumbersHttpPostOut"); - postOperation.Messages.Add(postInput); - postOperation.Messages.Add(postOutput); - // Add the 'Operation' to 'PortType'. - postPortType.Operations.Add(postOperation); - // Adds the 'PortType' to 'PortTypeCollection' of 'ServiceDescription'. - myDescription.PortTypes.Add(postPortType); - // Create the 'Message' object. - Message postMessage1 = new Message(); - postMessage1.Name="AddNumbersHttpPostIn"; - // Create the 'MessageParts'. - MessagePart postMessagePart1 = new MessagePart(); - postMessagePart1.Name = "firstnumber"; - postMessagePart1.Type = new XmlQualifiedName("s:string"); - MessagePart postMessagePart2 = new MessagePart(); - postMessagePart2.Name = "secondnumber"; - postMessagePart2.Type = new XmlQualifiedName("s:string"); - // Add the 'MessagePart' objects to 'Messages'. - postMessage1.Parts.Add(postMessagePart1); - postMessage1.Parts.Add(postMessagePart2); - // Create another 'Message' object. - Message postMessage2 = new Message(); - postMessage2.Name = "AddNumbersHttpPostOut"; - MessagePart postMessagePart3 = new MessagePart(); - postMessagePart3.Name = "Body"; - postMessagePart3.Element = new XmlQualifiedName("s0:int"); - // Add the 'MessagePart' to 'Message' - postMessage2.Parts.Add(postMessagePart3); - // Add the 'Message' objects to 'ServiceDescription'. - myDescription.Messages.Add(postMessage1); - myDescription.Messages.Add(postMessage2); - // Write the 'ServiceDescription' as a WSDL file. - myDescription.Write("AddNumbersOne.wsdl"); - Console.WriteLine("WSDL file with name 'AddNumbersOne.Wsdl' file created Successfully"); - } - - catch (Exception ex) - { - Console.WriteLine("Exception " + ex.Message + " occurred"); - } - } -} diff --git a/snippets/csharp/System.Web.Services.Description/PortCollection/Add/MathServiceAdd_cs.wsdl b/snippets/csharp/System.Web.Services.Description/PortCollection/Add/MathServiceAdd_cs.wsdl deleted file mode 100644 index 3d1e7e50372..00000000000 --- a/snippets/csharp/System.Web.Services.Description/PortCollection/Add/MathServiceAdd_cs.wsdl +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/PortCollection/Add/Project.csproj b/snippets/csharp/System.Web.Services.Description/PortCollection/Add/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/PortCollection/Add/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/PortCollection/Add/portcollection_add.cs b/snippets/csharp/System.Web.Services.Description/PortCollection/Add/portcollection_add.cs deleted file mode 100644 index 3605a61db6e..00000000000 --- a/snippets/csharp/System.Web.Services.Description/PortCollection/Add/portcollection_add.cs +++ /dev/null @@ -1,81 +0,0 @@ -// System.Web.Services.Description.PortCollection.Contains -// System.Web.Services.Description.PortCollection.Add - -/* - The following sample reads the contents of a file 'MathServiceAdd_cs.wsdl' - into a 'ServiceDescription' instance. It gets the collection of Service - instances from 'ServiceDescription'. It then adds a new port and checks - whether a port exists. The programs writes a new web service description - file. -*/ - -using System; -using System.Web.Services.Description; -using System.Xml; - -class PortCollection_2 -{ - public static void Main() - { - try - { - Service myService; - PortCollection myPortCollection; - - ServiceDescription myServiceDescription = - ServiceDescription.Read("MathServiceAdd_cs.wsdl"); - - Console.WriteLine("\nTotal Number of Services :" - + myServiceDescription.Services.Count); - - for(int i=0; i < myServiceDescription.Services.Count; ++i) - { - myService = myServiceDescription.Services[i]; - Console.WriteLine("Name : " + myService.Name); - // - // - - myPortCollection = myService.Ports; - Port myNewPort = myPortCollection[0]; - - myPortCollection.Remove(myNewPort); - - // Display the number of ports. - Console.WriteLine("\nTotal number of ports before" - + " adding a new port : " + myService.Ports.Count); - - // Add a new port. - myPortCollection.Add(myNewPort); - - // Display the number of ports after adding a port. - Console.WriteLine("Total number of ports after" - + " adding a new port : " + myService.Ports.Count); - - // - - bool bContain = myPortCollection.Contains(myNewPort); - - Console.WriteLine("\nPort '"+myNewPort.Name + "' exists : " - + bContain ); - - // Remove a port from the collection. - myPortCollection.Remove(myPortCollection[myNewPort.Name]); - - bContain = myPortCollection.Contains(myNewPort); - - Console.WriteLine("Port '"+ myNewPort.Name + "' exists : " - + bContain ); - - // Create the description file. - myPortCollection.Insert(0, myNewPort); - myServiceDescription.Write("MathServiceAddNew_cs.wsdl"); - - // - } - } - catch(Exception ex) - { - Console.WriteLine("Exception:"+ ex.Message); - } - } -} diff --git a/snippets/csharp/System.Web.Services.Description/PortCollection/CopyTo/MathServiceCopyTo_cs.wsdl b/snippets/csharp/System.Web.Services.Description/PortCollection/CopyTo/MathServiceCopyTo_cs.wsdl deleted file mode 100644 index 74e2cc35e27..00000000000 --- a/snippets/csharp/System.Web.Services.Description/PortCollection/CopyTo/MathServiceCopyTo_cs.wsdl +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/PortCollection/CopyTo/Project.csproj b/snippets/csharp/System.Web.Services.Description/PortCollection/CopyTo/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/PortCollection/CopyTo/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/PortCollection/CopyTo/portcollection_copyto.cs b/snippets/csharp/System.Web.Services.Description/PortCollection/CopyTo/portcollection_copyto.cs deleted file mode 100644 index e1fe2914d7f..00000000000 --- a/snippets/csharp/System.Web.Services.Description/PortCollection/CopyTo/portcollection_copyto.cs +++ /dev/null @@ -1,77 +0,0 @@ -// System.Web.Services.Description.PortCollection.Insert -// System.Web.Services.Description.PortCollection.IndexOf -// System.Web.Services.Description.PortCollection.CopyTo -/* - The following sample reads the contents of a file 'MathService.wsdl' - into a 'ServiceDescription' instance. It gets the collection of Service - instances from 'ServiceDescription'. It instantiates 'PortCollection' for - each service in the collection. 'CopyTo' is called to copy - the contents into an array. Calls 'IndexOf' for a given port. - 'Insert' method is called to insert a new port in the collection. -*/ - -using System; -using System.Web.Services.Description; -using System.Xml; - -class PortCollection_3 -{ - public static void Main() - { - try - { - - Service myService; - PortCollection myPortCollection; - - ServiceDescription myServiceDescription = - ServiceDescription.Read("MathServiceCopyTo_cs.wsdl"); - - Console.WriteLine("Total Number of Services :" - + myServiceDescription.Services.Count); - - for(int i=0; i < myServiceDescription.Services.Count; ++i) - { - myService = myServiceDescription.Services[i]; - Console.WriteLine("Name : " + myService.Name); - -// -// -// - myPortCollection = myService.Ports; - - // Create an array of Port objects. - Console.WriteLine("\nPort collection :"); - Port[] myPortArray = new Port[myService.Ports.Count]; - myPortCollection.CopyTo(myPortArray, 0); - for(int i1=0 ; i1 < myService.Ports.Count ; ++i1) - { - Console.WriteLine("Port[" + i1+ "] : " + myPortArray[i1].Name); - } -// - Port myIndexPort = myPortCollection[0]; - Console.WriteLine("\n\nThe index of port '" - + myIndexPort.Name + "' is : " - + myPortCollection.IndexOf(myIndexPort)); -// - - Port myPortTestInsert =myPortCollection[0]; - myPortCollection.Remove(myPortTestInsert); - myPortCollection.Insert(0, myPortTestInsert); - Console.WriteLine("\n\nTotal Number of Ports after inserting " - + "a new port '" + myPortTestInsert.Name +"' is : " - + myService.Ports.Count); - for(int i1=0 ; i1 < myService.Ports.Count ; ++i1) - { - Console.WriteLine("Port[" + i1+"] : " + myPortArray[i1].Name); - } - myServiceDescription.Write("MathServiceCopyToNew_cs.wsdl"); -// - } - } - catch(Exception ex) - { - Console.WriteLine("Exception:"+ex.Message); - } - } -} diff --git a/snippets/csharp/System.Web.Services.Description/PortCollection/Overview/MathServiceItem_cs.wsdl b/snippets/csharp/System.Web.Services.Description/PortCollection/Overview/MathServiceItem_cs.wsdl deleted file mode 100644 index 8b205b078be..00000000000 --- a/snippets/csharp/System.Web.Services.Description/PortCollection/Overview/MathServiceItem_cs.wsdl +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/PortCollection/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/PortCollection/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/PortCollection/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/PortCollection/Overview/portcollection_item.cs b/snippets/csharp/System.Web.Services.Description/PortCollection/Overview/portcollection_item.cs deleted file mode 100644 index 52938193198..00000000000 --- a/snippets/csharp/System.Web.Services.Description/PortCollection/Overview/portcollection_item.cs +++ /dev/null @@ -1,85 +0,0 @@ -// System.Web.Services.Description.PortCollection -// System.Web.Services.Description.PortCollection.Remove -// System.Web.Services.Description.PortCollection.Item(String) -// System.Web.Services.Description.PortCollection.Item(Int32) -/* - The following sample reads the contents of a file 'MathService_cs.wsdl' - into a 'ServiceDescription' instance. It gets the collection of Service - instances from 'ServiceDescription'. It instantiates 'PortCollection' for - each service in the collection. It access the ports from the collection and - displays them. It accesses a port by its name from the collection and - displays its index. It adds a new port and calls 'Remove' - to remove the newly added port. The programs writes a new web service - description file. -*/ - -using System; -using System.Web.Services.Description; - -class PortCollection_Item -{ - public static void Main() - { - try - { -// -// -// -// - Service myService; - PortCollection myPortCollection; - - ServiceDescription myServiceDescription = - ServiceDescription.Read("MathServiceItem_cs.wsdl"); - - Console.WriteLine("Total number of services : " - + myServiceDescription.Services.Count); - - for(int i=0; i < myServiceDescription.Services.Count; ++i) - { - myService = myServiceDescription.Services[i]; - Console.WriteLine("Name : " + myService.Name); - - myPortCollection = myService.Ports; - - // Create an array of ports. - Console.WriteLine("\nPort collection :"); - for(int i1=0 ; i1 < myService.Ports.Count ; ++i1) - { - Console.WriteLine("Port[" + i1+"] : " + - myPortCollection[i1].Name); - } -// - - string strPort = myPortCollection[0].Name; - Port myPort = myPortCollection[strPort]; - Console.WriteLine("\nIndex of Port[" + strPort + "] : " + - myPortCollection.IndexOf(myPort)); - -// - - Port myPortTestRemove = myPortCollection[0]; - - Console.WriteLine("\nTotal number of ports before removing " - + "a port '" + myPortTestRemove.Name +"' is : " - + myService.Ports.Count); - - myPortCollection.Remove(myPortTestRemove); - - Console.WriteLine("Total number of ports after removing " - + "a port '" + myPortTestRemove.Name +"' is : " - + myService.Ports.Count); - - // Create the WSDL file. - myPortCollection.Insert(0, myPortTestRemove); - myServiceDescription.Write("MathServiceItemNew_cs.wsdl"); -// -// - } - } - catch(Exception ex) - { - Console.WriteLine("Exception: " + ex.Message); - } - } -} diff --git a/snippets/csharp/System.Web.Services.Description/PortType/Operations/MathService_CS.wsdl b/snippets/csharp/System.Web.Services.Description/PortType/Operations/MathService_CS.wsdl deleted file mode 100644 index 743672eb927..00000000000 --- a/snippets/csharp/System.Web.Services.Description/PortType/Operations/MathService_CS.wsdl +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/PortType/Operations/Project.csproj b/snippets/csharp/System.Web.Services.Description/PortType/Operations/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/PortType/Operations/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/PortType/Operations/porttype.cs b/snippets/csharp/System.Web.Services.Description/PortType/Operations/porttype.cs deleted file mode 100644 index fc79f68b293..00000000000 --- a/snippets/csharp/System.Web.Services.Description/PortType/Operations/porttype.cs +++ /dev/null @@ -1,82 +0,0 @@ -// System.Web.Services.Description.PortType.Operations -// System.Web.Services.Description.PortType.PortType() -// System.Web.Services.Description.PortType.Name - -/*The following sample demonstrates the properties 'Operations','Name' and constructor - 'PortType()' of class 'PortType'. This sample reads the contents of a file 'MathService_cs.wsdl' - into a 'ServiceDescription' instance. It gets the collection of 'PortType' - instances from 'ServiceDescription'. It removes a 'PortType' from the collection, creates a - new 'PortType' and adds it into collection. The programs writes a new web service description - file 'MathService_New.wsdl'. -*/ - -// -using System; -using System.Web.Services.Description; -using System.Xml; - -class MyPortTypeClass -{ - public static void Main() - { - try - { -// -// - PortTypeCollection myPortTypeCollection; - ServiceDescription myServiceDescription = - ServiceDescription.Read("MathService_CS.wsdl"); - - myPortTypeCollection = myServiceDescription.PortTypes; - int noOfPortTypes = myServiceDescription.PortTypes.Count; - Console.WriteLine("\nTotal number of PortTypes : " - + noOfPortTypes); - - PortType myPortType = myPortTypeCollection["MathServiceSoap"]; - myPortTypeCollection.Remove(myPortType); - - // Create a new PortType. - PortType myNewPortType = new PortType(); - myNewPortType.Name = "MathServiceSoap"; - OperationCollection myOperationCollection = - myServiceDescription.PortTypes[0].Operations; - - string inputMsg,outputMsg; - for(int i = 0; i < myOperationCollection.Count; i++) - { - inputMsg = myOperationCollection[i].Name + "SoapIn"; - outputMsg = myOperationCollection[i].Name + "SoapOut"; - Console.WriteLine(" Operation = " + myOperationCollection[i].Name); - myNewPortType.Operations.Add( - CreateOperation(myOperationCollection[i].Name, - inputMsg, outputMsg, myServiceDescription.TargetNamespace)); - } - // Add the PortType to the collection. - myPortTypeCollection.Add(myNewPortType); - noOfPortTypes = myServiceDescription.PortTypes.Count; - Console.WriteLine("\nTotal number of PortTypes : " - + noOfPortTypes); - myServiceDescription.Write("MathService_New.wsdl"); -// -// - } - catch(Exception e) - { - Console.WriteLine("Exception:" + e.Message); - } - } - public static Operation CreateOperation(string operationName, - string inputMessage,string outputMessage,string targetNamespace) - { - Operation myOperation = new Operation(); - myOperation.Name = operationName; - OperationMessage input = (OperationMessage) new OperationInput(); - input.Message = new XmlQualifiedName(inputMessage, targetNamespace); - OperationMessage output = (OperationMessage) new OperationOutput(); - output.Message = new XmlQualifiedName(outputMessage, targetNamespace); - myOperation.Messages.Add(input); - myOperation.Messages.Add(output); - return myOperation; - } -} -// diff --git a/snippets/csharp/System.Web.Services.Description/PortType/Overview/MathService_CS.wsdl b/snippets/csharp/System.Web.Services.Description/PortType/Overview/MathService_CS.wsdl deleted file mode 100644 index 280a169b671..00000000000 --- a/snippets/csharp/System.Web.Services.Description/PortType/Overview/MathService_CS.wsdl +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/PortType/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/PortType/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/PortType/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/PortType/Overview/porttype_class.cs b/snippets/csharp/System.Web.Services.Description/PortType/Overview/porttype_class.cs deleted file mode 100644 index afd2054ac92..00000000000 --- a/snippets/csharp/System.Web.Services.Description/PortType/Overview/porttype_class.cs +++ /dev/null @@ -1,76 +0,0 @@ -// System.Web.Services.Description.PortType - -/* - The following sample demonstrates the class 'PortType'. This sample reads - the contents of a file 'MathService_cs.wsdl' into a 'ServiceDescription' instance. - It gets the collection of 'PortType' instances from 'ServiceDescription'. - It removes a 'PortType' from the collection, creates a new 'PortType' and adds - it into collection. The programs writes a new web service description - file 'MathService_New.wsdl'. -*/ - -// -using System; -using System.Web.Services.Description; -using System.Xml; - -class MyPortTypeClass -{ - public static void Main() - { - try - { - PortTypeCollection myPortTypeCollection; - ServiceDescription myServiceDescription = - ServiceDescription.Read("MathService_CS.wsdl"); - - myPortTypeCollection = myServiceDescription.PortTypes; - int noOfPortTypes = myServiceDescription.PortTypes.Count; - Console.WriteLine("\nTotal number of PortTypes : " - + noOfPortTypes); - - PortType myPortType = myPortTypeCollection["MathServiceSoap"]; - myPortTypeCollection.Remove(myPortType); - - // Create a new PortType. - PortType myNewPortType = new PortType(); - myNewPortType.Name = "MathServiceSoap"; - OperationCollection myOperationCollection = - myServiceDescription.PortTypes[0].Operations; - for(int i=0;i diff --git a/snippets/csharp/System.Web.Services.Description/PortTypeCollection/Add/MathService_CS.wsdl b/snippets/csharp/System.Web.Services.Description/PortTypeCollection/Add/MathService_CS.wsdl deleted file mode 100644 index 6ea0df9529e..00000000000 --- a/snippets/csharp/System.Web.Services.Description/PortTypeCollection/Add/MathService_CS.wsdl +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/PortTypeCollection/Add/Project.csproj b/snippets/csharp/System.Web.Services.Description/PortTypeCollection/Add/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/PortTypeCollection/Add/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/PortTypeCollection/Add/porttypecollection_1.cs b/snippets/csharp/System.Web.Services.Description/PortTypeCollection/Add/porttypecollection_1.cs deleted file mode 100644 index 0688cd130d6..00000000000 --- a/snippets/csharp/System.Web.Services.Description/PortTypeCollection/Add/porttypecollection_1.cs +++ /dev/null @@ -1,67 +0,0 @@ -// System.Web.Services.Description.PortTypeCollection.Item[int] -// System.Web.Services.Description.PortTypeCollection.Remove() -// System.Web.Services.Description.PortTypeCollection.Add() - -/*The following sample demonstrates the indexer 'Item[int]', methods - 'Remove()' and 'Add()' of class 'PortTypeCollection'. It reads the - contents of a file 'MathService.wsdl'into a 'ServiceDescription' instance. - It gets the collection of 'PortType' from 'ServiceDescription' and adds - a new PortType and writes a new web service description file into - 'MathService_New.wsdl'. -*/ - -using System; -using System.Web.Services.Description; -using System.Xml; - -class MyPortTypeCollectionClass -{ - public static void Main() - { - try - { -// -// -// - ServiceDescription myServiceDescription = - ServiceDescription.Read("MathService_CS.wsdl"); - PortTypeCollection myPortTypeCollection = - myServiceDescription.PortTypes; - - int noOfPortTypes = myServiceDescription.PortTypes.Count; - Console.WriteLine("\nTotal number of PortTypes: " - + myServiceDescription.PortTypes.Count); - - // Get the first PortType in the collection. - PortType myNewPortType = myPortTypeCollection[0]; - Console.WriteLine( - "The PortType at index 0 is: " + myNewPortType.Name); - Console.WriteLine("Removing the PortType " + myNewPortType.Name); - - // Remove the PortType from the collection. - myPortTypeCollection.Remove(myNewPortType); - - // Display the number of PortTypes. - Console.WriteLine("\nTotal number of PortTypes after removing: " - + myServiceDescription.PortTypes.Count); - - Console.WriteLine("Adding a PortType " + myNewPortType.Name); - - // Add a new PortType from the collection. - myPortTypeCollection.Add(myNewPortType); - - // Display the number of PortTypes after adding a port. - Console.WriteLine("Total number of PortTypes after " + - "adding a new port: " + myServiceDescription.PortTypes.Count); - - myServiceDescription.Write("MathService_New.wsdl"); -// -// -// - } - catch(Exception e) - { - Console.WriteLine("Exception: " + e.Message); - } - } -} diff --git a/snippets/csharp/System.Web.Services.Description/PortTypeCollection/Contains/MathService_CS.wsdl b/snippets/csharp/System.Web.Services.Description/PortTypeCollection/Contains/MathService_CS.wsdl deleted file mode 100644 index 167629a630b..00000000000 --- a/snippets/csharp/System.Web.Services.Description/PortTypeCollection/Contains/MathService_CS.wsdl +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/PortTypeCollection/Contains/Project.csproj b/snippets/csharp/System.Web.Services.Description/PortTypeCollection/Contains/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/PortTypeCollection/Contains/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/PortTypeCollection/Contains/porttypecollection_2.cs b/snippets/csharp/System.Web.Services.Description/PortTypeCollection/Contains/porttypecollection_2.cs deleted file mode 100644 index dc08e8cb914..00000000000 --- a/snippets/csharp/System.Web.Services.Description/PortTypeCollection/Contains/porttypecollection_2.cs +++ /dev/null @@ -1,77 +0,0 @@ -// System.Web.Services.Description.PortTypeCollection.Contains() -// System.Web.Services.Description.PortTypeCollection.Insert() -// System.Web.Services.Description.PortTypeCollection.IndexOf() -// System.Web.Services.Description.PortTypeCollection.Item[string] - -/* - The following sample demonstrates the methods 'IndexOf()','Insert()','Contains()' and - indexer 'Item[string]' of class 'PortTypeCollection'. This sample reads the contents - of 'MathService.wsdl' into a 'ServiceDescription' instance. It gets the collection of - 'PortType' instances from 'ServiceDescription'. It removes a 'PortType' with the name - 'MathServiceSoap' and adds the same later. Then it checks whether the collection contains - the added 'PortType'. The sample writes a new web service description file 'MathService_New.wsdl'. -*/ - -using System; -using System.Web.Services.Description; -using System.Xml; - -class MyPortTypeCollectionClass -{ - public static void Main() - { - try - { -// -// -// -// - ServiceDescription myServiceDescription = - ServiceDescription.Read("MathService_CS.wsdl"); - - PortTypeCollection myPortTypeCollection = - myServiceDescription.PortTypes; - int noOfPortTypes = myServiceDescription.PortTypes.Count; - Console.WriteLine("\nTotal number of PortTypes: " + noOfPortTypes); - - PortType myNewPortType = myPortTypeCollection["MathServiceSoap"]; - -// - // Get the index in the collection. - int index = myPortTypeCollection.IndexOf(myNewPortType); -// - Console.WriteLine("Removing the PortType named " - + myNewPortType.Name); - - // Remove the PortType from the collection. - myPortTypeCollection.Remove(myNewPortType); - noOfPortTypes = myServiceDescription.PortTypes.Count; - Console.WriteLine("\nTotal number of PortTypes: " - + noOfPortTypes); - - // Check whether the PortType exists in the collection. - bool bContains = myPortTypeCollection.Contains(myNewPortType); - Console.WriteLine("Port Type'" + myNewPortType.Name + "' exists: " - + bContains ); - - Console.WriteLine("Adding the PortType"); - // Insert a new portType at the index location. - myPortTypeCollection.Insert(index, myNewPortType); -// - - // Display the number of portTypes after adding a port. - Console.WriteLine("Total number of PortTypes after " - + "adding a new port: " + myServiceDescription.PortTypes.Count); - - bContains = myPortTypeCollection.Contains(myNewPortType); - Console.WriteLine("Port Type'" + myNewPortType.Name + "' exists: " - + bContains ); - myServiceDescription.Write("MathService_New.wsdl"); -// - } - catch(Exception e) - { - Console.WriteLine("Exception: " + e.Message); - } - } -} diff --git a/snippets/csharp/System.Web.Services.Description/PortTypeCollection/CopyTo/MathService.CS.asmx b/snippets/csharp/System.Web.Services.Description/PortTypeCollection/CopyTo/MathService.CS.asmx deleted file mode 100644 index 1e882c1d6b9..00000000000 --- a/snippets/csharp/System.Web.Services.Description/PortTypeCollection/CopyTo/MathService.CS.asmx +++ /dev/null @@ -1,33 +0,0 @@ -<%@ WebService Language="C#" Class="MathService" %> - -using System; -using System.Web.Services; - -public class MathService : WebService { - - [WebMethod] - public float Add(float a, float b) - { - return a + b; - } - - [WebMethod] - public float Subtract(float a, float b) - { - return a - b; - } - - [WebMethod] - public float Multiply(float a, float b) - { - return a * b; - } - - [WebMethod] - public float Divide(float a, float b) - { - if (b==0) return -1; - return a / b; - } - -} \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/PortTypeCollection/CopyTo/MathService_CS.wsdl b/snippets/csharp/System.Web.Services.Description/PortTypeCollection/CopyTo/MathService_CS.wsdl deleted file mode 100644 index a29e0e38dc5..00000000000 --- a/snippets/csharp/System.Web.Services.Description/PortTypeCollection/CopyTo/MathService_CS.wsdl +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/PortTypeCollection/CopyTo/Project.csproj b/snippets/csharp/System.Web.Services.Description/PortTypeCollection/CopyTo/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/PortTypeCollection/CopyTo/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/PortTypeCollection/CopyTo/mathserviceclient.cs.aspx b/snippets/csharp/System.Web.Services.Description/PortTypeCollection/CopyTo/mathserviceclient.cs.aspx deleted file mode 100644 index d6b84e7dd7d..00000000000 --- a/snippets/csharp/System.Web.Services.Description/PortTypeCollection/CopyTo/mathserviceclient.cs.aspx +++ /dev/null @@ -1,105 +0,0 @@ -<%@ Page Language="C#" Debug="true" %> - - - -

- Using a Simple Math Service -

-
-
- First Number: -
- -
- Second Number: -
- -

- - - -

- -

-
- - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/PortTypeCollection/CopyTo/porttypecollection_copyto.cs b/snippets/csharp/System.Web.Services.Description/PortTypeCollection/CopyTo/porttypecollection_copyto.cs deleted file mode 100644 index 660beccbf53..00000000000 --- a/snippets/csharp/System.Web.Services.Description/PortTypeCollection/CopyTo/porttypecollection_copyto.cs +++ /dev/null @@ -1,47 +0,0 @@ -// System.Web.Services.Description.PortTypeCollection.CopyTo() - -/* - The following sample demonstrates the 'CopyTo()' method of the class - 'PortTypeCollection'. This sample reads the contents of a file 'MathService.wsdl' - into a 'ServiceDescription' instance. It gets the collection of 'PortType' - from 'ServiceDescription'. It copies the collection into an array of 'PortType' - and displays their names. -*/ - -using System; -using System.Web.Services.Description; -using System.Xml; - -class MyPortTypeCollectionClass -{ - public static void Main() - { - try - { -// - PortTypeCollection myPortTypeCollection; - - ServiceDescription myServiceDescription = - ServiceDescription.Read("MathService_CS.wsdl"); - - myPortTypeCollection = myServiceDescription.PortTypes; - int noOfPortTypes = myServiceDescription.PortTypes.Count; - Console.WriteLine("\nTotal number of PortTypes: " - + myServiceDescription.PortTypes.Count); - - // Copy the collection into an array. - PortType[] myPortTypeArray = new PortType[noOfPortTypes]; - myPortTypeCollection.CopyTo(myPortTypeArray, 0); - - // Display names of all PortTypes. - for(int i = 0; i < noOfPortTypes; i++) - Console.WriteLine("PortType name: " + myPortTypeArray[i].Name); - myServiceDescription.Write("MathService_New.wsdl"); -// - } - catch(Exception e) - { - Console.WriteLine("Exception: " + e.Message); - } - } -} diff --git a/snippets/csharp/System.Web.Services.Description/PortTypeCollection/Overview/MathService_CS.asmx b/snippets/csharp/System.Web.Services.Description/PortTypeCollection/Overview/MathService_CS.asmx deleted file mode 100644 index 1e882c1d6b9..00000000000 --- a/snippets/csharp/System.Web.Services.Description/PortTypeCollection/Overview/MathService_CS.asmx +++ /dev/null @@ -1,33 +0,0 @@ -<%@ WebService Language="C#" Class="MathService" %> - -using System; -using System.Web.Services; - -public class MathService : WebService { - - [WebMethod] - public float Add(float a, float b) - { - return a + b; - } - - [WebMethod] - public float Subtract(float a, float b) - { - return a - b; - } - - [WebMethod] - public float Multiply(float a, float b) - { - return a * b; - } - - [WebMethod] - public float Divide(float a, float b) - { - if (b==0) return -1; - return a / b; - } - -} \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/PortTypeCollection/Overview/MathService_CS.wsdl b/snippets/csharp/System.Web.Services.Description/PortTypeCollection/Overview/MathService_CS.wsdl deleted file mode 100644 index 88f21576ebf..00000000000 --- a/snippets/csharp/System.Web.Services.Description/PortTypeCollection/Overview/MathService_CS.wsdl +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/PortTypeCollection/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/PortTypeCollection/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/PortTypeCollection/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/PortTypeCollection/Overview/porttypecollection_class.cs b/snippets/csharp/System.Web.Services.Description/PortTypeCollection/Overview/porttypecollection_class.cs deleted file mode 100644 index fa442303980..00000000000 --- a/snippets/csharp/System.Web.Services.Description/PortTypeCollection/Overview/porttypecollection_class.cs +++ /dev/null @@ -1,71 +0,0 @@ -// System.Web.Services.Description.PortTypeCollection - -/* The following sample demonstrates the class 'PortTypeCollection'. It reads the - contents of WSDL document 'MathService.wsdl'into a 'ServiceDescription' instance. - It gets the collection of 'PortType'from 'ServiceDescription'. It copies the - collection into an array of 'PortType' and displays their names. Then it removes a - 'PortType', checks whether the collection contains the removed 'PortType'. - It adds the same 'PortType' and writes a new web service description file into - 'MathService_New.wsdl'. -*/ - -// -using System; -using System.Web.Services.Description; -using System.Xml; -using System.Collections; - -class MyPortTypeCollectionClass -{ - public static void Main() - { - try - { - // Read the existing Web service description file. - ServiceDescription myServiceDescription = - ServiceDescription.Read("MathService_CS.wsdl"); - PortTypeCollection myPortTypeCollection = - myServiceDescription.PortTypes; - int noOfPortTypes = myServiceDescription.PortTypes.Count; - Console.WriteLine("\nTotal number of PortTypes: " - + myServiceDescription.PortTypes.Count); - - // Get the first PortType in the collection. - PortType myNewPortType = myPortTypeCollection["MathServiceSoap"]; - int index = myPortTypeCollection.IndexOf(myNewPortType); - Console.WriteLine("The PortType with the name " + myNewPortType.Name - + " is at index: " + (index+1)); - - Console.WriteLine("Removing the PortType: " + myNewPortType.Name); - - // Remove the PortType from the collection. - myPortTypeCollection.Remove(myNewPortType); - bool bContains = myPortTypeCollection.Contains(myNewPortType); - Console.WriteLine("The PortType with the name " + myNewPortType.Name - + " exists: " + bContains); - - Console.WriteLine("Total number of PortTypes after removing: " - + myServiceDescription.PortTypes.Count); - - Console.WriteLine("Adding a PortType: " + myNewPortType.Name); - - // Add a new portType from the collection. - myPortTypeCollection.Add(myNewPortType); - - // Display the number of portTypes after adding a port. - Console.WriteLine("Total number of PortTypes after " - + "adding a new port: " + myServiceDescription.PortTypes.Count); - - // List the PortTypes available in the WSDL document. - foreach(PortType myPortType in myPortTypeCollection) - Console.WriteLine("The PortType name is: " + myPortType.Name); - - myServiceDescription.Write("MathService_New.wsdl"); - } - catch(Exception e) - { - Console.WriteLine("Exception: " + e.Message); - } - } -} -// diff --git a/snippets/csharp/System.Web.Services.Description/Service/Extensions/MathService_CS.asmx b/snippets/csharp/System.Web.Services.Description/Service/Extensions/MathService_CS.asmx deleted file mode 100644 index 1e882c1d6b9..00000000000 --- a/snippets/csharp/System.Web.Services.Description/Service/Extensions/MathService_CS.asmx +++ /dev/null @@ -1,33 +0,0 @@ -<%@ WebService Language="C#" Class="MathService" %> - -using System; -using System.Web.Services; - -public class MathService : WebService { - - [WebMethod] - public float Add(float a, float b) - { - return a + b; - } - - [WebMethod] - public float Subtract(float a, float b) - { - return a - b; - } - - [WebMethod] - public float Multiply(float a, float b) - { - return a * b; - } - - [WebMethod] - public float Divide(float a, float b) - { - if (b==0) return -1; - return a / b; - } - -} \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/Service/Extensions/MathService_CS.wsdl b/snippets/csharp/System.Web.Services.Description/Service/Extensions/MathService_CS.wsdl deleted file mode 100644 index 2cdf9948d12..00000000000 --- a/snippets/csharp/System.Web.Services.Description/Service/Extensions/MathService_CS.wsdl +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/Service/Extensions/Project.csproj b/snippets/csharp/System.Web.Services.Description/Service/Extensions/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/Service/Extensions/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/Service/Extensions/service_class.cs b/snippets/csharp/System.Web.Services.Description/Service/Extensions/service_class.cs deleted file mode 100644 index f8d7cc86c12..00000000000 --- a/snippets/csharp/System.Web.Services.Description/Service/Extensions/service_class.cs +++ /dev/null @@ -1,103 +0,0 @@ -// System.Web.Services.Description.Service.Ports -// System.Web.Services.Description.Service.Extensions -// System.Web.Services.Description.Service.Service() -// System.Web.Services.Description.Service.Name - -/*The following sample demonstrates the properties 'Ports','Extensions','Name' and - constructor 'Service()'. This sample reads the contents of a file 'MathService_cs.wsdl' - into a 'ServiceDescription' instance. It gets the collection of Service - instances from 'ServiceDescription'. It then removes a 'Service' from the collection and - creates a new 'Service' and adds it into collection. It writes a new web service description - file 'MathService_New.wsdl'. -*/ - -// -using System; -using System.Web.Services.Description; -using System.Xml; - -class MyServiceClass -{ - public static void Main() - { - try - { -// -// -// - ServiceDescription myServiceDescription = - ServiceDescription.Read("MathService_CS.wsdl"); - ServiceCollection myServiceCollection = - myServiceDescription.Services; - - int noOfServices = myServiceCollection.Count; - Console.WriteLine("\nTotal number of services: " + noOfServices); - - // Get a reference to the service. - Service myOldService = myServiceCollection[0]; - Console.WriteLine("No. of Ports in the Service" + - myServiceCollection[0].Ports.Count); - Console.WriteLine("These are the ports in the service:"); - for(int i = 0; i < myOldService.Ports.Count; i++) - Console.WriteLine("Port name: " + myOldService.Ports[i].Name); - Console.WriteLine("Service name: " + myOldService.Name); - - Service myService = new Service(); - myService.Name = "MathService"; - - // Add the ports to the newly created service. - for(int i = 0; i < myOldService.Ports.Count; i++) - { - string PortName = myServiceCollection[0].Ports[i].Name; - string BindingName = - myServiceCollection[0].Ports[i].Binding.Name; - myService.Ports.Add(CreatePort(PortName, BindingName, - myServiceDescription.TargetNamespace)); - } - - Console.WriteLine("Newly created ports -"); - for(int i = 0; i < myService.Ports.Count; i++) - Console.WriteLine("Port Name: " + myOldService.Ports[i].Name); - - // Add the extensions to the newly created service. - int noOfExtensions = myOldService.Extensions.Count; - Console.WriteLine("No. of extensions: " + noOfExtensions); - if (noOfExtensions > 0) - { - for(int i = 0; i -// -// - } - catch(Exception e) - { - Console.WriteLine("Exception: " + e.Message); - } - } - - public static Port CreatePort(string PortName, string BindingName, - string targetNamespace) - { - Port myPort = new Port(); - myPort.Name = PortName; - myPort.Binding = new XmlQualifiedName(BindingName,targetNamespace); - - // Create a SoapAddress extensibility element to add to the port. - SoapAddressBinding mySoapAddressBinding = new SoapAddressBinding(); - mySoapAddressBinding.Location = - "http://localhost/Service_Class/MathService_CS.asmx"; - myPort.Extensions.Add(mySoapAddressBinding); - return myPort; - } -} -// diff --git a/snippets/csharp/System.Web.Services.Description/Service/Overview/MathService_CS.asmx b/snippets/csharp/System.Web.Services.Description/Service/Overview/MathService_CS.asmx deleted file mode 100644 index 1e882c1d6b9..00000000000 --- a/snippets/csharp/System.Web.Services.Description/Service/Overview/MathService_CS.asmx +++ /dev/null @@ -1,33 +0,0 @@ -<%@ WebService Language="C#" Class="MathService" %> - -using System; -using System.Web.Services; - -public class MathService : WebService { - - [WebMethod] - public float Add(float a, float b) - { - return a + b; - } - - [WebMethod] - public float Subtract(float a, float b) - { - return a - b; - } - - [WebMethod] - public float Multiply(float a, float b) - { - return a * b; - } - - [WebMethod] - public float Divide(float a, float b) - { - if (b==0) return -1; - return a / b; - } - -} \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/Service/Overview/MathService_CS.wsdl b/snippets/csharp/System.Web.Services.Description/Service/Overview/MathService_CS.wsdl deleted file mode 100644 index b9451d9f634..00000000000 --- a/snippets/csharp/System.Web.Services.Description/Service/Overview/MathService_CS.wsdl +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/Service/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/Service/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/Service/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/Service/Overview/serviceclass.cs b/snippets/csharp/System.Web.Services.Description/Service/Overview/serviceclass.cs deleted file mode 100644 index 3b31797ae95..00000000000 --- a/snippets/csharp/System.Web.Services.Description/Service/Overview/serviceclass.cs +++ /dev/null @@ -1,93 +0,0 @@ -// System.Web.Services.Description.Service - -/* The following sample demonstrates the class 'Service'. This sample reads the - contents of a file 'MathService_cs.wsdl' into a 'ServiceDescription' instance. - It gets the collection of Service instances from 'ServiceDescription'. It - then removes a 'Service' from the collection and creates a new 'Service' and - adds it into collection. It writes a new web service description file 'MathService_New.wsdl'. -*/ - -// -using System; -using System.Web.Services.Description; -using System.Xml; - -class MyServiceClass -{ - public static void Main() - { - try - { - // Read a WSDL document. - ServiceDescription myServiceDescription = - ServiceDescription.Read("MathService_CS.wsdl"); - ServiceCollection myServiceCollection = - myServiceDescription.Services; - - int noOfServices = myServiceCollection.Count; - Console.WriteLine("\nTotal number of services: " + noOfServices); - - // Gets a reference to the service. - Service myOldService = myServiceCollection[0]; - Console.WriteLine("No. of ports in the service: "+ - myServiceCollection[0].Ports.Count); - Console.WriteLine("These are the ports in the service:"); - for(int i = 0 ; i < myOldService.Ports.Count; i++) - Console.WriteLine("Port name: " + myOldService.Ports[i].Name); - Console.WriteLine("Service name: " + myOldService.Name); - - Service myService = new Service(); - myService.Name = "MathService"; - - // Add the Ports to the newly created Service. - for(int i = 0; i < myOldService.Ports.Count; i++) - { - string PortName = myServiceCollection[0].Ports[i].Name; - string BindingName = myServiceCollection[0].Ports[i].Binding.Name; - myService.Ports.Add(CreatePort(PortName,BindingName, - myServiceDescription.TargetNamespace)); - } - - Console.WriteLine("Newly created ports -"); - for(int i = 0; i < myService.Ports.Count; i++) - Console.WriteLine("Port name: " + myOldService.Ports[i].Name); - - // Add the extensions to the newly created Service. - int noOfExtensions = myOldService.Extensions.Count; - Console.WriteLine("No. of extensions: " + noOfExtensions); - if (noOfExtensions > 0) - { - for(int i = 0; i < myOldService.Ports.Count; i++) - myService.Extensions.Add(myServiceCollection[0].Extensions[i]); - } - - // Remove the service from the collection. - myServiceCollection.Remove(myOldService); - - // Add the newly created service. - myServiceCollection.Add(myService); - - myServiceDescription.Write("MathService_New.wsdl"); - } - catch(Exception e) - { - Console.WriteLine("Exception: " + e.Message); - } - } - - public static Port CreatePort(string PortName,string BindingName, - string targetNamespace) - { - Port myPort = new Port(); - myPort.Name = PortName; - myPort.Binding = new XmlQualifiedName(BindingName,targetNamespace); - - // Create a SoapAddress extensibility element to add to the port. - SoapAddressBinding mySoapAddressBinding = new SoapAddressBinding(); - mySoapAddressBinding.Location = - "http://localhost/ServiceClass/MathService_CS.asmx"; - myPort.Extensions.Add(mySoapAddressBinding); - return myPort; - } -} -// diff --git a/snippets/csharp/System.Web.Services.Description/ServiceCollection/Add/AddSub_CS.asmx b/snippets/csharp/System.Web.Services.Description/ServiceCollection/Add/AddSub_CS.asmx deleted file mode 100644 index 661866d1626..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceCollection/Add/AddSub_CS.asmx +++ /dev/null @@ -1,19 +0,0 @@ -<%@ WebService Language="C#" Class="MathService" %> - -using System; -using System.Web.Services; - -public class MathService: WebService -{ - [WebMethod] - public float Add(float a, float b) - { - return a + b; - } - - [WebMethod] - public float Subtract(float a, float b) - { - return a - b; - } - } \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceCollection/Add/Input_CS.wsdl b/snippets/csharp/System.Web.Services.Description/ServiceCollection/Add/Input_CS.wsdl deleted file mode 100644 index da0eeb9af17..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceCollection/Add/Input_CS.wsdl +++ /dev/null @@ -1,182 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceCollection/Add/Project.csproj b/snippets/csharp/System.Web.Services.Description/ServiceCollection/Add/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceCollection/Add/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/ServiceCollection/Add/servicecollection_item.cs b/snippets/csharp/System.Web.Services.Description/ServiceCollection/Add/servicecollection_item.cs deleted file mode 100644 index 3a8572fcf01..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceCollection/Add/servicecollection_item.cs +++ /dev/null @@ -1,89 +0,0 @@ -// System.Web.Services.Description.ServiceDescription.Write(FileName) -// System.Web.Services.Description.ServiceCollection.Remove -// System.Web.Services.Description.ServiceCollection.Item(int) -// System.Web.Services.Description.ServiceDescription.Services -// System.Web.Services.Description.ServiceDescription.TargetNamespace -// System.Web.Services.Description.ServiceCollection.Add -/* - The following example demonstrates methods and properties of the - ServiceDescription and ServiceCollection classes. - A new WSDL is read and the existing service "MathService" in the - ServiceCollection is removed. The service by default is defined for - SOAP, HttpGet, HttpPost. A new Service defined for SOAP and HttpGet is - constructed and added to the ServiceCollection. - The programs writes a new web service description file. -*/ - -using System; -using System.Web.Services.Description; -using System.Collections; -using System.Xml; - -class MyClass1 -{ - public static void Main() - { -// -// -// -// -// - // Read a ServiceDescription from existing WSDL. - ServiceDescription myServiceDescription = - ServiceDescription.Read("Input_CS.wsdl"); - myServiceDescription.TargetNamespace = "http://tempuri.org/"; -// - - // Get the ServiceCollection of the ServiceDescription. - ServiceCollection myServiceCollection = myServiceDescription.Services; - - // Remove the Service at index 0 of the collection. - myServiceCollection.Remove(myServiceDescription.Services[0]); -// -// -// - -// - // Build a new Service. - Service myService = new Service(); - myService.Name = "MathService"; - XmlQualifiedName myXmlQualifiedName = - new XmlQualifiedName("s0:MathServiceSoap"); - - // Build a new Port for SOAP. - Port mySoapPort= new Port(); - - mySoapPort.Name = "MathServiceSoap"; - - mySoapPort.Binding = myXmlQualifiedName; - - SoapAddressBinding mySoapAddressBinding = new SoapAddressBinding(); - mySoapAddressBinding.Location = - "http://localhost/ServiceCollection_Item/AddSub_CS.asmx"; - mySoapPort.Extensions.Add(mySoapAddressBinding); - - // Build a new Port for HTTP-GET. - XmlQualifiedName myXmlQualifiedName2 = - new XmlQualifiedName("s0:MathServiceHttpGet"); - - Port myHttpGetPort= new Port(); - myHttpGetPort.Name="MathServiceHttpGet"; - myHttpGetPort.Binding=myXmlQualifiedName2; - HttpAddressBinding myHttpAddressBinding = new HttpAddressBinding(); - myHttpAddressBinding.Location = - "http://localhost/ServiceCollection_Item/AddSub_CS.asmx"; - myHttpGetPort.Extensions.Add(myHttpAddressBinding); - - // Add the ports to the service. - myService.Ports.Add(myHttpGetPort); - myService.Ports.Add(mySoapPort); - - // Add the service to the ServiceCollection. - myServiceCollection .Add(myService); -// - - // Write to a new WSDL file. - myServiceDescription.Write("output.wsdl"); -// - } -} diff --git a/snippets/csharp/System.Web.Services.Description/ServiceCollection/Contains/AddService.CS.asmx b/snippets/csharp/System.Web.Services.Description/ServiceCollection/Contains/AddService.CS.asmx deleted file mode 100644 index 837bc54460f..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceCollection/Contains/AddService.CS.asmx +++ /dev/null @@ -1,13 +0,0 @@ -<%@ WebService Language="C#" Class="MathService" %> - -using System; -using System.Web.Services; - -public class MathService: WebService -{ - [WebMethod] - public float Add(float a, float b) - { - return a + b; - } - } \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceCollection/Contains/AddService_CS.wsdl b/snippets/csharp/System.Web.Services.Description/ServiceCollection/Contains/AddService_CS.wsdl deleted file mode 100644 index 94d25d85e7b..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceCollection/Contains/AddService_CS.wsdl +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceCollection/Contains/AddSubtractService_CS.wsdl b/snippets/csharp/System.Web.Services.Description/ServiceCollection/Contains/AddSubtractService_CS.wsdl deleted file mode 100644 index 397dd4d6844..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceCollection/Contains/AddSubtractService_CS.wsdl +++ /dev/null @@ -1,208 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceCollection/Contains/Project.csproj b/snippets/csharp/System.Web.Services.Description/ServiceCollection/Contains/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceCollection/Contains/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/ServiceCollection/Contains/SubtractService.CS.asmx b/snippets/csharp/System.Web.Services.Description/ServiceCollection/Contains/SubtractService.CS.asmx deleted file mode 100644 index 33a0a92bae8..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceCollection/Contains/SubtractService.CS.asmx +++ /dev/null @@ -1,14 +0,0 @@ -<%@ WebService Language="C#" Class="MathService1" %> - -using System; -using System.Web.Services; - -public class MathService1: WebService -{ - [WebMethod] - public float Subtract(float a, float b) - { - return a - b; - } - - } \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceCollection/Contains/SubtractService_CS.wsdl b/snippets/csharp/System.Web.Services.Description/ServiceCollection/Contains/SubtractService_CS.wsdl deleted file mode 100644 index d8e36349632..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceCollection/Contains/SubtractService_CS.wsdl +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceCollection/Contains/servicecollection_copyto.cs b/snippets/csharp/System.Web.Services.Description/ServiceCollection/Contains/servicecollection_copyto.cs deleted file mode 100644 index b5df6e5f8c1..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceCollection/Contains/servicecollection_copyto.cs +++ /dev/null @@ -1,118 +0,0 @@ -// System.Web.Services.Description.ServiceCollection.Contains(Service) -// System.Web.Services.Description.ServiceCollection.IndexOf(service) -// System.Web.Services.Description.ServiceCollection.CopyTo(System[],int) -/* - The following program demonstrates the methods of - ServiceDescription and ServiceCollection class. An existing WSDL document - is read. An exiting service named "MathService" is removed from the - collection. A new Service object is constructed and added at index 1 of the - Collection .A new WSDL file is created as output. -*/ - -using System; -using System.Text; -using System.Web.Services.Description; -using System.Collections; -using System.IO; -using System.Xml; - -class ServiceDescription_Sample -{ - public static void Main() - { - try - { - // Read the Existing Wsdl. - ServiceDescription myServiceDescription= - ServiceDescription.Read("AddSubtractService_CS.wsdl"); - // Remove the service named "MathService". - ServiceCollection myServiceDescriptionCollection= - myServiceDescription.Services; - myServiceDescriptionCollection. - Remove(myServiceDescription.Services["MathService"]); - // Build a new Service. - Service myService =new Service(); - myService.Name="MathService"; - - XmlQualifiedName myXmlQualifiedName= - new XmlQualifiedName("s0:MathServiceSoap"); - // Build a new Port for Soap. - Port mySoapPort= new Port(); - mySoapPort.Name="MathServiceSoap"; - mySoapPort.Binding=myXmlQualifiedName; - SoapAddressBinding mySoapAddressBinding = - new SoapAddressBinding(); - mySoapAddressBinding.Location= - "http://localhost/ServiceCollection_CopyTo/AddSubtractService_CS.asmx"; - mySoapPort.Extensions.Add(mySoapAddressBinding); - - // Build a new Port for HttpGet. - XmlQualifiedName myXmlQualifiedName2= - new XmlQualifiedName("s0:MathServiceHttpGet"); - Port myHttpGetPort= new Port(); - myHttpGetPort.Name="MathServiceHttpGet"; - myHttpGetPort.Binding=myXmlQualifiedName2; - HttpAddressBinding myHttpAddressBinding = - new HttpAddressBinding(); - myHttpAddressBinding.Location= - "http://localhost/ServiceCollection_CopyTo/AddSubtractService_CS.asmx"; - myHttpGetPort.Extensions.Add(myHttpAddressBinding); - // Build a new Port for HttpPost. - XmlQualifiedName myXmlQualifiedName3= - new XmlQualifiedName("s0:MathServiceHttpPost"); - // Build a new Port for Soap. - Port myHttpPostPort= new Port(); - myHttpPostPort.Name="MathServiceHttpPost"; - myHttpPostPort.Binding=myXmlQualifiedName3; - HttpAddressBinding myHttpAddressBinding1 = - new HttpAddressBinding(); - myHttpAddressBinding1.Location= - "http://localhost/ServiceCollection_CopyTo/AddSubtractService_CS.asmx"; - myHttpPostPort.Extensions.Add(myHttpAddressBinding1); - - // Add the ports to the service. - myService.Ports.Add(mySoapPort); - myService.Ports.Add(myHttpGetPort); - myService.Ports.Add(myHttpPostPort); - // Add the Service to the ServiceCollection. - myServiceDescription.Services.Insert(1,myService); - StreamWriter myStreamWriter = new StreamWriter("output.wsdl"); - // Output the Wsdl. - myServiceDescription.Write(myStreamWriter); - myStreamWriter.Close(); - -// -// - if(myServiceDescription.Services.Contains(myService)) - { - Console.WriteLine( - "The mentioned service exists at index {0} in the WSDL.", - myServiceDescription.Services.IndexOf(myService)); -// - Service[] myServiceArray = - new Service[myServiceDescription.Services.Count]; - - // Copy the services into an array. - myServiceDescription.Services.CopyTo(myServiceArray,0); - IEnumerator myEnumerator = myServiceArray.GetEnumerator(); - Console.WriteLine("The names of services in the array are"); - while(myEnumerator.MoveNext()) - { - Service myService1 = (Service)myEnumerator.Current; - Console.WriteLine(myService1.Name); - } -// - } - else - { - Console.WriteLine("Service does not exist in the WSDL." ); - } -// -// - } - catch(Exception e) - { - Console.WriteLine("Exception Caught! " + e.Message); - } - } -} diff --git a/snippets/csharp/System.Web.Services.Description/ServiceCollection/Insert/AddService_CS.wsdl b/snippets/csharp/System.Web.Services.Description/ServiceCollection/Insert/AddService_CS.wsdl deleted file mode 100644 index 3cfd457bb6a..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceCollection/Insert/AddService_CS.wsdl +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceCollection/Insert/All_CS.wsdl b/snippets/csharp/System.Web.Services.Description/ServiceCollection/Insert/All_CS.wsdl deleted file mode 100644 index d31f485425f..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceCollection/Insert/All_CS.wsdl +++ /dev/null @@ -1,208 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceCollection/Insert/Project.csproj b/snippets/csharp/System.Web.Services.Description/ServiceCollection/Insert/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceCollection/Insert/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/ServiceCollection/Insert/SubtractService_CS.wsdl b/snippets/csharp/System.Web.Services.Description/ServiceCollection/Insert/SubtractService_CS.wsdl deleted file mode 100644 index a4ca2c6b010..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceCollection/Insert/SubtractService_CS.wsdl +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceCollection/Insert/servicedescription_read.cs b/snippets/csharp/System.Web.Services.Description/ServiceCollection/Insert/servicedescription_read.cs deleted file mode 100644 index 4bde091f542..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceCollection/Insert/servicedescription_read.cs +++ /dev/null @@ -1,91 +0,0 @@ -// System.Web.Description.ServiceDescription.Read(XmlReader) -// System.Web.Description.ServiceCollection.Item(string) -// System.Web.Description.ServiceCollection.Insert(int,Service) -// System.Web.Description.ServiceDescription.Write(XmlWriter) - -/* - The following program demonstrates the properties of ServiceDescription and - ServiceCollection class.An XmlTextReader with the required url is created. - An existing WSDL document is read. - An existing service named "MathService" is removed from the collection and - A new Service object is constructed and added at index 1 of the Collection of Services. - A new WSDL file is created as output. -*/ - -using System; -using System.Text; -using System.Web.Services.Description; -using System.Collections; -using System.Xml; - -class MyClass -{ - public static void Main() - { - try - { -// -// - // Create a new XmlTextWriter with specified URL. - XmlTextReader myXmlReader = new XmlTextReader("All_CS.wsdl"); - ServiceDescription myServiceDescription = - ServiceDescription.Read(myXmlReader); - myServiceDescription.TargetNamespace = "http://tempuri.org/"; - - // Remove the service named MathService. - ServiceCollection myServiceDescriptionCollection = - myServiceDescription.Services; - myServiceDescriptionCollection.Remove( - myServiceDescription.Services["MathService"]); -// -// - -// - Service myService = new Service(); - myService.Name = "MathService"; - XmlQualifiedName myXmlQualifiedName = - new XmlQualifiedName("s0:MathServiceSoap"); - - // Build a new Port for SOAP. - Port mySoapPort = new Port(); - mySoapPort.Name = "MathServiceSoap"; - mySoapPort.Binding = myXmlQualifiedName; - SoapAddressBinding mySoapAddressBinding = new SoapAddressBinding(); - mySoapAddressBinding.Location = - "http://localhost/ServiceDescription_Read/AddService_CS.asmx"; - mySoapPort.Extensions.Add(mySoapAddressBinding); - - // Build a new Port for HTTP-GET. - XmlQualifiedName myXmlQualifiedName2 = - new XmlQualifiedName("s0:MathServiceHttpGet"); - Port myHttpGetPort = new Port(); - myHttpGetPort.Name = "MathServiceHttpGet"; - myHttpGetPort.Binding = myXmlQualifiedName2; - HttpAddressBinding myHttpAddressBinding = new HttpAddressBinding(); - myHttpAddressBinding.Location = - "http://localhost/ServiceDescription_Read/AddService_CS.asmx"; - myHttpGetPort.Extensions.Add(myHttpAddressBinding); - - // Add the ports to the service. - myService.Ports.Add(myHttpGetPort); - myService.Ports.Add(mySoapPort); - - // Add the service to the ServiceCollection. - myServiceDescription.Services.Insert(1,myService); -// - -// - // Create a new XmlTextWriter object. - XmlTextWriter myWriter = new XmlTextWriter("output.wsdl",Encoding.UTF8); - myWriter.Formatting = Formatting.Indented; - - // Write the WSDL. - myServiceDescription.Write(myWriter); -// - } - catch(Exception e) - { - Console.WriteLine("Exception: " + e.Message); - } - } -} diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Bindings/MyWsdl_CS.wsdl b/snippets/csharp/System.Web.Services.Description/ServiceDescription/Bindings/MyWsdl_CS.wsdl deleted file mode 100644 index 5a8a41903f7..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Bindings/MyWsdl_CS.wsdl +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Bindings/Project.csproj b/snippets/csharp/System.Web.Services.Description/ServiceDescription/Bindings/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Bindings/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Bindings/Service1_CS.asmx b/snippets/csharp/System.Web.Services.Description/ServiceDescription/Bindings/Service1_CS.asmx deleted file mode 100644 index 1a8a5dd3af9..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Bindings/Service1_CS.asmx +++ /dev/null @@ -1,16 +0,0 @@ -<%@ WebService Language="c#" Class="Service1" %> - -// This program creates a WebService to add two numbers. -using System; -using System.Web.Services; - -public class Service1 : WebService -{ - [WebMethod] - public int Add(int a, int b) - { - return(a+b); - } -} - - diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Bindings/servicedescription_bindings.cs b/snippets/csharp/System.Web.Services.Description/ServiceDescription/Bindings/servicedescription_bindings.cs deleted file mode 100644 index 985c6a1a2f9..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Bindings/servicedescription_bindings.cs +++ /dev/null @@ -1,87 +0,0 @@ -// System.Web.Services.Description.ServiceDescription.Bindings - -/* - The following example demonstrates the property 'Bindings' of - 'ServiceDescription' class. The input to the program is a WSDL file - 'MyWsdl_CS.wsdl'. This program removes one 'Binding' from the existing WSDL. - A new Binding is defined and added to the ServiceDescription object. - The program generates a new Web Service Description document. -*/ - -using System; -using System.Web.Services; -using System.Web.Services.Description; -using System.Xml; - -namespace ServiceDescription1 -{ - class MyService - { - static void Main() - { - try - { -// - // Obtain the ServiceDescription from existing WSDL. - ServiceDescription myDescription = - ServiceDescription.Read("MyWsdl_CS.wsdl"); - - // Remove the Binding from the BindingCollection of - // the ServiceDescription. - BindingCollection myBindingCollection = myDescription.Bindings; - myBindingCollection.Remove(myBindingCollection[0]); - - // Form a new Binding. - Binding myBinding = new Binding(); - myBinding.Name = "Service1Soap"; - XmlQualifiedName myXmlQualifiedName = - new XmlQualifiedName("s0:Service1Soap"); - myBinding.Type = myXmlQualifiedName; - - SoapBinding mySoapBinding = new SoapBinding(); - mySoapBinding.Transport = "http://schemas.xmlsoap.org/soap/http"; - mySoapBinding.Style = SoapBindingStyle.Document; - - OperationBinding addOperationBinding = - CreateOperationBinding("Add",myDescription.TargetNamespace); - myBinding.Operations.Add(addOperationBinding); - myBinding.Extensions.Add(mySoapBinding); - - // Add the Binding to the ServiceDescription. - myDescription.Bindings.Add(myBinding); - myDescription.Write("MyOutWsdl.wsdl"); - -// - } - catch(Exception e) - { - Console.WriteLine("Exception: " + e.Message); - } - } - // Used to create OperationBinding instances within 'Binding'. - public static OperationBinding CreateOperationBinding(string operation, string targetNamespace) - { - // Create OperationBinding instance for operation. - OperationBinding myOperationBinding = new OperationBinding(); - myOperationBinding.Name = operation; - // Create InputBinding for operation. - InputBinding myInputBinding = new InputBinding(); - SoapBodyBinding mySoapBodyBinding = new SoapBodyBinding(); - mySoapBodyBinding.Use = SoapBindingUse.Literal; - myInputBinding.Extensions.Add(mySoapBodyBinding); - // Create OutputBinding for operation. - OutputBinding myOutputBinding = new OutputBinding(); - myOutputBinding.Extensions.Add(mySoapBodyBinding); - // Add 'InputBinding' and 'OutputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInputBinding; - myOperationBinding.Output = myOutputBinding; - // Create extensibility element for 'SoapOperationBinding'. - SoapOperationBinding mySoapOperationBinding = new SoapOperationBinding(); - mySoapOperationBinding.Style = SoapBindingStyle.Document; - mySoapOperationBinding.SoapAction = targetNamespace + operation; - // Add extensibility element 'SoapOperationBinding' to 'OperationBinding'. - myOperationBinding.Extensions.Add(mySoapOperationBinding); - return myOperationBinding; - } - } -} diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescription/CanRead/MyWsdl_CS.wsdl b/snippets/csharp/System.Web.Services.Description/ServiceDescription/CanRead/MyWsdl_CS.wsdl deleted file mode 100644 index 5371845a776..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescription/CanRead/MyWsdl_CS.wsdl +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescription/CanRead/Project.csproj b/snippets/csharp/System.Web.Services.Description/ServiceDescription/CanRead/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescription/CanRead/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescription/CanRead/Service1_CS.asmx b/snippets/csharp/System.Web.Services.Description/ServiceDescription/CanRead/Service1_CS.asmx deleted file mode 100644 index 1a8a5dd3af9..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescription/CanRead/Service1_CS.asmx +++ /dev/null @@ -1,16 +0,0 @@ -<%@ WebService Language="c#" Class="Service1" %> - -// This program creates a WebService to add two numbers. -using System; -using System.Web.Services; - -public class Service1 : WebService -{ - [WebMethod] - public int Add(int a, int b) - { - return(a+b); - } -} - - diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescription/CanRead/servicedescription_porttypes_2.cs b/snippets/csharp/System.Web.Services.Description/ServiceDescription/CanRead/servicedescription_porttypes_2.cs deleted file mode 100644 index 6720c9505e9..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescription/CanRead/servicedescription_porttypes_2.cs +++ /dev/null @@ -1,75 +0,0 @@ -// System.Web.Services.Description.ServiceDescription.PortTypes -// System.Web.Services.Description.ServiceDescription.CanRead - -/* - The following example demonstrates the 'PortTypes' property - and 'CanRead' method of 'ServiceDescription' class. - The input to the program is a WSDL file 'MyWsdl_CS.wsdl'. - This program checks the validity of WSDL file.One of the existing - port types is removed.A new PortType is defined and added to the - port types collection of the service description. A modified WSDL - is the output of the program. -*/ - -using System; -using System.Web.Services; -using System.Web.Services.Description; -using System.Xml; - -namespace ServiceDescription1 -{ - class MyService - { -// -// - static void Main() - { - string myWsdlFileName ="MyWsdl_CS.wsdl"; - XmlTextReader myReader = new XmlTextReader(myWsdlFileName); - if (ServiceDescription.CanRead(myReader)) - { - ServiceDescription myDescription = - ServiceDescription.Read(myWsdlFileName); - - // Remove the PortType at index 0 of the collection. - PortTypeCollection myPortTypeCollection = - myDescription.PortTypes; - myPortTypeCollection.Remove(myDescription.PortTypes[0]); - - // Build a new PortType. - PortType myPortType = new PortType(); - myPortType.Name = "Service1Soap"; - Operation myOperation = - CreateOperation("Add","s0:AddSoapIn","s0:AddSoapOut",""); - myPortType.Operations.Add(myOperation); - - // Add a new PortType to the PortType collection of - // the ServiceDescription. - myDescription.PortTypes.Add(myPortType); - - myDescription.Write("MyOutWsdl.wsdl"); - Console.WriteLine("New WSDL file generated successfully."); - } - else - { - Console.WriteLine("This file is not a WSDL file."); - } - } - // Creates an Operation for a PortType. - public static Operation CreateOperation(string operationName, - string inputMessage, string outputMessage, string targetNamespace) - { - Operation myOperation = new Operation(); - myOperation.Name = operationName; - OperationMessage input = (OperationMessage) new OperationInput(); - input.Message = new XmlQualifiedName(inputMessage,targetNamespace); - OperationMessage output = (OperationMessage) new OperationOutput(); - output.Message = new XmlQualifiedName(outputMessage,targetNamespace); - myOperation.Messages.Add(input); - myOperation.Messages.Add(output); - return myOperation; - } -// -// - } -} diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Extensions/Project.csproj b/snippets/csharp/System.Web.Services.Description/ServiceDescription/Extensions/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Extensions/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Extensions/ServiceDescription_Extensions_CS.asmx b/snippets/csharp/System.Web.Services.Description/ServiceDescription/Extensions/ServiceDescription_Extensions_CS.asmx deleted file mode 100644 index 7a25ba0b2d4..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Extensions/ServiceDescription_Extensions_CS.asmx +++ /dev/null @@ -1,14 +0,0 @@ -<%@ WebService Language="c#" Class="ServiceDescriptionService" %> - -// This program creates a WebService to add two numbers. -using System; -using System.Web.Services; - -public class ServiceDescriptionService : WebService -{ - [WebMethod] - public int Add(int a, int b) - { - return(a+b); - } -} diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Extensions/ServiceDescription_Extensions_Input_cs.wsdl b/snippets/csharp/System.Web.Services.Description/ServiceDescription/Extensions/ServiceDescription_Extensions_Input_cs.wsdl deleted file mode 100644 index ab245d5a80e..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Extensions/ServiceDescription_Extensions_Input_cs.wsdl +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Extensions/servicedescription_extensions_2.cs b/snippets/csharp/System.Web.Services.Description/ServiceDescription/Extensions/servicedescription_extensions_2.cs deleted file mode 100644 index 0db88b194d8..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Extensions/servicedescription_extensions_2.cs +++ /dev/null @@ -1,46 +0,0 @@ -// System.Web.Services.Description.ServiceDescription.Extensions -// System.Web.Services.Description.ServiceDescription.RetrievalUrl - -/* The following program demonstrates properties 'Extensions', 'RetrievalUrl' of - 'ServiceDescription' class. The input to the program is a WSDL file - 'ServiceDescription_Extensions_Input_cs.wsdl'. This program adds one object - to the extensions collection and displays the count and set the 'RetrievalURL' and displays. -*/ - -using System; -using System.Web.Services; -using System.Web.Services.Description; - -class MyServiceDescription -{ - public static void Main() - { -// -// - ServiceDescription myServiceDescription = new ServiceDescription(); - myServiceDescription = - ServiceDescription.Read("ServiceDescription_Extensions_Input_cs.wsdl"); - Console.WriteLine( - myServiceDescription.Bindings[1].Extensions[0].ToString()); - SoapBinding mySoapBinding = new SoapBinding(); - mySoapBinding.Required = true; - SoapBinding mySoapBinding1 = new SoapBinding(); - mySoapBinding1.Required = false; - myServiceDescription.Extensions.Add(mySoapBinding); - myServiceDescription.Extensions.Add(mySoapBinding1); - foreach(ServiceDescriptionFormatExtension - myServiceDescriptionFormatExtension - in myServiceDescription.Extensions) - { - Console.WriteLine("Required: " + - myServiceDescriptionFormatExtension.Required); - } - myServiceDescription.Write( - "ServiceDescription_Extensions_Output_cs.wsdl"); - myServiceDescription.RetrievalUrl = "http://www.contoso.com/"; - Console.WriteLine("Retrieval URL is: " + - myServiceDescription.RetrievalUrl); -// -// - } -} diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Imports/Project.csproj b/snippets/csharp/System.Web.Services.Description/ServiceDescription/Imports/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Imports/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Imports/ServiceDescription_Imports_Input_CS.wsdl b/snippets/csharp/System.Web.Services.Description/ServiceDescription/Imports/ServiceDescription_Imports_Input_CS.wsdl deleted file mode 100644 index 5720af1e54e..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Imports/ServiceDescription_Imports_Input_CS.wsdl +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Imports/ServiceDescription_Imports_Service.cs.asmx b/snippets/csharp/System.Web.Services.Description/ServiceDescription/Imports/ServiceDescription_Imports_Service.cs.asmx deleted file mode 100644 index 723bfa514ed..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Imports/ServiceDescription_Imports_Service.cs.asmx +++ /dev/null @@ -1,13 +0,0 @@ -<%@ WebService Language="c#" Class="ServiceDescriptionService" %> -using System; -using System.Web; -using System.Web.Services; - -public class ServiceDescriptionService : WebService -{ - [WebMethod] - public int Add(int a, int b) - { - return(a+b); - } -} \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Imports/servicedescription_imports.cs b/snippets/csharp/System.Web.Services.Description/ServiceDescription/Imports/servicedescription_imports.cs deleted file mode 100644 index d406b5b3591..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Imports/servicedescription_imports.cs +++ /dev/null @@ -1,44 +0,0 @@ -// System.Web.Services.Description.ServiceDescription.Imports - -/* The following program demonstrates the property 'Imports' of 'ServiceDescription' class. - The input to the program is a WSDL file 'ServiceDescription_Imports_Input_CS.wsdl' which - is not having the import element. A new 'Import' is defined and added to the new modified - 'ServiceDescription_Imports_Output_CS.wsdl' file. -*/ - -using System; -using System.Web.Services; -using System.Web.Services.Description; -using System.Xml; - -class MyServiceDescription -{ - public static void Main( ) - { -// - ServiceDescription myServiceDescription = new ServiceDescription(); - myServiceDescription = - ServiceDescription.Read("ServiceDescription_Imports_Input_CS.wsdl"); - ImportCollection myImportCollection = myServiceDescription.Imports; - - // Create an Import. - Import myImport = new Import(); - myImport.Namespace = myServiceDescription.TargetNamespace; - - // Set the location for the Import. - myImport.Location = "http://www.contoso.com/"; - myImportCollection.Add(myImport); - myServiceDescription.Write("ServiceDescription_Imports_Output_CS.wsdl"); - myImportCollection.Clear(); - myServiceDescription = - ServiceDescription.Read("ServiceDescription_Imports_Output_CS.wsdl"); - myImportCollection = myServiceDescription.Imports; - Console.WriteLine( - "The Import elements added to the ImportCollection are: "); - for(int i = 0; i < myImportCollection.Count; i++) - { - Console.WriteLine((i+1) + ". " + myImportCollection[i].Location); - } -// - } -} diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Messages/MyWsdl_CS.wsdl b/snippets/csharp/System.Web.Services.Description/ServiceDescription/Messages/MyWsdl_CS.wsdl deleted file mode 100644 index 79c41bb9ce9..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Messages/MyWsdl_CS.wsdl +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Messages/Project.csproj b/snippets/csharp/System.Web.Services.Description/ServiceDescription/Messages/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Messages/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Messages/Service1_CS.asmx b/snippets/csharp/System.Web.Services.Description/ServiceDescription/Messages/Service1_CS.asmx deleted file mode 100644 index 1a8a5dd3af9..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Messages/Service1_CS.asmx +++ /dev/null @@ -1,16 +0,0 @@ -<%@ WebService Language="c#" Class="Service1" %> - -// This program creates a WebService to add two numbers. -using System; -using System.Web.Services; - -public class Service1 : WebService -{ - [WebMethod] - public int Add(int a, int b) - { - return(a+b); - } -} - - diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Messages/servicedescription_constructor_4.cs b/snippets/csharp/System.Web.Services.Description/ServiceDescription/Messages/servicedescription_constructor_4.cs deleted file mode 100644 index 7dee86476de..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Messages/servicedescription_constructor_4.cs +++ /dev/null @@ -1,61 +0,0 @@ -// System.Web.Services.Description.ServiceDescription.ServiceDescription() -// System.Web.Services.Description.ServiceDescription.Read(string) -// System.Web.Services.Description.ServiceDescription.Messages -// System.Web.Services.Description.ServiceDescription.Name - -/* - The following example demonstrates the constructor 'ServiceDescription()', - properties 'Messages', 'Name' and 'Read' method of 'ServiceDescription' - class. The input to the program is a WSDL file 'MyWsdl.wsdl'. - This program removes one message from the existing WSDL. - A new Message is defined and added to the ServiceDescription. - A new wsdl with modified ServiceDescription is written in 'MyOutWsdl.wsdl'. -*/ -using System; -using System.Web.Services; -using System.Web.Services.Description; -using System.Xml; - -namespace ServiceDescription1 -{ - class MyService - { - static void Main() - { -// -// -// -// - - ServiceDescription myDescription = new ServiceDescription(); - myDescription = ServiceDescription.Read("MyWsdl_CS.wsdl"); - myDescription.Name = "MyServiceDescription"; - Console.WriteLine("Name: " + myDescription.Name); - MessageCollection myMessageCollection = myDescription.Messages; - - // Remove the message at index 0 from the message collection. - myMessageCollection.Remove(myDescription.Messages[0]); - - // Build a new message. - Message myMessage = new Message(); - myMessage.Name = "AddSoapIn"; - - // Build a new MessagePart. - MessagePart myMessagePart = new MessagePart(); - myMessagePart.Name = "parameters"; - XmlQualifiedName myXmlQualifiedName = new XmlQualifiedName("s0:Add"); - myMessagePart.Element = myXmlQualifiedName; - - // Add MessageParts to the message. - myMessage.Parts.Add(myMessagePart); - - // Add the message to the ServiceDescription. - myDescription.Messages.Add(myMessage); - myDescription.Write("MyOutWsdl.wsdl"); -// -// -// -// - } - } -} diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Namespace/MyWsdl_CS.wsdl b/snippets/csharp/System.Web.Services.Description/ServiceDescription/Namespace/MyWsdl_CS.wsdl deleted file mode 100644 index 77cb235410b..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Namespace/MyWsdl_CS.wsdl +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Namespace/Project.csproj b/snippets/csharp/System.Web.Services.Description/ServiceDescription/Namespace/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Namespace/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Namespace/servicedescription_namespace.cs b/snippets/csharp/System.Web.Services.Description/ServiceDescription/Namespace/servicedescription_namespace.cs deleted file mode 100644 index 4d5a5a3ef5c..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Namespace/servicedescription_namespace.cs +++ /dev/null @@ -1,30 +0,0 @@ -// System.Web.Services.Description.ServiceDescription.Namespace -/* - The following example demonstrates the 'Namespace' property of 'ServiceDescription' class. The input to the program is a - WSDL file 'MyWsdl.wsdl'. This program displays the Namespace of 'ServiceDescription' class. -*/ -using System; -using System.Web.Services; -using System.Web.Services.Description; - -namespace ServiceDescription1 -{ - class MyService - { - static void Main() - { - try - { - // - ServiceDescription myDescription = - ServiceDescription.Read("MyWsdl_CS.wsdl"); - Console.WriteLine("Namespace: " + ServiceDescription.Namespace); - // - } - catch(Exception e) - { - Console.WriteLine("Exception: " + e.Message); - } - } - } -} diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Overview/MyWsdl_CS.wsdl b/snippets/csharp/System.Web.Services.Description/ServiceDescription/Overview/MyWsdl_CS.wsdl deleted file mode 100644 index 0eae7353fb8..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Overview/MyWsdl_CS.wsdl +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/ServiceDescription/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Overview/Service1_CS.asmx b/snippets/csharp/System.Web.Services.Description/ServiceDescription/Overview/Service1_CS.asmx deleted file mode 100644 index 1a8a5dd3af9..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Overview/Service1_CS.asmx +++ /dev/null @@ -1,16 +0,0 @@ -<%@ WebService Language="c#" Class="Service1" %> - -// This program creates a WebService to add two numbers. -using System; -using System.Web.Services; - -public class Service1 : WebService -{ - [WebMethod] - public int Add(int a, int b) - { - return(a+b); - } -} - - diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Overview/makefile_ServiceDescription_cs.dat b/snippets/csharp/System.Web.Services.Description/ServiceDescription/Overview/makefile_ServiceDescription_cs.dat deleted file mode 100644 index 72d8cfe85b0..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Overview/makefile_ServiceDescription_cs.dat +++ /dev/null @@ -1,17 +0,0 @@ -cc = csc -vb = vbc -IISRoot = C:\InetPub\wwwroot - -makefile: MyOutWsdl.wsdl -MyOutWsdl.wsdl:ServiceDescription_Bindings.exe -ServiceDescription_Bindings.exe: ServiceDescription.cs - $(cc) ServiceDescription.cs - ServiceDescription.exe - wsdl MyOutWsdl.wsdl - $(cc) /t:library Service1.cs - if not exist $(IISRoot)\ServiceDescription md $(IISRoot)\ServiceDescription - if not exist $(IISRoot)\bin mkdir $(IISRoot)\bin - copy Service1_CS.asmx $(IISRoot)\ServiceDescription - copy ServiceClient.cs.aspx $(IISRoot)\ServiceDescription - move Service1.dll $(IISRoot)\bin - echo Invoke aspx file at http://localhost/ServiceDescription/ServiceClient.cs.aspx diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Overview/servicedescription.cs b/snippets/csharp/System.Web.Services.Description/ServiceDescription/Overview/servicedescription.cs deleted file mode 100644 index 227e552214c..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Overview/servicedescription.cs +++ /dev/null @@ -1,83 +0,0 @@ -// System.Web.Services.Description.ServiceDescription - -/* - The following example demonstrates the 'ServiceDescription' class. - The input to the program is a WSDL file 'MyWsdl.wsdl'. - This program removes one 'Binding' from the existing WSDL. - A new Binding is defined and added to the ServiceDescription object. - The program generates a new Web Service Description document. -*/ - -using System; -using System.Web.Services; -using System.Web.Services.Description; -using System.Xml; - -namespace ServiceDescription1 -{ - class MyService - { - static void Main() - { - try - { -// - // Obtain the ServiceDescription of existing Wsdl. - ServiceDescription myDescription = ServiceDescription.Read("MyWsdl_CS.wsdl"); - // Remove the Binding from the Binding Collection of ServiceDescription. - BindingCollection myBindingCollection = myDescription.Bindings; - myBindingCollection.Remove(myBindingCollection[0]); - - // Form a new Binding. - Binding myBinding = new Binding(); - myBinding.Name = "Service1Soap"; - XmlQualifiedName myXmlQualifiedName = - new XmlQualifiedName("s0:Service1Soap"); - myBinding.Type = myXmlQualifiedName; - - SoapBinding mySoapBinding = new SoapBinding(); - mySoapBinding.Transport = "http://schemas.xmlsoap.org/soap/http"; - mySoapBinding.Style = SoapBindingStyle.Document; - - OperationBinding addOperationBinding = - CreateOperationBinding("Add",myDescription.TargetNamespace); - myBinding.Operations.Add(addOperationBinding); - myBinding.Extensions.Add(mySoapBinding); - - // Add the Binding to the ServiceDescription. - myDescription.Bindings.Add(myBinding); - myDescription.Write("MyOutWsdl.wsdl"); -// - } - catch(Exception e) - { - Console.WriteLine("Exception :" + e.Message); - } - } - // Used to create OperationBinding instances within 'Binding'. - public static OperationBinding CreateOperationBinding(string operation, string targetNamespace) - { - // Create OperationBinding instance for operation. - OperationBinding myOperationBinding = new OperationBinding(); - myOperationBinding.Name = operation; - // Create InputBinding for operation. - InputBinding myInputBinding = new InputBinding(); - SoapBodyBinding mySoapBodyBinding = new SoapBodyBinding(); - mySoapBodyBinding.Use = SoapBindingUse.Literal; - myInputBinding.Extensions.Add(mySoapBodyBinding); - // Create OutputBinding for operation. - OutputBinding myOutputBinding = new OutputBinding(); - myOutputBinding.Extensions.Add(mySoapBodyBinding); - // Add 'InputBinding' and 'OutputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInputBinding; - myOperationBinding.Output = myOutputBinding; - // Create extensibility element for 'SoapOperationBinding'. - SoapOperationBinding mySoapOperationBinding = new SoapOperationBinding(); - mySoapOperationBinding.Style = SoapBindingStyle.Document; - mySoapOperationBinding.SoapAction = targetNamespace + operation; - // Add extensibility element 'SoapOperationBinding' to 'OperationBinding'. - myOperationBinding.Extensions.Add(mySoapOperationBinding); - return myOperationBinding; - } - } -} diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Read/servicedescription_read1.cs b/snippets/csharp/System.Web.Services.Description/ServiceDescription/Read/servicedescription_read1.cs deleted file mode 100644 index 9a395954bea..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Read/servicedescription_read1.cs +++ /dev/null @@ -1,41 +0,0 @@ -// System.Web.Services.Description.Read(TextReader) -/* - The following example demonstrates the 'Read(TextReader)' method of - 'ServiceDescription' class.A ServiceDescription instance is - obtained from existing Wsdl.Name property of Bindings in the - ServiceDescription is displayed to console. - */ - -using System; -using System.Web.Services; -using System.Web.Services.Description; -using System.Xml; -using System.IO; - -class MyService -{ - static void Main() - { - try - { -// - ServiceDescription myDescription = new ServiceDescription(); - - // Create a StreamReader to read a WSDL file. - TextReader myTextReader = new StreamReader("MyWsdl.wsdl"); - myDescription = ServiceDescription.Read(myTextReader); - Console.WriteLine("Bindings are: "); - - // Display the Bindings present in the WSDL file. - foreach(Binding myBinding in myDescription.Bindings) - { - Console.WriteLine(myBinding.Name); - } -// - } - catch(Exception e) - { - Console.WriteLine("Exception: " + e.Message); - } - } -} diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Read/servicedescription_read2.cs b/snippets/csharp/System.Web.Services.Description/ServiceDescription/Read/servicedescription_read2.cs deleted file mode 100644 index 0aa73f5e3cb..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Read/servicedescription_read2.cs +++ /dev/null @@ -1,40 +0,0 @@ -// System.Web.Services.Description.Read(StreamReader) -/* - The following example demonstrates the 'Read(StreamReader)' method of - 'ServiceDescription' class.A ServiceDescription instance is - obtained from existing Wsdl. Name property of Bindings in the - ServiceDescription is displayed to console. -*/ - -using System; -using System.Web.Services; -using System.Web.Services.Description; -using System.Xml; -using System.IO; - -class MyService -{ - static void Main() - { - try - { -// - // Create a StreamReader to read a WSDL file. - StreamReader myStreamReader = new StreamReader("MyWsdl.wsdl"); - ServiceDescription myDescription = - ServiceDescription.Read(myStreamReader); - Console.WriteLine("Bindings are:"); - - // Display the Bindings present in the WSDL file. - foreach(Binding myBinding in myDescription.Bindings) - { - Console.WriteLine(myBinding.Name); - } -// - } - catch(Exception e) - { - Console.WriteLine("Exception: " + e.Message); - } - } -} diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Types/Input_CS.wsdl b/snippets/csharp/System.Web.Services.Description/ServiceDescription/Types/Input_CS.wsdl deleted file mode 100644 index c5d9b883721..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Types/Input_CS.wsdl +++ /dev/null @@ -1,182 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Types/Project.csproj b/snippets/csharp/System.Web.Services.Description/ServiceDescription/Types/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Types/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Types/servicedescription_types.cs b/snippets/csharp/System.Web.Services.Description/ServiceDescription/Types/servicedescription_types.cs deleted file mode 100644 index 87a87c5e3c4..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescription/Types/servicedescription_types.cs +++ /dev/null @@ -1,121 +0,0 @@ -// System.Web.Services.Description.ServiceDescription.Types -// System.Web.Services.Description.ServiceDescription.Write(Stream) - -/* - The following program demonstrates the 'Write' method and 'Types' property - of ServiceDescription class.An existing WSDL document is read. - Types of the SericeDescription are removed.New Types are constructed. - Types are then added to ServiceDescription .A new WSDL file is created as output. -*/ - -using System; -using System.Text; -using System.Web.Services.Description; -using System.Collections; -using System.IO; -using System.Xml; -using System.Xml.Schema; - -class ServiceDescription_Types -{ - public static void Main() - { - try - { - // Read the existing WSDL. - ServiceDescription myServiceDescription= - ServiceDescription.Read("Input_CS.wsdl"); -// - myServiceDescription.Types.Schemas.Remove( - myServiceDescription.Types.Schemas[0]); - XmlSchema myXmlSchema = new XmlSchema(); - myXmlSchema.AttributeFormDefault = XmlSchemaForm.Qualified; - myXmlSchema.ElementFormDefault = XmlSchemaForm.Qualified; - myXmlSchema.TargetNamespace = myServiceDescription.TargetNamespace; - - XmlSchemaElement myXmlElement1 = new XmlSchemaElement(); - myXmlElement1.Name="Add"; - - XmlSchemaComplexType myXmlSchemaComplexType = - new XmlSchemaComplexType(); - XmlSchemaSequence myXmlSchemaSequence = new XmlSchemaSequence(); - myXmlSchemaSequence.Items.Add(CreateComplexTypeXmlElement( - "1", "1", "a", new XmlQualifiedName("s:float"))); - - myXmlSchemaSequence.Items.Add(CreateComplexTypeXmlElement( - "1", "1", "b", new XmlQualifiedName("s:float"))); - - myXmlSchemaComplexType.Particle = myXmlSchemaSequence; - myXmlElement1.SchemaType = myXmlSchemaComplexType; - myXmlSchema.Items.Add(myXmlElement1); - - XmlSchemaElement myXmlElement2 = new XmlSchemaElement(); - myXmlElement2.Name = "AddResponse"; - myXmlSchemaComplexType = new XmlSchemaComplexType(); - myXmlSchemaSequence = new XmlSchemaSequence(); - myXmlSchemaSequence.Items.Add(CreateComplexTypeXmlElement( - "1", "1", "AddResult", new XmlQualifiedName("s:float"))); - - myXmlSchemaComplexType.Particle = myXmlSchemaSequence; - myXmlElement2.SchemaType=myXmlSchemaComplexType; - myXmlSchema.Items.Add(myXmlElement2); - - XmlSchemaElement myXmlElement3 = new XmlSchemaElement(); - myXmlElement3.Name="Subtract"; - myXmlSchemaComplexType = new XmlSchemaComplexType(); - myXmlSchemaSequence = new XmlSchemaSequence(); - myXmlSchemaSequence.Items.Add(CreateComplexTypeXmlElement( - "1", "1", "a", new XmlQualifiedName("s:float"))); - - myXmlSchemaSequence.Items.Add(CreateComplexTypeXmlElement( - "1", "1", "b", new XmlQualifiedName("s:float"))); - - myXmlSchemaComplexType.Particle = myXmlSchemaSequence; - myXmlElement3.SchemaType=myXmlSchemaComplexType; - myXmlSchema.Items.Add(myXmlElement3); - - XmlSchemaElement myXmlElement4 = new XmlSchemaElement(); - myXmlElement4.Name="SubtractResponse"; - myXmlSchemaComplexType = new XmlSchemaComplexType(); - myXmlSchemaSequence = new XmlSchemaSequence(); - myXmlSchemaSequence.Items.Add(CreateComplexTypeXmlElement( - "1", "1", "SubtractResult", new XmlQualifiedName("s:int"))); - - myXmlSchemaComplexType.Particle = myXmlSchemaSequence; - myXmlElement4.SchemaType = myXmlSchemaComplexType; - myXmlSchema.Items.Add(myXmlElement4); - - // Add the schemas to the Types property of the ServiceDescription. - myServiceDescription.Types.Schemas.Add(myXmlSchema); -// - -// - FileStream myFileStream = new FileStream("output.wsdl", - FileMode.OpenOrCreate, FileAccess.Write); - StreamWriter myStreamWriter = new StreamWriter(myFileStream); - - // Write the WSDL. - Console.WriteLine("Writing a new WSDL file."); - myServiceDescription.Write(myStreamWriter); - myStreamWriter.Close(); - myFileStream.Close(); -// - } - catch(Exception e) - { - Console.WriteLine("Exception Caught! " +e.Message); - } - } - // This function creates a XmlComplex Element. - public static XmlSchemaElement CreateComplexTypeXmlElement( - string minoccurs, string maxoccurs, string name, - XmlQualifiedName schemaTypeName) - { - XmlSchemaElement myXmlSchemaElement = new XmlSchemaElement(); - myXmlSchemaElement.MinOccursString = minoccurs; - myXmlSchemaElement.MaxOccursString = maxoccurs; - myXmlSchemaElement.Name = name; - myXmlSchemaElement.SchemaTypeName = schemaTypeName; - return myXmlSchemaElement; - } -} diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionBaseCollection/Overview/Input_CS.wsdl b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionBaseCollection/Overview/Input_CS.wsdl deleted file mode 100644 index c5d9b883721..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionBaseCollection/Overview/Input_CS.wsdl +++ /dev/null @@ -1,182 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionBaseCollection/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionBaseCollection/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionBaseCollection/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionBaseCollection/Overview/servicedescriptionbasecollection.cs b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionBaseCollection/Overview/servicedescriptionbasecollection.cs deleted file mode 100644 index 211c6885a2c..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionBaseCollection/Overview/servicedescriptionbasecollection.cs +++ /dev/null @@ -1,190 +0,0 @@ -// System.Web.Services.Description.ServiceDescriptionBaseCollection. -/* - The following example demonstrates 'ServiceDescriptionBaseCollection' class. - A 'ServiceDescription' instance is obtained from the existing Wsdl. - 'MyMethod' takes an instance of 'ServiceDescriptionBaseCollection' as a parameter. - Instance of different types of collections that were actually derived from - 'ServiceDescriptionBaseCollection' are passed to my method and modifications of - corresponding instances in done. -*/ - -using System; -using System.Web.Services.Description; -using System.Collections; -using System.Xml; - -class ServiceDescription_Sample -{ - public static ServiceDescription myServiceDescription; - public static void Main() - { - // Read a ServiceDescription of existing WSDL. - myServiceDescription= ServiceDescription.Read("Input_CS.wsdl"); - // Get the ServiceCollection of the ServiceDescription. - ServiceCollection myServiceCollection= myServiceDescription.Services; - MyMethod(myServiceCollection); - BindingCollection myBindingCollection=myServiceDescription.Bindings; - MyMethod(myBindingCollection); - PortTypeCollection myPortTypeCollection= myServiceDescription.PortTypes; - MyMethod(myPortTypeCollection); - myServiceDescription.Write("Output.Wsdl"); - } -// - public static void MyMethod( - ServiceDescriptionBaseCollection myServiceCollection) - { - Type myType = myServiceCollection.GetType(); - if (myType.Equals( - typeof(System.Web.Services.Description.ServiceCollection))) - { - // Remove the services at index 0 of the collection. - ((ServiceCollection)myServiceCollection).Remove( - myServiceDescription.Services[0]); - - // Build a new Service. - Service myService =new Service(); - myService.Name="MathService"; - XmlQualifiedName myXmlQualifiedName = - new XmlQualifiedName("s0:MathServiceSoap"); - - // Build a new Port for SOAP. - Port mySoapPort= new Port(); - mySoapPort.Name="MathServiceSoap"; - mySoapPort.Binding=myXmlQualifiedName; - SoapAddressBinding mySoapAddressBinding = new SoapAddressBinding(); - mySoapAddressBinding.Location = "http://localhost/" + - "ServiceDescriptionBaseCollection/AddSubtractService.CS.asmx"; - mySoapPort.Extensions.Add(mySoapAddressBinding); - - // Build a new Port for HTTP-GET. - XmlQualifiedName myXmlQualifiedName2 = - new XmlQualifiedName("s0:MathServiceHttpGet"); - Port myHttpGetPort= new Port(); - myHttpGetPort.Name="MathServiceHttpGet"; - myHttpGetPort.Binding=myXmlQualifiedName2; - HttpAddressBinding myHttpAddressBinding = new HttpAddressBinding(); - myHttpAddressBinding.Location = "http://localhost/" + - "ServiceDescriptionBaseCollection/AddSubtractService.CS.asmx"; - myHttpGetPort.Extensions.Add(myHttpAddressBinding); - - // Add the ports to the Service. - myService.Ports.Add(myHttpGetPort); - myService.Ports.Add(mySoapPort); - - // Add the Service to the ServiceCollection. - myServiceDescription.Services.Add(myService); - } - else if(myType.Equals( - typeof(System.Web.Services.Description.BindingCollection))) - { - // Remove the Binding in the BindingCollection at index 0. - ((BindingCollection)myServiceCollection).Remove( - myServiceDescription.Bindings[0]); - - // Build a new Binding. - Binding myBinding = new Binding(); - myBinding.Name = "MathServiceSoap"; - XmlQualifiedName myXmlQualifiedName = - new XmlQualifiedName("s0:MathServiceSoap"); - myBinding.Type=myXmlQualifiedName; - SoapBinding mySoapBinding = new SoapBinding(); - mySoapBinding.Transport = "http://schemas.xmlsoap.org/soap/http"; - mySoapBinding.Style = SoapBindingStyle.Document; - - // Create the operations for the binding. - OperationBinding addOperationBinding = CreateOperationBinding( - "Add", myServiceDescription.TargetNamespace); - OperationBinding subtractOperationBinding = CreateOperationBinding( - "Subtract",myServiceDescription.TargetNamespace); - - // Add the operations to the Binding. - myBinding.Operations.Add(subtractOperationBinding); - myBinding.Operations.Add(addOperationBinding); - myBinding.Extensions.Add(mySoapBinding); - - // Add the Binding to the Bindings collection. - myServiceDescription.Bindings.Add(myBinding); - } - else if (myType.Equals( - typeof(System.Web.Services.Description.PortTypeCollection))) - { - // Remove the PortType at index 0. - ((PortTypeCollection)myServiceCollection).Remove( - myServiceDescription.PortTypes[0]); - - // Build a new PortType. - PortType myPortType = new PortType(); - myPortType.Name = "MathServiceSoap"; - - // Build an Add Operation for the PortType. - Operation myAddOperation = new Operation(); - myAddOperation.Name="Add"; - - // Build the Input and Output messages for the Operations. - OperationInput myOperationInputMessage1 = new OperationInput(); - XmlQualifiedName myXmlQualifiedName1 = - new XmlQualifiedName("s0:AddSoapIn"); - myOperationInputMessage1.Message = myXmlQualifiedName1; - - OperationOutput myOperationOutputMessage1 = new OperationOutput(); - XmlQualifiedName myXmlQualifiedName2 = - new XmlQualifiedName("s0:AddSoapOut"); - myOperationOutputMessage1.Message=myXmlQualifiedName2; - - // Add the messages to the operations. - myAddOperation.Messages.Add(myOperationInputMessage1); - myAddOperation.Messages.Add(myOperationOutputMessage1); - - // Build an Add Operation for the PortType. - Operation mySubtractOperation = new Operation(); - mySubtractOperation.Name = "Subtract"; - - // Build the Input and Output messages for the operations. - OperationInput myOperationInputMessage2 = new OperationInput(); - XmlQualifiedName myXmlQualifiedName3 = - new XmlQualifiedName("s0:SubtractSoapIn"); - myOperationInputMessage2.Message = myXmlQualifiedName3; - OperationOutput myOperationOutputMessage2 = new OperationOutput(); - XmlQualifiedName myXmlQualifiedName4 = - new XmlQualifiedName("s0:SubtractSoapOut"); - myOperationOutputMessage2.Message = myXmlQualifiedName4; - - // Add the messages to the operations. - mySubtractOperation.Messages.Add(myOperationInputMessage2); - mySubtractOperation.Messages.Add(myOperationOutputMessage2); - - // Add the operations to the PortType. - myPortType.Operations.Add(myAddOperation); - myPortType.Operations.Add(mySubtractOperation); - - // Add the PortType to the collection. - myServiceDescription.PortTypes.Add(myPortType); - } - } -// - public static OperationBinding CreateOperationBinding(string operation, - string targetNamespace) - { - // Create OperationBinding instance for operation. - OperationBinding myOperationBinding = new OperationBinding(); - myOperationBinding.Name = operation; - // Create InputBinding for operation. - InputBinding myInputBinding = new InputBinding(); - SoapBodyBinding mySoapBodyBinding = new SoapBodyBinding(); - mySoapBodyBinding.Use = SoapBindingUse.Literal; - myInputBinding.Extensions.Add(mySoapBodyBinding); - // Create OutputBinding for operation. - OutputBinding myOutputBinding = new OutputBinding(); - myOutputBinding.Extensions.Add(mySoapBodyBinding); - // Add 'InputBinding' and 'OutputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInputBinding; - myOperationBinding.Output = myOutputBinding; - // Create extensibility element for 'SoapOperationBinding'. - SoapOperationBinding mySoapOperationBinding = new SoapOperationBinding(); - mySoapOperationBinding.Style = SoapBindingStyle.Document; - mySoapOperationBinding.SoapAction = targetNamespace + operation; - // Add extensibility element 'SoapOperationBinding' to 'OperationBinding'. - myOperationBinding.Extensions.Add(mySoapOperationBinding); - return myOperationBinding; - } -} diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/.ctor/DataTypes_CS.wsdl b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/.ctor/DataTypes_CS.wsdl deleted file mode 100644 index d3073f61fd7..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/.ctor/DataTypes_CS.wsdl +++ /dev/null @@ -1,919 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/.ctor/MathService_CS.wsdl b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/.ctor/MathService_CS.wsdl deleted file mode 100644 index ebf12847cfc..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/.ctor/MathService_CS.wsdl +++ /dev/null @@ -1,659 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/.ctor/servicedescriptioncollection_constructor_add_item.cs b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/.ctor/servicedescriptioncollection_constructor_add_item.cs deleted file mode 100644 index d06bec9a45a..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/.ctor/servicedescriptioncollection_constructor_add_item.cs +++ /dev/null @@ -1,50 +0,0 @@ -// System.Web.Services.Description.ServiceDescriptionCollection.ServiceDescriptionCollection() -// System.Web.Services.Description.ServiceDescriptionCollection.Add() -// System.Web.Services.Description.ServiceDescriptionCollection.Item(Int32) - -/* The following program demonstrates 'Constructor', 'Add' method and - 'Item' property of 'ServiceDescriptionCollection' class. It creates an - instance of 'ServiceDescriptionCollection' and adds - 'ServiceDescription' objects to the collection. The Item property is used to - display the TargetNamespace of elements in the collection. - - Note: This program requires 'DataTypes_CS.wsdl' and 'MathService_CS.wsdl' - files to be placed in same directory as that of .exe for running. -*/ -using System; -using System.Web.Services.Description; - -class MyServiceDescriptionCollection -{ - public static void Main() - { - try - { - ServiceDescription myServiceDescription1 = - ServiceDescription.Read("DataTypes_CS.wsdl"); - ServiceDescription myServiceDescription2 = - ServiceDescription.Read("MathService_CS.wsdl"); -// -// - // Create the object of 'ServiceDescriptionCollection' class. - ServiceDescriptionCollection myCollection = - new ServiceDescriptionCollection(); - // Add 'ServiceDescription' objects. - myCollection.Add(myServiceDescription1); - myCollection.Add(myServiceDescription2); -// -// -// - // Display element properties in collection using 'Item' property. - for(int i=0; i - } - catch(Exception e) - { - Console.WriteLine("The following exception was raised: {0}", e.Message); - } - } -} \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/Contains/DataTypes_CS.wsdl b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/Contains/DataTypes_CS.wsdl deleted file mode 100644 index d3073f61fd7..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/Contains/DataTypes_CS.wsdl +++ /dev/null @@ -1,919 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/Contains/MathService_CS.wsdl b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/Contains/MathService_CS.wsdl deleted file mode 100644 index ebf12847cfc..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/Contains/MathService_CS.wsdl +++ /dev/null @@ -1,659 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/Contains/servicedescriptioncollection_contains_indexof_remove.cs b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/Contains/servicedescriptioncollection_contains_indexof_remove.cs deleted file mode 100644 index 5cf0a81c8a8..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/Contains/servicedescriptioncollection_contains_indexof_remove.cs +++ /dev/null @@ -1,61 +0,0 @@ -// System.Web.Services.Description.ServiceDescriptionCollection.Contains() -// System.Web.Services.Description.ServiceDescriptionCollection.IndexOf() -// System.Web.Services.Description.ServiceDescriptionCollection.Remove() - -/* The following program demonstrates 'Contains', 'IndexOf' and - 'Remove' methods of 'ServiceDescriptionCollection' class. It creates an - instance of 'ServiceDescriptionCollection' and adds 'ServiceDescription' - objects to the collection. It checks for an object of 'ServiceDescription', - retrieves the index of the object and removes it from the collection. - - Note: This program requires 'DataTypes_CS.wsdl' and 'MathService_CS.wsdl' - files to be placed in the same directory as that of .exe for - running. - -*/ -using System; -using System.Web.Services.Description; - -class MyServiceDescriptionCollection -{ - public static void Main() - { - try - { - ServiceDescription myServiceDescription1 = - ServiceDescription.Read("DataTypes_CS.wsdl"); - ServiceDescription myServiceDescription2 = - ServiceDescription.Read("MathService_CS.wsdl"); - ServiceDescriptionCollection myCollection = - new ServiceDescriptionCollection(); - - // Add 'ServiceDescription' objects. - myCollection.Add(myServiceDescription1); - myCollection.Add(myServiceDescription2); - -// - // Check for 'ServiceDescription' object in the collection. - if (myCollection.Contains(myServiceDescription2)) - { -// -// - // Get the index of 'ServiceDescription' object. - int myIndex = myCollection.IndexOf(myServiceDescription2); - // Remove 'ServiceDescription' object from the collection. - myCollection.Remove(myServiceDescription2); - Console.WriteLine("Element at index {0} is removed ", myIndex); -// -// - } - else - { - Console.WriteLine("Element not found."); - } -// - } - catch(Exception e) - { - Console.WriteLine("The following exception was raised: {0}", e.Message); - } - } -} \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/CopyTo/DataTypes_CS.wsdl b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/CopyTo/DataTypes_CS.wsdl deleted file mode 100644 index d3073f61fd7..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/CopyTo/DataTypes_CS.wsdl +++ /dev/null @@ -1,919 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/CopyTo/MathService_CS.wsdl b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/CopyTo/MathService_CS.wsdl deleted file mode 100644 index ebf12847cfc..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/CopyTo/MathService_CS.wsdl +++ /dev/null @@ -1,659 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/CopyTo/servicedescriptioncollection_insert_item_copyto.cs b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/CopyTo/servicedescriptioncollection_insert_item_copyto.cs deleted file mode 100644 index 93971769fb6..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/CopyTo/servicedescriptioncollection_insert_item_copyto.cs +++ /dev/null @@ -1,57 +0,0 @@ -// System.Web.Services.Description.ServiceDescriptionCollection.Insert() -// System.Web.Services.Description.ServiceDescriptionCollection.Item(String) -// System.Web.Services.Description.ServiceDescriptionCollection.CopyTo() - -/* The following program demonstrates 'Item' property, 'Insert' and 'CopyTo' - methods of the 'ServiceDescriptionCollection' class. It creates an instance of - 'ServiceDescriptionCollection' and adds 'ServiceDescription' objects to the - collection. The elements of the collection are copied to a 'ServiceDescription' - array. - - Note: This program requires 'DataTypes_CS.wsdl' and 'MathService_CS.wsdl' - files to be placed in the same directory as that of .exe for running. -*/ -using System; -using System.Web.Services.Description; - -class MyServiceDescriptionCollection -{ - public static void Main() - { - try - { - ServiceDescription myServiceDescription1 = ServiceDescription.Read("DataTypes_CS.wsdl"); - myServiceDescription1.Name = "DataTypes"; - ServiceDescription myServiceDescription2 = ServiceDescription.Read("MathService_CS.wsdl"); - myServiceDescription2.Name = "MathService"; - - // Create the object of 'ServiceDescriptionCollection' class. - ServiceDescriptionCollection myCollection = new ServiceDescriptionCollection(); - // Add 'ServiceDescription' objects. - myCollection.Add(myServiceDescription1) ; -// - // Insert a 'ServiceDescription' object into the collection. - myCollection.Insert(1, myServiceDescription2); -// -// - // Get a 'ServiceDescription' object in collection using 'Item'. - ServiceDescription myServiceDescription = myCollection["http://tempuri1.org/"]; -// - Console.WriteLine("Name of the object retrieved using 'Item' property: " - + myServiceDescription.Name); -// - ServiceDescription[] myArray = new ServiceDescription[myCollection.Count]; - // Copy the collection to a 'ServiceDescription' array. - myCollection.CopyTo(myArray,0); - for(int i=0; i - } - catch(Exception e) - { - Console.WriteLine("The following exception was raised: {0}", e.Message); - } - } -} \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetBinding/DataTypes_CS.wsdl b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetBinding/DataTypes_CS.wsdl deleted file mode 100644 index d3073f61fd7..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetBinding/DataTypes_CS.wsdl +++ /dev/null @@ -1,919 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetBinding/MathService_CS.wsdl b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetBinding/MathService_CS.wsdl deleted file mode 100644 index ebf12847cfc..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetBinding/MathService_CS.wsdl +++ /dev/null @@ -1,659 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetBinding/Project.csproj b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetBinding/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetBinding/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetBinding/servicedescriptioncollection_getbinding.cs b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetBinding/servicedescriptioncollection_getbinding.cs deleted file mode 100644 index 00dc5d75bb8..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetBinding/servicedescriptioncollection_getbinding.cs +++ /dev/null @@ -1,48 +0,0 @@ -// System.Web.Services.Description.ServiceDescriptionCollection.GetBinding() - -/* The following program demonstrates the 'GetBinding' method - of 'ServiceDescriptionCollection' class. It searches for a - 'Binding' in the collection and returns the Binding instance. - On success, a message is displayed on the console. - - Note: This program requires 'DataTypes_CS.wsdl' and 'MathService_CS.wsdl' - files to be placed in same directory as that of .exe for running. -*/ -using System; -using System.Xml; -using System.Web.Services.Description; - -class MyServiceDescriptionCollection -{ - public static void Main() - { - try - { - ServiceDescription myServiceDescription1 = - ServiceDescription.Read("DataTypes_CS.wsdl"); - ServiceDescription myServiceDescription2 = - ServiceDescription.Read("MathService_CS.wsdl"); - - // Create the object of 'ServiceDescriptionCollection' class. - ServiceDescriptionCollection myCollection = - new ServiceDescriptionCollection(); - // Add ServiceDescription objects. - myCollection.Add(myServiceDescription1); - myCollection.Add(myServiceDescription2); -// - // Construct an XML qualified name. - XmlQualifiedName myXmlQualifiedName = - new XmlQualifiedName("MathServiceSoap", "http://tempuri2.org/"); - - // Get the Binding from the collection. - Binding myBinding = myCollection.GetBinding(myXmlQualifiedName); -// - Console.WriteLine("Specified Binding is a member of ServiceDescription" - +" instances within the collection"); - } - catch(Exception e) - { - Console.WriteLine("The following exception was raised: {0}", e.Message); - } - } -} diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetMessage/DataTypes_CS.wsdl b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetMessage/DataTypes_CS.wsdl deleted file mode 100644 index d3073f61fd7..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetMessage/DataTypes_CS.wsdl +++ /dev/null @@ -1,919 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetMessage/MathService_CS.wsdl b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetMessage/MathService_CS.wsdl deleted file mode 100644 index ebf12847cfc..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetMessage/MathService_CS.wsdl +++ /dev/null @@ -1,659 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetMessage/Project.csproj b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetMessage/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetMessage/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetMessage/servicedescriptioncollection_getmessage.cs b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetMessage/servicedescriptioncollection_getmessage.cs deleted file mode 100644 index 5c6f245b0e2..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetMessage/servicedescriptioncollection_getmessage.cs +++ /dev/null @@ -1,49 +0,0 @@ -// System.Web.Services.Description.ServiceDescriptionCollection.GetMessage() - -/* The following program demonstrates the 'GetMessage' method - of 'ServiceDescriptionCollection' class. It searches for a - 'Message' in the collection and returns the Message instance. On success, - a message is displayed on the console. - - Note: This program requires 'DataTypes_CS.wsdl' and 'MathService_CS.wsdl' - files to be placed in same directory as that of .exe for running. -*/ -using System; -using System.Xml; -using System.Web.Services.Description; - -class MyServiceDescriptionCollection -{ - public static void Main() - { - try - { - ServiceDescription myServiceDescription1 = - ServiceDescription.Read("DataTypes_CS.wsdl"); - ServiceDescription myServiceDescription2 = - ServiceDescription.Read("MathService_CS.wsdl"); - - // Create the object of 'ServiceDescriptionCollection' class. - ServiceDescriptionCollection myCollection = - new ServiceDescriptionCollection(); - - // Add 'ServiceDescription' objects. - myCollection.Add(myServiceDescription1); - myCollection.Add(myServiceDescription2); -// - // Construct an XML qualified name. - XmlQualifiedName myXmlQualifiedName = - new XmlQualifiedName("AddSoapIn", "http://tempuri2.org/"); - - // Get the Message from the collection. - Message myMessage = myCollection.GetMessage(myXmlQualifiedName); -// - Console.WriteLine("Specified Message is a member of ServiceDescription " - +"instances within the collection."); - } - catch(Exception e) - { - Console.WriteLine("The following exception was raised: {0}", e.Message); - } - } -} \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetPortType/DataTypes_CS.wsdl b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetPortType/DataTypes_CS.wsdl deleted file mode 100644 index d3073f61fd7..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetPortType/DataTypes_CS.wsdl +++ /dev/null @@ -1,919 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetPortType/MathService_CS.wsdl b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetPortType/MathService_CS.wsdl deleted file mode 100644 index ebf12847cfc..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetPortType/MathService_CS.wsdl +++ /dev/null @@ -1,659 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetPortType/Project.csproj b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetPortType/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetPortType/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetPortType/servicedescriptioncollection_getporttype.cs b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetPortType/servicedescriptioncollection_getporttype.cs deleted file mode 100644 index 2cfbbe0def3..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetPortType/servicedescriptioncollection_getporttype.cs +++ /dev/null @@ -1,48 +0,0 @@ -// System.Web.Services.Description.ServiceDescriptionCollection.GetPortType() - -/* The following program demonstrates the 'GetPortType' method - of 'ServiceDescriptionCollection' class. It searches for a - 'PortType' with XmlQualifiedName in the collection and returns a - PortType instance. On success, a message is displayed on the - console. - - Note: This program requires 'DataTypes_CS.wsdl' and 'MathService_CS.wsdl' - files to be placed in same directory as that of .exe for running. -*/ -using System; -using System.Xml; -using System.Web.Services.Description; - -class MyServiceDescriptionCollection -{ - public static void Main() - { - try - { - ServiceDescription myServiceDescription1 = - ServiceDescription.Read("DataTypes_CS.wsdl"); - ServiceDescription myServiceDescription2 = - ServiceDescription.Read("MathService_CS.wsdl"); - - // Create the object of 'ServiceDescriptionCollection' class. - ServiceDescriptionCollection myCollection = - new ServiceDescriptionCollection(); - // Add 'ServiceDescription' objects. - myCollection.Add(myServiceDescription1); - myCollection.Add(myServiceDescription2); -// - // Construct an XML qualified name. - XmlQualifiedName myXmlQualifiedName = - new XmlQualifiedName("MathServiceSoap","http://tempuri2.org/"); - // Get the PortType from the collection. - PortType myPort = myCollection.GetPortType(myXmlQualifiedName); -// - Console.WriteLine("Specified PortType is a member of ServiceDescription " - +"instances within the collection."); - } - catch(Exception e) - { - Console.WriteLine("The following exception was raised: {0}", e.Message); - } - } -} diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetService/DataTypes_CS.wsdl b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetService/DataTypes_CS.wsdl deleted file mode 100644 index d3073f61fd7..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetService/DataTypes_CS.wsdl +++ /dev/null @@ -1,919 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetService/MathService_CS.wsdl b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetService/MathService_CS.wsdl deleted file mode 100644 index ebf12847cfc..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetService/MathService_CS.wsdl +++ /dev/null @@ -1,659 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetService/Project.csproj b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetService/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetService/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetService/servicedescriptioncollection_getservice.cs b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetService/servicedescriptioncollection_getservice.cs deleted file mode 100644 index e1aac991df2..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/GetService/servicedescriptioncollection_getservice.cs +++ /dev/null @@ -1,48 +0,0 @@ -// System.Web.Services.Description.ServiceDescriptionCollection.GetService() - -/* The following program demonstrates the 'GetService' method - of 'ServiceDescriptionCollection' class. It searches for a - 'Service' with XmlQualifiedName in the collection and returns - the Service instance. On success, a message is displayed on the - console. - - Note: This program requires 'DataTypes_CS.wsdl' and 'MathService_CS.wsdl' - files to be placed in same directory as that of .exe for running. -*/ -using System; -using System.Xml; -using System.Web.Services.Description; - -class MyServiceDescriptionCollection -{ - public static void Main() - { - try - { - ServiceDescription myServiceDescription1 = - ServiceDescription.Read("DataTypes_CS.wsdl"); - ServiceDescription myServiceDescription2 = - ServiceDescription.Read("MathService_CS.wsdl"); - - // Create the object of 'ServiceDescriptionCollection' class. - ServiceDescriptionCollection myCollection = new ServiceDescriptionCollection(); - // Add 'ServiceDescription' objects. - myCollection.Add(myServiceDescription1); - myCollection.Add(myServiceDescription2); -// - // Construct an XML qualified name. - XmlQualifiedName myXmlQualifiedName = - new XmlQualifiedName("MathService", "http://tempuri2.org/"); - - // Get the Service from the collection. - Service myService = myCollection.GetService(myXmlQualifiedName); -// - Console.WriteLine("Specified Service is a member of ServiceDescription " - +"instances within the collection"); - } - catch(Exception e) - { - Console.WriteLine("The following exception was raised: {0}", e.Message); - } - } -} \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/Overview/DataTypes_CS.wsdl b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/Overview/DataTypes_CS.wsdl deleted file mode 100644 index d3073f61fd7..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/Overview/DataTypes_CS.wsdl +++ /dev/null @@ -1,919 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/Overview/MathService_CS.wsdl b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/Overview/MathService_CS.wsdl deleted file mode 100644 index ebf12847cfc..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/Overview/MathService_CS.wsdl +++ /dev/null @@ -1,659 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/Overview/servicedescriptioncollection.cs b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/Overview/servicedescriptioncollection.cs deleted file mode 100644 index 9471388da7e..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/Overview/servicedescriptioncollection.cs +++ /dev/null @@ -1,65 +0,0 @@ -// System.Web.Services.Description.ServiceDescriptionCollection - -/*The following program demonstrates the 'ServiceDescriptionCollection' class. - It creates two 'ServiceDescription' objects and add them to - 'ServiceDescriptionCollection' object. It displays the name of 'ServiceDescription' - objects using 'Item' property. 'GetBinding' method is used to display binding instance of the - 'ServiceDescription' object. - - Note: This program requires 'DataTypes_CS.wsdl' and 'MathService_CS.wsdl' files to - be placed in same directory as that of .exe for running. -*/ -// -using System; -using System.Xml; -using System.Web.Services.Description; - -class MyServiceDescriptionCollection -{ - public static void Main() - { - try - { - // Get ServiceDescription objects. - ServiceDescription myServiceDescription1 = - ServiceDescription.Read("DataTypes_CS.wsdl"); - ServiceDescription myServiceDescription2 = - ServiceDescription.Read("MathService_CS.wsdl"); - - // Set the names of the ServiceDescriptions. - myServiceDescription1.Name = "DataTypes"; - myServiceDescription2.Name = "MathService"; - - // Create a ServiceDescriptionCollection. - ServiceDescriptionCollection myServiceDescriptionCollection = - new ServiceDescriptionCollection(); - - // Add the ServiceDescriptions to the collection. - myServiceDescriptionCollection.Add(myServiceDescription1); - myServiceDescriptionCollection.Add(myServiceDescription2); - - // Display the elements of the collection using the indexer. - Console.WriteLine("Elements in the collection: "); - for(int i = 0; i < myServiceDescriptionCollection.Count; i++) - { - Console.WriteLine(myServiceDescriptionCollection[i].Name); - } - - // Construct an XML qualified name. - XmlQualifiedName myXmlQualifiedName = - new XmlQualifiedName("MathServiceSoap", "http://tempuri2.org/"); - - // Get the Binding from the collection. - Binding myBinding = - myServiceDescriptionCollection.GetBinding(myXmlQualifiedName); - - Console.WriteLine("Binding found in collection with name: " + - myBinding.ServiceDescription.Name); - } - catch(Exception e) - { - Console.WriteLine("The following exception was raised: {0}", e.Message); - } - } -} -// diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionFormatExtensionCollection/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionFormatExtensionCollection/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionFormatExtensionCollection/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionFormatExtensionCollection/Overview/Sample_CS.WSDL b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionFormatExtensionCollection/Overview/Sample_CS.WSDL deleted file mode 100644 index 641f3817356..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionFormatExtensionCollection/Overview/Sample_CS.WSDL +++ /dev/null @@ -1,255 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionFormatExtensionCollection/Overview/servicedescriptionformatextension_13.cs b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionFormatExtensionCollection/Overview/servicedescriptionformatextension_13.cs deleted file mode 100644 index f47acdfcad1..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionFormatExtensionCollection/Overview/servicedescriptionformatextension_13.cs +++ /dev/null @@ -1,149 +0,0 @@ -// System.Web.Services.Description.ServiceDescriptionFormatExtensionCollection -// System.Web.Services.Description.ServiceDescriptionFormatExtensionCollection.ctor -// System.Web.Services.Description.ServiceDescriptionFormatExtensionCollection.Add() -// System.Web.Services.Description.ServiceDescriptionFormatExtensionCollection.Item -// System.Web.Services.Description.ServiceDescriptionFormatExtensionCollection.Find(System.Type type) -// System.Web.Services.Description.ServiceDescriptionFormatExtensionCollection.FindAll(System.Type type) -// System.Web.Services.Description.ServiceDescriptionFormatExtensionCollection.IsHandled() -// System.Web.Services.Description.ServiceDescriptionFormatExtensionCollection.IsRequired() -// System.Web.Services.Description.ServiceDescriptionFormatExtensionCollection.CopyTo() -// System.Web.Services.Description.ServiceDescriptionFormatExtensionCollection.Contains() -// System.Web.Services.Description.ServiceDescriptionFormatExtensionCollection.IndexOf() -// System.Web.Services.Description.ServiceDescriptionFormatExtensionCollection.Remove() -// System.Web.Services.Description.ServiceDescriptionFormatExtensionCollection.Insert() - -/* The following program demonstrates the class, properties and methods of - 'ServiceDescriptionFormatExtensionCollection' - class. It creates a ServiceDescription object, uses it to create - 'ServiceDescriptionFormatExtensionCollection' object. Collection - object is used for demonstration of class properties and methods. - - Note: This program requires 'Sample_CS.wsdl' file to be placed in - the same directory as that of .exe for running. - */ - -// -using System; -using System.Web.Services.Description; -using System.Collections; - -class MyFormatExtension : ServiceDescriptionFormatExtension -{ - public MyFormatExtension() - { - // Set the properties. - this.Handled = true; - this.Required = true; - } -} -class myCollectionSample -{ - static void Main() - { - try - { -// - ServiceDescription myServiceDescription = - ServiceDescription.Read("Sample_CS.wsdl"); - ServiceDescriptionFormatExtensionCollection myCollection = - new ServiceDescriptionFormatExtensionCollection(myServiceDescription); -// -// - SoapBinding mySoapBinding1 = new SoapBinding(); - SoapBinding mySoapBinding2 = new SoapBinding(); - SoapAddressBinding mySoapAddressBinding = new SoapAddressBinding(); - MyFormatExtension myFormatExtensionObject = new MyFormatExtension(); - // Add elements to collection. - myCollection.Add(mySoapBinding1); - myCollection.Add(mySoapAddressBinding); - myCollection.Add(mySoapBinding2); - myCollection.Add(myFormatExtensionObject); -// -// - Console.WriteLine("Collection contains following types of elements: "); - // Display the 'Type' of the elements in collection. - for(int i = 0;i< myCollection.Count;i++) - { - Console.WriteLine(myCollection[i].GetType().ToString()); - } -// -// - // Check element of type 'SoapAddressBinding' in collection. - Object myObj = myCollection.Find(mySoapAddressBinding.GetType()); - if(myObj == null) - { - Console.WriteLine("Element of type '{0}' not found in collection.", - mySoapAddressBinding.GetType().ToString()); - } - else - { - Console.WriteLine("Element of type '{0}' found in collection.", - mySoapAddressBinding.GetType().ToString()); - } -// -// - // Check all elements of type 'SoapBinding' in collection. - Object[] myObjectArray1 = new Object[myCollection.Count]; - myObjectArray1 = myCollection.FindAll(mySoapBinding1.GetType()); - int myNumberOfElements = 0; - IEnumerator myIEnumerator = myObjectArray1.GetEnumerator(); - - // Calculate number of elements of type 'SoapBinding'. - while(myIEnumerator.MoveNext()) - { - if(mySoapBinding1.GetType() == myIEnumerator.Current.GetType()) - myNumberOfElements++; - } - Console.WriteLine("Collection contains {0} objects of type '{1}'.", - myNumberOfElements.ToString(), - mySoapBinding1.GetType().ToString()); -// -// - // Check 'IsHandled' status for 'myFormatExtensionObject' object in collection. - Console.WriteLine("'IsHandled' status for {0} object is {1}.", - myFormatExtensionObject.ToString(), - myCollection.IsHandled(myFormatExtensionObject).ToString()); -// -// - // Check 'IsRequired' status for 'myFormatExtensionObject' object in collection. - Console.WriteLine("'IsRequired' status for {0} object is {1}.", - myFormatExtensionObject.ToString(), - myCollection.IsRequired(myFormatExtensionObject).ToString()); -// -// - // Copy elements of collection to an Object array. - Object[] myObjectArray2 = new Object[myCollection.Count]; - myCollection.CopyTo(myObjectArray2,0); - Console.WriteLine("Collection elements are copied to an object array."); -// -// - // Check for 'myFormatExtension' object in collection. - if(myCollection.Contains(myFormatExtensionObject)) - { -// - // Get index of a 'myFormatExtension' object in collection. - Console.WriteLine("Index of 'myFormatExtensionObject' is "+ - "{0} in collection.", - myCollection.IndexOf(myFormatExtensionObject).ToString()); -// -// - // Remove 'myFormatExtensionObject' element from collection. - myCollection.Remove(myFormatExtensionObject); - Console.WriteLine("'myFormatExtensionObject' is removed"+ - " from collection."); -// - } -// -// - // Insert 'MyFormatExtension' object. - myCollection.Insert(0,myFormatExtensionObject); - Console.WriteLine("'myFormatExtensionObject' is inserted to collection."); -// - } - catch(Exception e) - { - Console.WriteLine("The following exception was raised: {0}", e.Message); - } - } -} -// \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionImporter/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionImporter/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionImporter/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionImporter/Overview/import.cs b/snippets/csharp/System.Web.Services.Description/ServiceDescriptionImporter/Overview/import.cs deleted file mode 100644 index 9f9f6037329..00000000000 --- a/snippets/csharp/System.Web.Services.Description/ServiceDescriptionImporter/Overview/import.cs +++ /dev/null @@ -1,68 +0,0 @@ -// -using System; -using System.Web.Services.Description; -using System.CodeDom; -using System.CodeDom.Compiler; -using System.Security.Permissions; - -public class Import { - - public static void Main() - { - Run(); - } - - [PermissionSetAttribute(SecurityAction.Demand, Name = "Full Trust")] - public static void Run() - { - // Get a WSDL file describing a service. - ServiceDescription description = ServiceDescription.Read("service.wsdl"); - -// - // Initialize a service description importer. - ServiceDescriptionImporter importer = new ServiceDescriptionImporter(); - importer.ProtocolName = "Soap12"; // Use SOAP 1.2. - importer.AddServiceDescription(description,null,null); -// - -// - // Report on the service descriptions. - Console.WriteLine("Importing {0} service descriptions with {1} associated schemas.", - importer.ServiceDescriptions.Count, importer.Schemas.Count); -// - -// - // Generate a proxy client. - importer.Style = ServiceDescriptionImportStyle.Client; -// - -// - // Generate properties to represent primitive values. - importer.CodeGenerationOptions = System.Xml.Serialization.CodeGenerationOptions.GenerateProperties; -// - - // Initialize a Code-DOM tree into which we will import the service. - CodeNamespace nmspace = new CodeNamespace(); - CodeCompileUnit unit = new CodeCompileUnit(); - unit.Namespaces.Add(nmspace); - -// - // Import the service into the Code-DOM tree. This creates proxy code - // that uses the service. - ServiceDescriptionImportWarnings warning = importer.Import(nmspace,unit); - - if (warning == 0) - { - // Generate and print the proxy code in C#. - CodeDomProvider provider = CodeDomProvider.CreateProvider("CSharp"); - provider.GenerateCodeFromCompileUnit(unit, Console.Out, new CodeGeneratorOptions() ); - } - else - { - // Print an error message. - Console.WriteLine(warning); - } -// -} -} -// \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/SoapAddressBinding/Overview/AddNumbersInput_cs.wsdl b/snippets/csharp/System.Web.Services.Description/SoapAddressBinding/Overview/AddNumbersInput_cs.wsdl deleted file mode 100644 index 702370537d8..00000000000 --- a/snippets/csharp/System.Web.Services.Description/SoapAddressBinding/Overview/AddNumbersInput_cs.wsdl +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/SoapAddressBinding/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/SoapAddressBinding/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/SoapAddressBinding/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/SoapAddressBinding/Overview/soapoperationbinding.cs b/snippets/csharp/System.Web.Services.Description/SoapAddressBinding/Overview/soapoperationbinding.cs deleted file mode 100644 index b7659a954ac..00000000000 --- a/snippets/csharp/System.Web.Services.Description/SoapAddressBinding/Overview/soapoperationbinding.cs +++ /dev/null @@ -1,104 +0,0 @@ -// System.Web.Services.Description.SoapBinding -// System.Web.Services.Description.SoapOperationBinding -// System.Web.Services.Description.SoapBodyBinding -// System.Web.Services.Description.SoapAddressBinding -// System.Web.Services.Description.SoapBinding.HttpTransport; - -/* -The following example demonstrates the 'SoapBinding', 'SoapOperationBinding' , -'SoapBodyBinding' , SoapAddressBinding' classes and 'HttpTransport' field of 'SoapBinding' class. - -It takes a wsdl file which supports two protocols 'HttpGet' and 'HttpPost' as input. By using the -'Read' method of 'ServiceDescription' class it gets the 'ServiceDescription' object. It uses -the SOAP protocol related classes and creates 'Binding','Port' and 'PortType' elements of -'SOAP' protocol. It adds all the elements to the 'ServiceDescription' object. The 'ServiceDescription' -object creates another wsdl file which supports 'SOAP' also. This wsdl file is used to generate a proxy -which is used by the .aspx file. -*/ - -// -// -// -// - -using System; -using System.Web.Services.Description; -using System.Collections; -using System.Xml; - - class MySoapClass - { - public static void Main() - { - ServiceDescription myDescription = - ServiceDescription.Read("AddNumbersInput_cs.wsdl"); - // Create a 'Binding' object for the 'SOAP' protocol. - Binding myBinding = new Binding(); - myBinding.Name = "Service1Soap"; - XmlQualifiedName qualifiedName = - new XmlQualifiedName("s0:Service1Soap"); - myBinding.Type = qualifiedName; - -// - SoapBinding mySoapBinding = new SoapBinding(); - mySoapBinding.Transport = SoapBinding.HttpTransport; - mySoapBinding.Style = SoapBindingStyle.Document; -// - // Add the 'SoapBinding' object to the 'Binding' object. - myBinding.Extensions.Add(mySoapBinding); - - // Create the 'OperationBinding' object for the 'SOAP' protocol. - OperationBinding myOperationBinding = new OperationBinding(); - myOperationBinding.Name = "AddNumbers"; - - // Create the 'SoapOperationBinding' object for the 'SOAP' protocol. - SoapOperationBinding mySoapOperationBinding = - new SoapOperationBinding(); - mySoapOperationBinding.SoapAction = "http://tempuri.org/AddNumbers"; - mySoapOperationBinding.Style = SoapBindingStyle.Document; - // Add the 'SoapOperationBinding' object to 'OperationBinding' object. - myOperationBinding.Extensions.Add(mySoapOperationBinding); - - // Create the 'InputBinding' object for the 'SOAP' protocol. - InputBinding myInput = new InputBinding(); - SoapBodyBinding mySoapBinding1 = new SoapBodyBinding(); - mySoapBinding1.Use= SoapBindingUse.Literal; - myInput.Extensions.Add(mySoapBinding1); - // Assign the 'InputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInput; - // Create the 'OutputBinding' object' for the 'SOAP' protocol.. - OutputBinding myOutput = new OutputBinding(); - myOutput.Extensions.Add(mySoapBinding1); - // Assign the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding.Output = myOutput; - - // Add the 'OperationBinding' to 'Binding'. - myBinding.Operations.Add(myOperationBinding); - - // Add the 'Binding' to 'BindingCollection' of 'ServiceDescription'. - myDescription.Bindings.Add(myBinding); - - Port soapPort = new Port(); - soapPort.Name = "Service1Soap"; - soapPort.Binding = new XmlQualifiedName("s0:Service1Soap"); - - // Create a 'SoapAddressBinding' object for the 'SOAP' protocol. - SoapAddressBinding mySoapAddressBinding = - new SoapAddressBinding(); - mySoapAddressBinding.Location = "http://localhost/AddNumbers.cs.asmx"; - - // Add the 'SoapAddressBinding' to the 'Port'. - soapPort.Extensions.Add(mySoapAddressBinding); - - // Add the 'Port' to 'PortCollection' of 'ServiceDescription'. - myDescription.Services[0].Ports.Add(soapPort); - - // Write the 'ServiceDescription' as a WSDL file. - myDescription.Write("AddNumbersOut_cs.wsdl"); - Console.WriteLine(" 'AddNumbersOut_cs.Wsdl' file was generated"); - } -} -// -// -// -// diff --git a/snippets/csharp/System.Web.Services.Description/SoapBinding/Namespace/AddNumbersInput_cs.wsdl b/snippets/csharp/System.Web.Services.Description/SoapBinding/Namespace/AddNumbersInput_cs.wsdl deleted file mode 100644 index bc43678326d..00000000000 --- a/snippets/csharp/System.Web.Services.Description/SoapBinding/Namespace/AddNumbersInput_cs.wsdl +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/SoapBinding/Namespace/Project.csproj b/snippets/csharp/System.Web.Services.Description/SoapBinding/Namespace/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/SoapBinding/Namespace/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/SoapBinding/Namespace/Service1_cs.asmx b/snippets/csharp/System.Web.Services.Description/SoapBinding/Namespace/Service1_cs.asmx deleted file mode 100644 index 5d5d939864f..00000000000 --- a/snippets/csharp/System.Web.Services.Description/SoapBinding/Namespace/Service1_cs.asmx +++ /dev/null @@ -1,18 +0,0 @@ -<%@ WebService Language="C#" Class="Service1" %> -using System; -using System.Collections; -using System.ComponentModel; -using System.Data; -using System.Diagnostics; -using System.Web; -using System.Web.Services; - - public class Service1:WebService - { - [WebMethod] - public int AddNumbers(int firstNumber,int secondNumber) - { - return firstNumber+secondNumber; - } - } - diff --git a/snippets/csharp/System.Web.Services.Description/SoapBinding/Namespace/soapbodybinding_parts.cs b/snippets/csharp/System.Web.Services.Description/SoapBinding/Namespace/soapbodybinding_parts.cs deleted file mode 100644 index c757d6d7f52..00000000000 --- a/snippets/csharp/System.Web.Services.Description/SoapBinding/Namespace/soapbodybinding_parts.cs +++ /dev/null @@ -1,85 +0,0 @@ -// System.Web.Services.Description.SoapBinding.Namespace -// System.Web.Services.Description.SoapBodyBinding.Parts - -/* -The following example demonstrates the 'Namespace' field of 'SoapBinding' class -and 'parts' property of 'SoapBodyBinding' class. -It takes a wsdl file which supports two protocols 'HttpGet' and 'HttpPost' as input. By -using the 'Read' method of 'ServiceDescription' class it gets the 'ServiceDescription' -object. It uses the SOAP protocol related classes to create 'Binding' elements of -'SOAP' protocol. It adds all the elements to the 'ServiceDescription' object. The -'ServiceDescription' object creates another wsdl file which supports 'SOAP' protocol -also. This wsdl file is used to generate a proxy which is used by the .aspx file. -*/ -using System; -using System.Web.Services.Description; -using System.Collections; -using System.Xml; - - class MySoapClass - { - public static void Main() - { - ServiceDescription myDescription = - ServiceDescription.Read("AddNumbersInput_cs.wsdl"); - // Create a 'Binding' object for the 'SOAP' protocol. - Binding myBinding = new Binding(); - myBinding.Name = "Service1Soap"; - XmlQualifiedName qualifiedName = - new XmlQualifiedName("s0:Service1Soap"); - - myBinding.Type = qualifiedName; -// - SoapBinding mySoapBinding = new SoapBinding(); - mySoapBinding.Transport = "http://schemas.xmlsoap.org/soap/http"; - mySoapBinding.Style = SoapBindingStyle.Document; - // Get the URI for XML namespace of the SoapBinding class. - String myNameSpace = SoapBinding.Namespace; - Console.WriteLine("The URI of the XML Namespace is :"+myNameSpace); -// - - // Add the 'SoapBinding' object to the 'Binding' object. - myBinding.Extensions.Add(mySoapBinding); - - // Create the 'OperationBinding' object for the 'SOAP' protocol. - OperationBinding myOperationBinding = new OperationBinding(); - myOperationBinding.Name = "AddNumbers"; - - // Create the 'SoapOperationBinding' object for the 'SOAP' protocol. - SoapOperationBinding mySoapOperationBinding = - new SoapOperationBinding(); - mySoapOperationBinding.SoapAction = "http://tempuri.org/AddNumbers"; - mySoapOperationBinding.Style = SoapBindingStyle.Document; - // Add the 'SoapOperationBinding' object to 'OperationBinding' object. - myOperationBinding.Extensions.Add(mySoapOperationBinding); - -// - // Create the 'InputBinding' object for the 'SOAP' protocol. - InputBinding myInput = new InputBinding(); - SoapBodyBinding mySoapBinding1 = new SoapBodyBinding(); - mySoapBinding1.Use= SoapBindingUse.Literal; - - String[] myParts = new String[1]; - myParts[0] = "parameters"; - // Set the names of the message parts to appear in the SOAP body. - mySoapBinding1.Parts = myParts; - myInput.Extensions.Add(mySoapBinding1); - // Add the 'InputBinding' object to 'OperationBinding' object. - myOperationBinding.Input = myInput; - // Create the 'OutputBinding' object'. - OutputBinding myOutput = new OutputBinding(); - myOutput.Extensions.Add(mySoapBinding1); - // Add the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding.Output = myOutput; -// - // Add the 'OperationBinding' to 'Binding'. - myBinding.Operations.Add(myOperationBinding); - - // Add the 'Binding' to 'BindingCollection' of 'ServiceDescription'. - myDescription.Bindings.Add(myBinding); - - // Write the 'ServiceDescription' as a WSDL file. - myDescription.Write("AddNumbersOut_cs.wsdl"); - Console.WriteLine(" 'AddNumbersOut_cs.Wsdl' file was generated"); - } -} \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/SoapBinding/Style/AddNumbersInput_cs.wsdl b/snippets/csharp/System.Web.Services.Description/SoapBinding/Style/AddNumbersInput_cs.wsdl deleted file mode 100644 index 1bd09a36bee..00000000000 --- a/snippets/csharp/System.Web.Services.Description/SoapBinding/Style/AddNumbersInput_cs.wsdl +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/SoapBinding/Style/Project.csproj b/snippets/csharp/System.Web.Services.Description/SoapBinding/Style/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/SoapBinding/Style/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/SoapBinding/Style/Service1_cs.asmx b/snippets/csharp/System.Web.Services.Description/SoapBinding/Style/Service1_cs.asmx deleted file mode 100644 index 5d5d939864f..00000000000 --- a/snippets/csharp/System.Web.Services.Description/SoapBinding/Style/Service1_cs.asmx +++ /dev/null @@ -1,18 +0,0 @@ -<%@ WebService Language="C#" Class="Service1" %> -using System; -using System.Collections; -using System.ComponentModel; -using System.Data; -using System.Diagnostics; -using System.Web; -using System.Web.Services; - - public class Service1:WebService - { - [WebMethod] - public int AddNumbers(int firstNumber,int secondNumber) - { - return firstNumber+secondNumber; - } - } - diff --git a/snippets/csharp/System.Web.Services.Description/SoapBinding/Style/soapprotocol.cs b/snippets/csharp/System.Web.Services.Description/SoapBinding/Style/soapprotocol.cs deleted file mode 100644 index f7d63125033..00000000000 --- a/snippets/csharp/System.Web.Services.Description/SoapBinding/Style/soapprotocol.cs +++ /dev/null @@ -1,172 +0,0 @@ -// System.Web.Services.Description.SoapBinding.ctor -// System.Web.Services.Description.SoapBinding.Transport -// System.Web.Services.Description.SoapBinding.Style -// System.Web.Services.Description.SoapBindingStyle.Document -// System.Web.Services.Description.SoapOperationBinding.ctor -// System.Web.Services.Description.SoapOperationBinding.SoapAction -// System.Web.Services.Description.SoapOperationBinding.Style -// System.Web.Services.Description.SoapBodyBinding.ctor -// System.Web.Services.Description.SoapBodyBinding.Use -// System.Web.Services.Description.SoapBindingUse.Literal -// System.Web.Services.Description.SoapAddressBinding.ctor -// System.Web.Services.Description.SoapAddressBinding.Location - -/* -The following example demonstrates the 'SoapBinding' constructor,'Transport','Style' -properties of 'SoapBinding' class,'Document' member of 'SoapBindingStyle' enum, -'SoapOperationBinding' constructor,'SoapAction','Style' properties of 'SoapOperationBinding' -class, 'SoapBodyBinding' contructor,'Use' property of 'SoapBodyBinding' class, -'Literal' member of 'SoapBindingUse' enum and 'SoapAddressBinding' constructor, 'Location' -property of class 'SoapAddressBinding'. - -It takes as input a wsdl file which supports two protocols 'HttpGet' and 'HttpPost' . -By using the 'Read' method of 'ServiceDescription' class it gets a 'ServiceDescription' -object. It uses the SOAP protocol related classes and creates 'Binding','Port', -'PortType' and 'Message' elements of 'SOAP' protocol. It adds all these elements to -the 'ServiceDescription' object. The 'ServiceDescription' object creates another -wsdl file which supports 'SOAP' also. This wsdl file is used to generate a proxy -which is used by the .aspx file. -Note: To run the example run the makefile provided and open the '.aspx' file in browser. -*/ - -using System; -using System.Web.Services.Description; -using System.Collections; -using System.Xml; - - class MySoapClass - { - public static void Main() - { - ServiceDescription myDescription = - ServiceDescription.Read("AddNumbersInput_cs.wsdl"); - // Create a 'Binding' object for the 'SOAP' protocol. - Binding myBinding = new Binding(); - myBinding.Name = "Service1Soap"; - XmlQualifiedName qualifiedName = - new XmlQualifiedName("s0:Service1Soap"); - myBinding.Type = qualifiedName; - -// -// -// -// - SoapBinding mySoapBinding = new SoapBinding(); - mySoapBinding.Transport = "http://schemas.xmlsoap.org/soap/http"; - mySoapBinding.Style = SoapBindingStyle.Document; - // Add the 'SoapBinding' object to the 'Binding' object. - myBinding.Extensions.Add(mySoapBinding); -// -// -// -// - - // Create the 'OperationBinding' object for the 'SOAP' protocol. - OperationBinding myOperationBinding = new OperationBinding(); - myOperationBinding.Name = "AddNumbers"; - -// -// -// - // Create the 'SoapOperationBinding' object for the 'SOAP' protocol. - SoapOperationBinding mySoapOperationBinding = - new SoapOperationBinding(); - mySoapOperationBinding.SoapAction = "http://tempuri.org/AddNumbers"; - mySoapOperationBinding.Style = SoapBindingStyle.Document; - // Add the 'SoapOperationBinding' object to 'OperationBinding' object. - myOperationBinding.Extensions.Add(mySoapOperationBinding); -// -// -// - -// -// -// - // Create the 'InputBinding' object for the 'SOAP' protocol. - InputBinding myInput = new InputBinding(); - SoapBodyBinding mySoapBinding1 = new SoapBodyBinding(); - mySoapBinding1.Use= SoapBindingUse.Literal; - myInput.Extensions.Add(mySoapBinding1); - // Add the 'InputBinding' object to 'OperationBinding' object. - myOperationBinding.Input = myInput; - // Create the 'OutputBinding' object'. - OutputBinding myOutput = new OutputBinding(); - myOutput.Extensions.Add(mySoapBinding1); - // Add the 'OutputBinding' object to 'OperationBinding' object. - myOperationBinding.Output = myOutput; - // Add the 'OperationBinding' object to 'Binding' object. - myBinding.Operations.Add(myOperationBinding); - // Add the 'Binding' object to the ServiceDescription instance. - myDescription.Bindings.Add(myBinding); -// -// -// - -// -// - Port soapPort = new Port(); - soapPort.Name = "Service1Soap"; - soapPort.Binding = new XmlQualifiedName("s0:Service1Soap"); - // Create a 'SoapAddressBinding' object for the 'SOAP' protocol. - SoapAddressBinding mySoapAddressBinding = - new SoapAddressBinding(); - mySoapAddressBinding.Location = "http://localhost/Service1_cs.asmx"; - // Add the 'SoapAddressBinding' object to the 'Port'. - soapPort.Extensions.Add(mySoapAddressBinding); - // Add the 'Port' object to the ServiceDescription instance. - myDescription.Services[0].Ports.Add(soapPort); -// -// - - // Create a 'PortType' object. for SOAP protocol. - PortType soapPortType = new PortType(); - soapPortType.Name = "Service1Soap"; - Operation soapOperation = new Operation(); - soapOperation.Name = "AddNumbers"; - - OperationMessage soapInput =(OperationMessage)new OperationInput(); - soapInput.Message =new XmlQualifiedName("s0:AddNumbersSoapIn"); - OperationMessage soapOutput =(OperationMessage)new OperationOutput(); - soapOutput.Message =new XmlQualifiedName("s0:AddNumbersSoapOut"); - - soapOperation.Messages.Add(soapInput); - soapOperation.Messages.Add(soapOutput); - - // Add the 'Operation' object to 'PortType' object. - soapPortType.Operations.Add(soapOperation); - - // Add the 'PortType' object first to 'PortTypeCollection' object - // and then to 'ServiceDescription' object. - myDescription.PortTypes.Add(soapPortType); - - // Create the 'Message' object. - Message soapMessage1 = new Message(); - soapMessage1.Name="AddNumbersSoapIn"; - // Create the 'MessageParts' object. - MessagePart soapMessagePart1 = new MessagePart(); - soapMessagePart1.Name = "parameters"; - soapMessagePart1.Element = new XmlQualifiedName("s0:AddNumbers"); - - // Add the 'MessagePart' object to 'Messages' object. - soapMessage1.Parts.Add(soapMessagePart1); - - // Create another 'Message' object. - Message soapMessage2 = new Message(); - soapMessage2.Name = "AddNumbersSoapOut"; - - MessagePart soapMessagePart2 = new MessagePart(); - soapMessagePart2.Name = "parameters"; - soapMessagePart2.Element = - new XmlQualifiedName("s0:AddNumbersResponse"); - // Add the 'MessagePart' object to second 'Message' object. - soapMessage2.Parts.Add(soapMessagePart2); - - // Add the 'Message' objects to 'ServiceDescription'. - myDescription.Messages.Add(soapMessage1); - myDescription.Messages.Add(soapMessage2); - - // Write the 'ServiceDescription' object as a WSDL file. - myDescription.Write("AddNumbersOut_cs.wsdl"); - Console.WriteLine(" 'AddNumbersOut_cs.Wsdl' file was generated"); - } -} \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/SoapBodyBinding/Encoding/Project.csproj b/snippets/csharp/System.Web.Services.Description/SoapBodyBinding/Encoding/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/SoapBodyBinding/Encoding/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/SoapBodyBinding/Encoding/SoapBindingStyleInput_cs.wsdl b/snippets/csharp/System.Web.Services.Description/SoapBodyBinding/Encoding/SoapBindingStyleInput_cs.wsdl deleted file mode 100644 index bd5b05fd1aa..00000000000 --- a/snippets/csharp/System.Web.Services.Description/SoapBodyBinding/Encoding/SoapBindingStyleInput_cs.wsdl +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/SoapBodyBinding/Encoding/soapbindingstyle_rpc.cs b/snippets/csharp/System.Web.Services.Description/SoapBodyBinding/Encoding/soapbindingstyle_rpc.cs deleted file mode 100644 index 52a3e55c30e..00000000000 --- a/snippets/csharp/System.Web.Services.Description/SoapBodyBinding/Encoding/soapbindingstyle_rpc.cs +++ /dev/null @@ -1,106 +0,0 @@ -// System.Web.Services.Description.SoapBindingStyle.Rpc -// System.Web.Services.Description.SoapBindingUse.Encoded -// System.Web.Services.Description.SoapBodyBinding.Encoding -// System.Web.Services.Description.SoapBodyBinding.Namespace -// System.Web.Services.Description.SoapHeaderBinding.Encoding -// System.Web.Services.Description.SoapHeaderBinding.Namespace - -/* -The following example demonstrates the 'Rpc' member of 'SoapBindingStyle' -enumeration ,'Encoded' member of 'SoapBindingUse' enumeration ,'Encoding' -and 'Namespace' properties of 'SoapBodyBinding' class and 'Encoding' -and 'Namespace' properties of 'SoapHeaderBinding' class. -It takes as input a wsdl file which does not contain a binding for SOAP. -By using the 'Read' method of 'ServiceDescription' class it gets a 'ServiceDescription' object. -It uses the SOAP protocol related classes and creates 'Binding' element -of 'SOAP' protocol which are then added to the 'ServiceDescription' object. -An output wsdl file is generated from 'ServiceDescription' object which -could be used for generating a proxy. -*/ - -using System; -using System.Web.Services.Description; -using System.Collections; -using System.Xml; - public class MySoapBindingClass - { - public static void Main() - { - ServiceDescription myServiceDescription = - ServiceDescription.Read("SoapBindingStyleInput_cs.wsdl"); - Binding myBinding = new Binding(); - myBinding.Name = "SOAPSvrMgr_SOAPBinding"; - myBinding.Type =new XmlQualifiedName("tns:SOAPSvrMgr_portType"); - -// - SoapBinding mySoapBinding =new SoapBinding(); - mySoapBinding.Transport="http://schemas.xmlsoap.org/soap/http"; - // Message to be transmitted contains parameters to call a procedure. - mySoapBinding.Style=SoapBindingStyle.Rpc; - myBinding.Extensions.Add(mySoapBinding); -// - - OperationBinding myOperationBinding = new OperationBinding(); - myOperationBinding.Name = "GetServerStats"; - - SoapOperationBinding mySoapOperationBinding = - new SoapOperationBinding(); - mySoapOperationBinding.SoapAction = - "http://tempuri.org/soapsvcmgr/GetServerStats"; - myOperationBinding.Extensions.Add(mySoapOperationBinding); - - // Create InputBinding for operation for the 'SOAP' protocol. - InputBinding myInputBinding = new InputBinding(); -// -// -// - SoapBodyBinding mySoapBodyBinding = new SoapBodyBinding(); - // Encode SOAP body using rules specified by the 'Encoding' property. - mySoapBodyBinding.Use = SoapBindingUse.Encoded; - // Set URI representing the encoding style for encoding the body. - mySoapBodyBinding.Encoding="http://schemas.xmlsoap.org/soap/encoding/"; - // Set the Uri representing the location of the specification - // for encoding of content not defined by 'Encoding' property'. - mySoapBodyBinding.Namespace="http://tempuri.org/soapsvcmgr/"; - myInputBinding.Extensions.Add(mySoapBodyBinding); -// -// -// - -// -// - SoapHeaderBinding mySoapHeaderBinding=new SoapHeaderBinding(); - mySoapHeaderBinding.Message= - new XmlQualifiedName("tns:Soapsvcmgr_Headers_Request"); - mySoapHeaderBinding.Part="AuthCS"; - // Encode SOAP header using rules specified by the 'Encoding' property. - mySoapHeaderBinding.Use=SoapBindingUse.Encoded; - // Set URI representing the encoding style for encoding the header. - mySoapHeaderBinding.Encoding = "http://schemas.xmlsoap.org/soap/encoding/"; - // Set the Uri representing the location of the specification - // for encoding of content not defined by 'Encoding' property'. - mySoapHeaderBinding.Namespace = "http://tempuri.org/SOAPSvr/soapsvcmgr/headers.xsd"; - // Add mySoapHeaderBinding to the 'myInputBinding' object. - myInputBinding.Extensions.Add(mySoapHeaderBinding); -// -// - // Create OutputBinding for operation. - OutputBinding myOutputBinding = new OutputBinding(); - myOutputBinding.Extensions.Add(mySoapBodyBinding); - mySoapHeaderBinding.Part="AuthSC"; - mySoapHeaderBinding.Message= - new XmlQualifiedName("tns:Soapsvcmgr_Headers_Response"); - myOutputBinding.Extensions.Add(mySoapHeaderBinding); - - // Add 'InputBinding' and 'OutputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInputBinding; - myOperationBinding.Output = myOutputBinding; - myBinding.Operations.Add(myOperationBinding); - - myServiceDescription.Bindings.Add(myBinding); - myServiceDescription.Write("SoapBindingStyleOutput_cs.wsdl"); - Console.WriteLine("'SoapBindingStyleOutput_cs.wsdl' file is generated."); - Console.WriteLine("Proxy could be created using command"+ - " 'wsdl SoapBindingStyleOutput_cs.wsdl'"); - } - } \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/SoapBodyBinding/PartsString/Project.csproj b/snippets/csharp/System.Web.Services.Description/SoapBodyBinding/PartsString/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/SoapBodyBinding/PartsString/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/SoapBodyBinding/PartsString/SoapFaultInput_cs.wsdl b/snippets/csharp/System.Web.Services.Description/SoapBodyBinding/PartsString/SoapFaultInput_cs.wsdl deleted file mode 100644 index 03b34dee9a3..00000000000 --- a/snippets/csharp/System.Web.Services.Description/SoapBodyBinding/PartsString/SoapFaultInput_cs.wsdl +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/SoapBodyBinding/PartsString/soapfaultbinding_ctor.cs b/snippets/csharp/System.Web.Services.Description/SoapBodyBinding/PartsString/soapfaultbinding_ctor.cs deleted file mode 100644 index 45b8d31700a..00000000000 --- a/snippets/csharp/System.Web.Services.Description/SoapBodyBinding/PartsString/soapfaultbinding_ctor.cs +++ /dev/null @@ -1,101 +0,0 @@ -// System.Web.Services.Description.SoapBodyBinding.PartsString -// System.Web.Services.Description.SoapFaultBinding.ctor -// System.Web.Services.Description.SoapFaultBinding.Use -// System.Web.Services.Description.SoapFaultBinding.Encoding -// System.Web.Services.Description.SoapFaultBinding.NameSpace - -/* - The following example demonstrates the 'PartsString' property of 'SoapBodyBinding' class - and constructor, 'Encoding', 'NameSpace' and 'Use'properties of 'SoapFaultBinding' class. - - It creates an instance of 'ServiceDescription' class by reading an existing - wsdl file. Then it creates an instance of 'SoapFaultBinding' and adds it to - the collection object of 'Binding' class. It generates a new wsdl file where - the properties of 'SoapFaultBinding' objects are reflected and which could be - used for generating a proxy. -*/ - - using System; - using System.Web.Services.Description; - public class MySoapFaultBindingSample - { - public static void Main() - { - try - { - // Input wsdl file. - string myInputWsdlFile="SoapFaultInput_cs.wsdl"; - // Output wsdl file. - string myOutputWsdlFile="SoapFaultOutput_cs.wsdl"; - // Initialize an instance of a 'ServiceDescription' object. - ServiceDescription myServiceDescription = - ServiceDescription.Read(myInputWsdlFile); - // Get a SOAP binding object with binding name "MyService1Soap". - Binding myBinding=myServiceDescription.Bindings["MyService1Soap"]; - // Create the 'OperationBinding' object for the 'SOAP' protocol. - OperationBinding myOperationBinding = new OperationBinding(); - myOperationBinding.Name = "Add"; - - // Create the 'SoapOperationBinding' object for the 'SOAP' protocol. - SoapOperationBinding mySoapOperationBinding = - new SoapOperationBinding(); - mySoapOperationBinding.SoapAction = "http://tempuri.org/Add"; - mySoapOperationBinding.Style = SoapBindingStyle.Document; - // Add the 'SoapOperationBinding' object to 'OperationBinding' object. - myOperationBinding.Extensions.Add(mySoapOperationBinding); -// - // Create the 'InputBinding' object for the 'SOAP' protocol. - InputBinding myInput = new InputBinding(); - SoapBodyBinding mySoapBinding1 = new SoapBodyBinding(); - mySoapBinding1.PartsString = "parameters"; - mySoapBinding1.Use= SoapBindingUse.Literal; - myInput.Extensions.Add(mySoapBinding1); - // Assign the 'InputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInput; - // Create the 'OutputBinding' object' for the 'SOAP' protocol.. - OutputBinding myOutput = new OutputBinding(); - myOutput.Extensions.Add(mySoapBinding1); - // Assign the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding.Output = myOutput; -// - -// -// -// -// - - // Create a new instance of 'SoapFaultBinding' class. - SoapFaultBinding mySoapFaultBinding=new SoapFaultBinding(); - // Encode fault message using rules specified by 'Encoding' property. - mySoapFaultBinding.Use=SoapBindingUse.Encoded; - // Set the URI representing the encoding style. - mySoapFaultBinding.Encoding="http://tempuri.org/stockquote"; - // Set the URI representing the location of the specification - // for encoding of content not defined by 'Encoding' property'. - mySoapFaultBinding.Namespace="http://tempuri.org/stockquote"; - // Create a new instance of 'FaultBinding'. - FaultBinding myFaultBinding=new FaultBinding(); - myFaultBinding.Name="AddFaultbinding"; - myFaultBinding.Extensions.Add(mySoapFaultBinding); - // Get existing 'OperationBinding' object. - myOperationBinding.Faults.Add(myFaultBinding); - myBinding.Operations.Add(myOperationBinding); - -// -// -// -// - - // Create a new wsdl file. - myServiceDescription.Write(myOutputWsdlFile); - Console.WriteLine("The new wsdl file created is :" - +myOutputWsdlFile); - Console.WriteLine("Proxy could be created using command : wsdl " - + myOutputWsdlFile); - } - catch(Exception e) - { - Console.WriteLine("Error occurred : "+e.Message); - } - } - } diff --git a/snippets/csharp/System.Web.Services.Description/SoapFaultBinding/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/SoapFaultBinding/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/SoapFaultBinding/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/SoapFaultBinding/Overview/SoapFaultBindingInput_cs.wsdl b/snippets/csharp/System.Web.Services.Description/SoapFaultBinding/Overview/SoapFaultBindingInput_cs.wsdl deleted file mode 100644 index de9a64d0e51..00000000000 --- a/snippets/csharp/System.Web.Services.Description/SoapFaultBinding/Overview/SoapFaultBindingInput_cs.wsdl +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/SoapFaultBinding/Overview/soapfaultbinding.cs b/snippets/csharp/System.Web.Services.Description/SoapFaultBinding/Overview/soapfaultbinding.cs deleted file mode 100644 index e8755c374fd..00000000000 --- a/snippets/csharp/System.Web.Services.Description/SoapFaultBinding/Overview/soapfaultbinding.cs +++ /dev/null @@ -1,59 +0,0 @@ -// System.Web.Services.Description.SoapFaultBinding - -/* - The following example demonstrates 'SoapFaultBinding' class. - It creates an instance of 'ServiceDescription' class by reading an existing - wsdl file. Then it creates an instance of 'SoapFaultBinding' and adds it to - the collection object of 'Binding' class. It generates a new wsdl file where - the properties of 'SoapFaultBinding' objects are reflected and which could be - used for generating a proxy. -*/ - -// - using System; - using System.Web.Services.Description; - public class MySoapFaultBindingSample - { - public static void Main() - { - try - { - // Input wsdl file. - string myInputWsdlFile="SoapFaultBindingInput_cs.wsdl"; - // Output wsdl file. - string myOutputWsdlFile="SoapFaultBindingOutput_cs.wsdl"; - // Initialize an instance of a 'ServiceDescription' object. - ServiceDescription myServiceDescription = - ServiceDescription.Read(myInputWsdlFile); - // Get a SOAP binding object with binding name "MyService1Soap". - Binding myBinding=myServiceDescription.Bindings["MyService1Soap"]; - // Create a new instance of 'SoapFaultBinding' class. - SoapFaultBinding mySoapFaultBinding=new SoapFaultBinding(); - // Encode fault message using rules specified by 'Encoding' property. - mySoapFaultBinding.Use=SoapBindingUse.Encoded; - // Set the URI representing the encoding style. - mySoapFaultBinding.Encoding="http://tempuri.org/stockquote"; - // Set the URI representing the location of the specification - // for encoding of content not defined by 'Encoding' property'. - mySoapFaultBinding.Namespace="http://tempuri.org/stockquote"; - // Create a new instance of 'FaultBinding'. - FaultBinding myFaultBinding=new FaultBinding(); - myFaultBinding.Name="AddFaultbinding"; - myFaultBinding.Extensions.Add(mySoapFaultBinding); - // Get existing 'OperationBinding' object. - OperationBinding myOperationBinding=myBinding.Operations[0]; - myOperationBinding.Faults.Add(myFaultBinding); - // Create a new wsdl file. - myServiceDescription.Write(myOutputWsdlFile); - Console.WriteLine("The new wsdl file created is :" - +myOutputWsdlFile); - Console.WriteLine("Proxy could be created using command : wsdl " - + myOutputWsdlFile); - } - catch(Exception e) - { - Console.WriteLine("Error occurred : "+e.Message); - } - } - } -// diff --git a/snippets/csharp/System.Web.Services.Description/SoapHeaderBinding/MapToProperty/MapToProperty_cs.wsdl b/snippets/csharp/System.Web.Services.Description/SoapHeaderBinding/MapToProperty/MapToProperty_cs.wsdl deleted file mode 100644 index 72f8aa485d7..00000000000 --- a/snippets/csharp/System.Web.Services.Description/SoapHeaderBinding/MapToProperty/MapToProperty_cs.wsdl +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This Web Service method requires a client to send the MyHeader SOAP header. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/SoapHeaderBinding/MapToProperty/Project.csproj b/snippets/csharp/System.Web.Services.Description/SoapHeaderBinding/MapToProperty/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/SoapHeaderBinding/MapToProperty/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/SoapHeaderBinding/MapToProperty/soapheaderbinding_maptoproperty.cs b/snippets/csharp/System.Web.Services.Description/SoapHeaderBinding/MapToProperty/soapheaderbinding_maptoproperty.cs deleted file mode 100644 index 6d212f0795b..00000000000 --- a/snippets/csharp/System.Web.Services.Description/SoapHeaderBinding/MapToProperty/soapheaderbinding_maptoproperty.cs +++ /dev/null @@ -1,40 +0,0 @@ -// System.Web.Services.Description.SoapHeaderBinding.MapToProperty - -/* -The following example demonstrates the 'MapToProperty' property of class 'SoapHeaderBinding'. -It reads an existing wsdl file and gets 'SoapHeaderBinding' instance from it. -'MapToProperty' property of this instance is checked to see whether this instance -is mapped to a specific property in proxy class or not. -*/ - using System; - using System.Web.Services.Description; - - public class MapToPropertySample - { - public static void Main() - { -// - // Read from an existing wsdl file. - ServiceDescription myServiceDescription = - ServiceDescription.Read("MapToProperty_cs.wsdl"); - // Get the existing binding - Binding myBinding=myServiceDescription.Bindings["MyWebServiceSoap"]; - OperationBinding myOperationBinding = - (OperationBinding)myBinding.Operations[0]; - InputBinding myInputBinding = myOperationBinding.Input; - // Get the 'SoapHeaderBinding' instance from 'myInputBinding'. - SoapHeaderBinding mySoapHeaderBinding = - (SoapHeaderBinding)myInputBinding.Extensions[1]; - if(mySoapHeaderBinding.MapToProperty) - { - Console.WriteLine("'SoapHeaderBinding' instance is mapped to a "+ - "specific property in proxy generated class"); - } - else - { - Console.WriteLine("'SoapHeaderBinding' instance is not mapped to "+ - "a specific property in proxy generated class"); - } -// - } -} diff --git a/snippets/csharp/System.Web.Services.Description/SoapHeaderBinding/Message/Project.csproj b/snippets/csharp/System.Web.Services.Description/SoapHeaderBinding/Message/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/SoapHeaderBinding/Message/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/SoapHeaderBinding/Message/SoapHeaderBindingInput_cs.wsdl b/snippets/csharp/System.Web.Services.Description/SoapHeaderBinding/Message/SoapHeaderBindingInput_cs.wsdl deleted file mode 100644 index 94df6f76cf5..00000000000 --- a/snippets/csharp/System.Web.Services.Description/SoapHeaderBinding/Message/SoapHeaderBindingInput_cs.wsdl +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This Web Service method requires a client to send the MyHeader SOAP header. - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/SoapHeaderBinding/Message/soapheaderbinding_use.cs b/snippets/csharp/System.Web.Services.Description/SoapHeaderBinding/Message/soapheaderbinding_use.cs deleted file mode 100644 index ed3fd11df31..00000000000 --- a/snippets/csharp/System.Web.Services.Description/SoapHeaderBinding/Message/soapheaderbinding_use.cs +++ /dev/null @@ -1,83 +0,0 @@ -// System.Web.Services.Description.SoapHeaderBinding.ctor -// System.Web.Services.Description.SoapHeaderBinding.Message -// System.Web.Services.Description.SoapHeaderBinding.Part -// System.Web.Services.Description.SoapHeaderBinding.Use - -/* -The following example demonstrates the constructor, 'Message' , 'Part' -and 'Use' properties of the class 'SoapHeaderBinding'. -It takes as input a wsdl file. The binding element corresponding to -SOAP protocol is removed from the input file. By using the 'Read' method -of 'ServiceDescription' class it gets a 'ServiceDescription' object. -It uses the SOAP protocol related classes and creates 'Binding' element -of 'SOAP' protocol which are then added to the 'ServiceDescription' object. -An output wsdl file is generated from 'ServiceDescription' object which -could be used for generating a proxy. -*/ - -using System; -using System.Web.Services.Description; -using System.Collections; -using System.Xml; - public class MySampleClass - { - public static void Main() - { - ServiceDescription myServiceDescription = - ServiceDescription.Read("SoapHeaderBindingInput_cs.wsdl"); - Binding myBinding = new Binding(); - myBinding.Name = "MyWebServiceSoap"; - myBinding.Type =new XmlQualifiedName("s0:MyWebServiceSoap"); - - SoapBinding mySoapBinding =new SoapBinding(); - mySoapBinding.Transport="http://schemas.xmlsoap.org/soap/http"; - mySoapBinding.Style=SoapBindingStyle.Document; - myBinding.Extensions.Add(mySoapBinding); - - OperationBinding myOperationBinding = new OperationBinding(); - myOperationBinding.Name = "Hello"; - - SoapOperationBinding mySoapOperationBinding = - new SoapOperationBinding(); - mySoapOperationBinding.SoapAction = "http://tempuri.org/Hello"; - mySoapOperationBinding.Style=SoapBindingStyle.Document; - myOperationBinding.Extensions.Add(mySoapOperationBinding); - - // Create InputBinding for operation for the 'SOAP' protocol. - InputBinding myInputBinding = new InputBinding(); - SoapBodyBinding mySoapBodyBinding = new SoapBodyBinding(); - mySoapBodyBinding.Use = SoapBindingUse.Literal; - myInputBinding.Extensions.Add(mySoapBodyBinding); -// -// -// -// - SoapHeaderBinding mySoapHeaderBinding=new SoapHeaderBinding(); - // Set the Message within the XML Web service to which the - // 'SoapHeaderBinding' applies. - mySoapHeaderBinding.Message= - new XmlQualifiedName("s0:HelloMyHeader"); - mySoapHeaderBinding.Part="MyHeader"; - mySoapHeaderBinding.Use=SoapBindingUse.Literal; - // Add mySoapHeaderBinding to the 'myInputBinding' object. - myInputBinding.Extensions.Add(mySoapHeaderBinding); -// -// -// -// - // Create OutputBinding for operation for the 'SOAP' protocol. - OutputBinding myOutputBinding = new OutputBinding(); - myOutputBinding.Extensions.Add(mySoapBodyBinding); - - // Add 'InputBinding' and 'OutputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInputBinding; - myOperationBinding.Output = myOutputBinding; - myBinding.Operations.Add(myOperationBinding); - - myServiceDescription.Bindings.Add(myBinding); - myServiceDescription.Write("SoapHeaderBindingOut_cs.wsdl"); - Console.WriteLine("'SoapHeaderBindingOut_cs.wsdl' file is generated."); - Console.WriteLine("Proxy could be created using " - +"'wsdl SoapHeaderBindingOut_cs.wsdl'."); - } - } \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/SoapHeaderBinding/Overview/Project.csproj b/snippets/csharp/System.Web.Services.Description/SoapHeaderBinding/Overview/Project.csproj deleted file mode 100644 index 300dabafd35..00000000000 --- a/snippets/csharp/System.Web.Services.Description/SoapHeaderBinding/Overview/Project.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Library - net472 - - - - - - - diff --git a/snippets/csharp/System.Web.Services.Description/SoapHeaderBinding/Overview/SoapHeaderBindingInput_cs.wsdl b/snippets/csharp/System.Web.Services.Description/SoapHeaderBinding/Overview/SoapHeaderBindingInput_cs.wsdl deleted file mode 100644 index 94df6f76cf5..00000000000 --- a/snippets/csharp/System.Web.Services.Description/SoapHeaderBinding/Overview/SoapHeaderBindingInput_cs.wsdl +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This Web Service method requires a client to send the MyHeader SOAP header. - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Web.Services.Description/SoapHeaderBinding/Overview/soapheaderbinding.cs b/snippets/csharp/System.Web.Services.Description/SoapHeaderBinding/Overview/soapheaderbinding.cs deleted file mode 100644 index 779dfdc2efa..00000000000 --- a/snippets/csharp/System.Web.Services.Description/SoapHeaderBinding/Overview/soapheaderbinding.cs +++ /dev/null @@ -1,70 +0,0 @@ -// System.Web.Services.Description.SoapHeaderBinding - -/* -The following example demonstrates the class 'SoapHeaderBinding'. -It takes as input a wsdl file. By using the 'Read' method -of 'ServiceDescription' class it gets a 'ServiceDescription' object. -It uses the SOAP protocol related classes and creates 'Binding' element -of 'SOAP' protocol which are then added to the 'ServiceDescription' object. -An output wsdl file is generated from 'ServiceDescription' object which -could be used for generating a proxy. -*/ - -// - using System; - using System.Web.Services.Description; - using System.Collections; - using System.Xml; - - public class MySampleClass - { - public static void Main() - { - ServiceDescription myServiceDescription = - ServiceDescription.Read("SoapHeaderBindingInput_cs.wsdl"); - Binding myBinding = new Binding(); - myBinding.Name = "MyWebServiceSoap"; - myBinding.Type =new XmlQualifiedName("s0:MyWebServiceSoap"); - - SoapBinding mySoapBinding =new SoapBinding(); - mySoapBinding.Transport="http://schemas.xmlsoap.org/soap/http"; - mySoapBinding.Style=SoapBindingStyle.Document; - myBinding.Extensions.Add(mySoapBinding); - - OperationBinding myOperationBinding = new OperationBinding(); - myOperationBinding.Name = "Hello"; - - SoapOperationBinding mySoapOperationBinding = - new SoapOperationBinding(); - mySoapOperationBinding.SoapAction = "http://tempuri.org/Hello"; - mySoapOperationBinding.Style=SoapBindingStyle.Document; - myOperationBinding.Extensions.Add(mySoapOperationBinding); - - // Create InputBinding for operation for the 'SOAP' protocol. - InputBinding myInputBinding = new InputBinding(); - SoapBodyBinding mySoapBodyBinding = new SoapBodyBinding(); - mySoapBodyBinding.Use = SoapBindingUse.Literal; - myInputBinding.Extensions.Add(mySoapBodyBinding); - SoapHeaderBinding mySoapHeaderBinding=new SoapHeaderBinding(); - mySoapHeaderBinding.Message=new XmlQualifiedName("s0:HelloMyHeader"); - mySoapHeaderBinding.Part="MyHeader"; - mySoapHeaderBinding.Use=SoapBindingUse.Literal; - // Add mySoapHeaderBinding to 'myInputBinding' object. - myInputBinding.Extensions.Add(mySoapHeaderBinding); - // Create OutputBinding for operation for the 'SOAP' protocol. - OutputBinding myOutputBinding = new OutputBinding(); - myOutputBinding.Extensions.Add(mySoapBodyBinding); - - // Add 'InputBinding' and 'OutputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInputBinding; - myOperationBinding.Output = myOutputBinding; - myBinding.Operations.Add(myOperationBinding); - - myServiceDescription.Bindings.Add(myBinding); - myServiceDescription.Write("SoapHeaderBindingOut_cs.wsdl"); - Console.WriteLine("'SoapHeaderBindingOut_cs.wsdl' file is generated."); - Console.WriteLine("Proxy could be created using " - +"'wsdl SoapHeaderBindingOut_cs.wsdl'."); - } -} -// diff --git a/snippets/visualbasic/System.Web.Services.Configuration/XmlFormatExtensionAttribute/Overview/source.vb b/snippets/visualbasic/System.Web.Services.Configuration/XmlFormatExtensionAttribute/Overview/source.vb deleted file mode 100644 index 82697b6ff1f..00000000000 --- a/snippets/visualbasic/System.Web.Services.Configuration/XmlFormatExtensionAttribute/Overview/source.vb +++ /dev/null @@ -1,207 +0,0 @@ -' -Imports System.Security.Permissions -Imports System.Web.Services -Imports System.Web.Services.Protocols -Imports System.IO -Imports System.Text -Imports System.Web.Services.Configuration -Imports System.Web.Services.Description -Imports System.Xml.Serialization -Imports System.CodeDom - -' The YMLAttribute allows a developer to specify that the YML SOAP -' extension run on a per-method basis. The disabled property -' turns reversing the XML on and off. - - _ -Public Class YMLAttribute - Inherits SoapExtensionAttribute - Dim _priority As Integer = 0 - Dim _disabled As Boolean = False - - Public Sub New() - Me.New(False) - End Sub - - Public Sub New(ByVal Disabled As Boolean) - _disabled = Disabled - End Sub - - Public Overrides ReadOnly Property ExtensionType() As Type - Get - Return GetType(YMLExtension) - End Get - End Property - - Public Overrides Property Priority() As Integer - Get - Return _priority - End Get - Set(ByVal Value As Integer) - _priority = Value - End Set - End Property - - Public Property Disabled() As Boolean - Get - Return _disabled - End Get - Set(ByVal Value As Boolean) - _disabled = Value - End Set - End Property -End Class - -Public Class YMLExtension - Inherits SoapExtension - Dim _disabled As Boolean = False - Dim oldStream As Stream - Dim newStream As Stream - - Public Overloads Overrides Function GetInitializer( _ - ByVal methodInfo As LogicalMethodInfo, _ - ByVal attribute As SoapExtensionAttribute) As Object - - Dim attr As YMLAttribute = attribute - If (Not attr Is Nothing) Then - Return attr.Disabled - End If - Return False - End Function - - Public Overloads Overrides Function GetInitializer( _ - ByVal WebServiceType As Type) As Object - Return False - End Function - - Public Overrides Sub Initialize(ByVal initializer As Object) - If (TypeOf initializer Is Boolean) Then - _disabled = CBool(initializer) - End If - End Sub - - Public Overrides Function ChainStream(ByVal streamref As Stream) As Stream - If (_disabled) Then - Return CType(Me, SoapExtension).ChainStream(streamref) - End If - oldStream = streamref - newStream = New MemoryStream() - Return newStream - End Function - - Public Overrides Sub ProcessMessage(ByVal message As SoapMessage) - If (_disabled) Then Return - Select Case (message.Stage) - Case SoapMessageStage.BeforeSerialize - Encode(message) - Case SoapMessageStage.AfterSerialize - newStream.Position = 0 - Reverse(newStream, oldStream) - Case SoapMessageStage.BeforeDeserialize - Decode(message) - Case SoapMessageStage.AfterDeserialize - End Select - End Sub - - Sub Encode(ByRef message As SoapMessage) - message.ContentType = "text/yml" - End Sub - - Sub Decode(ByVal message As SoapMessage) - If (message.ContentType <> "text/yml") Then - Throw New Exception("invalid content type:" & message.ContentType) - End If - Reverse(oldStream, newStream) - newStream.Position = 0 - message.ContentType = "text/xml" - End Sub - - Sub Reverse(ByVal source As Stream, ByVal dest As Stream) - Dim reader As TextReader = New StreamReader(source) - Dim writer As TextWriter = New StreamWriter(dest) - Dim line As String - line = reader.ReadLine() - While (Not line Is Nothing) - writer.WriteLine(StrReverse(line)) - line = reader.ReadLine() - End While - writer.Flush() - End Sub -End Class - - -' The YMLReflector class is part of the YML SDFE, as it is -' called during the service description generation process. - _ -Public Class YMLReflector - Inherits SoapExtensionReflector - Public Overrides Sub ReflectMethod() - Dim reflector As ProtocolReflector = ReflectionContext - Dim attr As YMLAttribute = _ - reflector.Method.GetCustomAttribute(GetType(YMLAttribute)) - ' If the YMLAttribute has been applied to this XML Web service - ' method, add the XML defined in the YMLOperationBinding class. - If (Not attr Is Nothing) Then - Dim yml As YMLOperationBinding = New YMLOperationBinding() - yml.Reverse = Not attr.Disabled - reflector.OperationBinding.Extensions.Add(yml) - End If - End Sub -End Class - -' The YMLImporter class is part of the YML SDFE, as it is called when a -' proxy class is generated for each XML Web service method the proxy class -' communicates with. The class checks whether the service description -' contains the XML that this SDFE adds to a service description. If it -' exists, then the YMLExtension is applied to the method in the proxy class. - _ -Public Class YMLImporter - Inherits SoapExtensionImporter - Public Overrides Sub ImportMethod( _ - ByVal metadata As CodeAttributeDeclarationCollection) - Dim importer As SoapProtocolImporter = ImportContext - ' Check whether the XML specified in the YMLOperationBinding is - ' in the service description. - Dim yml As YMLOperationBinding = _ - importer.OperationBinding.Extensions.Find( _ - GetType(YMLOperationBinding)) - If (Not yml Is Nothing) Then - ' Only apply the YMLAttribute to the method when the XML - ' should be reversed. - If (yml.Reverse) Then - Dim attr As CodeAttributeDeclaration = _ - New CodeAttributeDeclaration(GetType(YMLAttribute).FullName) - attr.Arguments.Add( _ - New CodeAttributeArgument(New CodePrimitiveExpression(True))) - metadata.Add(attr) - End If - End If - End Sub -End Class - -' -' The YMLOperationBinding class is part of the YML SDFE, as it is the -' class that is serialized into XML and is placed in the service -' description. - _ -Public Class YMLOperationBinding - Inherits ServiceDescriptionFormatExtension - Private _reverse As Boolean - Public Const YMLNamespace As String = "http://www.contoso.com/yml" - - _ - Public Property Reverse() As Boolean - Get - Return _reverse - End Get - Set(ByVal Value As Boolean) - _reverse = Value - End Set - End Property - -End Class -' -' - diff --git a/snippets/visualbasic/System.Web.Services.Description/Binding/Extensions/bindingcollectionsample2.vb b/snippets/visualbasic/System.Web.Services.Description/Binding/Extensions/bindingcollectionsample2.vb deleted file mode 100644 index 6890b220cb0..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/Binding/Extensions/bindingcollectionsample2.vb +++ /dev/null @@ -1,150 +0,0 @@ -' System.Web.Services.Description.Binding.Binding();System.Web.Services.Description.Binding.Name; -' System.Web.Services.Description.Binding.Type;System.Web.Services.Description.Binding.Extensions;System.Web.Services.Description.Binding.Operations; -' System.Web.Services.Description.BindingCollection.Insert; -' System.Web.Services.Description.Binding.ServiceDescription; -' System.Web.Services.Description.HttpBinding.NameSpace; - -' Grouping Clause : Snippet5 and Snippet8 go together. - -' The following example demonstrates the 'Binding()' constructor and the 'Extensions', 'Name', 'Operations', -' 'ServiceDescription', and 'Type' properties of the 'Binding' class as well as the 'Insert' method of the 'BindingCollection' class. - -' The input to the program is a WSDL file 'MathService_input.wsdl' with all information related to SOAP protocol -' removed from it. In a way it tries to simulate a scenario wherein a service initially did not support a protocol, however later -' on happen to support it. -' In this example, the WSDL file is modified to insert a new Binding for SOAP. The binding is populated based on -' WSDL document structure defined in WSDL specification. The ServiceDescription instance is loaded with values -' for 'Messages', 'PortTypes', 'Bindings', and 'Port'. The instance is then written to an external file 'MathService_new.wsdl'. - - -Imports System.Web.Services.Description -Imports System.Collections -Imports System.Xml - -Class [MyClass] - - Public Shared Sub Main() - Dim myServiceDescription As ServiceDescription = ServiceDescription.Read("MathService_input.wsdl") - ' Create SOAP Messages. - myServiceDescription.Messages.Add(CreateMessage("AddSoapIn", "parameters", "Add", myServiceDescription.TargetNamespace)) - myServiceDescription.Messages.Add(CreateMessage("AddSoapOut", "parameters", "AddResponse", myServiceDescription.TargetNamespace)) - myServiceDescription.Messages.Add(CreateMessage("SubtractSoapIn", "parameters", "Subtract", myServiceDescription.TargetNamespace)) - myServiceDescription.Messages.Add(CreateMessage("SubtractSoapOut", "parameters", "SubtractResponse", myServiceDescription.TargetNamespace)) - myServiceDescription.Messages.Add(CreateMessage("MultiplySoapIn", "parameters", "Multiply", myServiceDescription.TargetNamespace)) - myServiceDescription.Messages.Add(CreateMessage("MultiplySoapOut", "parameters", "MultiplyResponse", myServiceDescription.TargetNamespace)) - myServiceDescription.Messages.Add(CreateMessage("DivideSoapIn", "parameters", "Divide", myServiceDescription.TargetNamespace)) - myServiceDescription.Messages.Add(CreateMessage("DivideSoapOut", "parameters", "DivideResponse", myServiceDescription.TargetNamespace)) - - ' Create a new PortType. - Dim soapPortType As New PortType() - soapPortType.Name = "MathServiceSoap" - soapPortType.Operations.Add(CreateOperation("Add", "AddSoapIn", "AddSoapOut", myServiceDescription.TargetNamespace)) - soapPortType.Operations.Add(CreateOperation("Subtract", "SubtractSoapIn", "SubtractSoapOut", myServiceDescription.TargetNamespace)) - soapPortType.Operations.Add(CreateOperation("Multiply", "MultiplySoapIn", "MultiplySoapOut", myServiceDescription.TargetNamespace)) - soapPortType.Operations.Add(CreateOperation("Divide", "DivideSoapIn", "DivideSoapOut", myServiceDescription.TargetNamespace)) - myServiceDescription.PortTypes.Add(soapPortType) - ' - ' - ' - ' Create a new Binding for SOAP Protocol. - Dim myBinding As New Binding() - myBinding.Name = myServiceDescription.Services(0).Name + "Soap" - ' - ' - ' Pass the name of the existing porttype 'MathServiceSoap' and the Xml targetNamespace attribute of the Descriptions tag. - myBinding.Type = New XmlQualifiedName("MathServiceSoap", myServiceDescription.TargetNamespace) - ' - ' - ' Create SOAP Extensibility element. - Dim mySoapBinding As New SoapBinding() - ' SOAP over Http. - - mySoapBinding.Transport = "http://schemas.xmlsoap.org/soap/http" - mySoapBinding.Style = SoapBindingStyle.Document - ' Add tag soap:binding as an extensibility element. - myBinding.Extensions.Add(mySoapBinding) - ' - ' - ' Create OperationBindings for each of the operations defined in asmx file. - Dim addOperationBinding As OperationBinding = CreateOperationBinding("Add", myServiceDescription.TargetNamespace) - myBinding.Operations.Add(addOperationBinding) - Dim subtractOperationBinding As OperationBinding = CreateOperationBinding("Subtract", myServiceDescription.TargetNamespace) - myBinding.Operations.Add(subtractOperationBinding) - Dim multiplyOperationBinding As OperationBinding = CreateOperationBinding("Multiply", myServiceDescription.TargetNamespace) - myBinding.Operations.Add(multiplyOperationBinding) - Dim divideOperationBinding As OperationBinding = CreateOperationBinding("Divide", myServiceDescription.TargetNamespace) - myBinding.Operations.Add(divideOperationBinding) - ' - myServiceDescription.Bindings.Insert(0, myBinding) - '
- ' - ' - Console.WriteLine((ControlChars.Cr + "Target Namespace of the Service Description to which the binding was added is:" + myServiceDescription.Bindings(0).ServiceDescription.TargetNamespace)) - ' - ' Create Port. - Dim soapPort As New Port() - soapPort.Name = "MathServiceSoap" - soapPort.Binding = New XmlQualifiedName(myBinding.Name, myServiceDescription.TargetNamespace) - ' Create SoapAddress extensibility element to add to port. - Dim mySoapAddressBinding As New SoapAddressBinding() - mySoapAddressBinding.Location = "http://localhost/BindingCollectionSample/MathService.asmx" - soapPort.Extensions.Add(mySoapAddressBinding) - ' Add port to the MathService which is the first service in the Service Collection. - myServiceDescription.Services(0).Ports.Add(soapPort) - ' Save the ServiceDescripition instance to an external file. - myServiceDescription.Write("MathService_new.wsdl") - Console.WriteLine(ControlChars.Cr + "Successfully added bindings for SOAP protocol and saved results in file MathService_new.wsdl") - Console.WriteLine(ControlChars.Cr + " This file should be passed to wsdl tool as input to generate proxy") - End Sub - - ' Creates a Message with name ="messageName" having one MessagePart with name = "partName". - Public Shared Function CreateMessage(messageName As String, partName As String, element As String, targetNamespace As String) As Message - Dim myMessage As New Message() - myMessage.Name = messageName - Dim myMessagePart As New MessagePart() - myMessagePart.Name = partName - myMessagePart.Element = New XmlQualifiedName(element, targetNamespace) - myMessage.Parts.Add(myMessagePart) - Return myMessage - End Function 'CreateMessage - - ' - ' Used to create OperationBinding instances within 'Binding'. - Public Shared Function CreateOperationBinding(operation As String, targetNamespace As String) As OperationBinding - ' Create OperationBinding instance for operation. - Dim myOperationBinding As New OperationBinding() - myOperationBinding.Name = operation - ' Create InputBinding for operation. - Dim myInputBinding As New InputBinding() - Dim mySoapBodyBinding As New SoapBodyBinding() - mySoapBodyBinding.Use = SoapBindingUse.Literal - myInputBinding.Extensions.Add(mySoapBodyBinding) - ' Create OutputBinding for operation. - Dim myOutputBinding As New OutputBinding() - myOutputBinding.Extensions.Add(mySoapBodyBinding) - ' Add 'InputBinding' and 'OutputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInputBinding - myOperationBinding.Output = myOutputBinding - ' Create extensibility element for 'SoapOperationBinding'. - Dim mySoapOperationBinding As New SoapOperationBinding() - mySoapOperationBinding.Style = SoapBindingStyle.Document - mySoapOperationBinding.SoapAction = targetNamespace + operation - ' Add extensibility element 'SoapOperationBinding' to 'OperationBinding'. - myOperationBinding.Extensions.Add(mySoapOperationBinding) - Return myOperationBinding - End Function 'CreateOperationBinding - - ' - ' Used to create Operations under PortType. - Public Shared Function CreateOperation(operationName As String, inputMessage As String, outputMessage As String, targetNamespace As String) As Operation - Dim myOperation As New Operation() - myOperation.Name = operationName - Dim input As OperationMessage = CType(New OperationInput(), OperationMessage) - input.Message = New XmlQualifiedName(inputMessage, targetNamespace) - Dim output As OperationMessage = CType(New OperationOutput(), OperationMessage) - output.Message = New XmlQualifiedName(outputMessage, targetNamespace) - myOperation.Messages.Add(input) - myOperation.Messages.Add(output) - Return myOperation - End Function 'CreateOperation -End Class diff --git a/snippets/visualbasic/System.Web.Services.Description/Binding/Overview/bindingcollectionsample1.vb b/snippets/visualbasic/System.Web.Services.Description/Binding/Overview/bindingcollectionsample1.vb deleted file mode 100644 index 73a29fc026a..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/Binding/Overview/bindingcollectionsample1.vb +++ /dev/null @@ -1,54 +0,0 @@ -' System.Web.Services.Description.BindingCollection;System.Web.Services.Description.BindingCollection.Item[Int32]; -' System.Web.Services.Description.BindingCollection.Item[String];System.Web.Services.Description.BindingCollection.CopyTo - -' The program reads a wsdl document "MathService.wsdl" and instantiates a ServiceDescription instance -' from the WSDL document.A BindingCollection instance is then retrieved from this ServiceDescription instance -' and it's members are demonstrated. - -Imports System.Web.Services.Description -Imports System.Collections -Imports System.Xml - -Class [MyClass] - - Public Shared Sub Main() - Dim myBinding As Binding - Dim myServiceDescription As ServiceDescription = ServiceDescription.Read("MathService_input.wsdl") - Console.WriteLine("Total Number of bindings :" + myServiceDescription.Bindings.Count.ToString()) - ' - Dim i As Integer - - While i < myServiceDescription.Bindings.Count - Console.WriteLine((ControlChars.Cr + "Binding " + i.ToString())) - ' Get Binding at index i. - myBinding = myServiceDescription.Bindings(i) - Console.WriteLine((ControlChars.Tab + " Name : " + myBinding.Name)) - Console.WriteLine((ControlChars.Tab + " Type : " + myBinding.Type.ToString())) - i = i + 1 - End While - ' - ' - Dim myBindings(myServiceDescription.Bindings.Count) As Binding - ' Copy BindingCollection to an Array. - myServiceDescription.Bindings.CopyTo(myBindings, 0) - Console.WriteLine(ControlChars.Cr + ControlChars.Cr + " Displaying array copied from BindingCollection") - - - While i < myServiceDescription.Bindings.Count - Console.WriteLine((ControlChars.Cr + "Binding " + i)) - Console.WriteLine((ControlChars.Tab + " Name : " + myBindings(i).Name)) - Console.WriteLine((ControlChars.Tab + " Type : " + myBindings(i).Type.ToString())) - End While - ' - ' - ' Get Binding Name = "MathServiceSoap". - myBinding = myServiceDescription.Bindings("MathServiceHttpGet") - If Not (myBinding Is Nothing) Then - Console.WriteLine((ControlChars.Cr + ControlChars.Cr + "Name : " + myBinding.Name)) - Console.WriteLine(("Type : " + myBinding.Type.ToString())) - End If - ' - myServiceDescription = Nothing - myBinding = Nothing - End Sub -End Class \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/BindingCollection/Add/bindingcollectionsample3.vb b/snippets/visualbasic/System.Web.Services.Description/BindingCollection/Add/bindingcollectionsample3.vb deleted file mode 100644 index 303f5831fb5..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/BindingCollection/Add/bindingcollectionsample3.vb +++ /dev/null @@ -1,43 +0,0 @@ -' System.Web.Services.Description.BindingCollection;System.Web.Services.Description.Remove;System.Web.Services.Description.Add; -' System.Web.Services.Description.Contains;System.Web.Services.Description.IndexOf - -' The following example reads the contents of a file 'MathService.wsdl' into a ServiceDescription instance. -' Removes first binding in the BindingCollection of the ServiceDescription instance and writes the current -' 'ServiceDescription' instance into a temporary file. -' Adds the same binding back again into the instance and writes to another temporary file. - -Imports System.Web.Services.Description - -Class [MyClass] - - Public Shared Sub Main() - Dim myBinding As Binding - ' - ' - ' - ' - Dim myServiceDescription As ServiceDescription = ServiceDescription.Read("MathService_input.wsdl") - Console.WriteLine(("Total Number of bindings defined are:" + myServiceDescription.Bindings.Count.ToString())) - myBinding = myServiceDescription.Bindings(0) - - ' Remove the first binding in the collection. - myServiceDescription.Bindings.Remove(myBinding) - Console.WriteLine(("Successfully removed binding " + myBinding.Name)) - Console.WriteLine(("Total Number of bindings defined now are:" + myServiceDescription.Bindings.Count.ToString())) - myServiceDescription.Write("MathService_temp.wsdl") - ' - ' Add binding to the ServiceDescription instance. - myServiceDescription.Bindings.Add(myBinding) - ' - If myServiceDescription.Bindings.Contains(myBinding) Then - Console.WriteLine(("Successfully added binding " + myBinding.Name)) - End If - ' - Console.WriteLine(("Binding was added at index " + myServiceDescription.Bindings.IndexOf(myBinding).ToString())) - Console.WriteLine(("Total Number of bindings defined now are:" + myServiceDescription.Bindings.Count.ToString())) - myServiceDescription.Write("MathService_temp1.wsdl") - ' - myServiceDescription = Nothing - myBinding = Nothing - End Sub -End Class \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/DocumentableItem/Documentation/MathService_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/DocumentableItem/Documentation/MathService_vb.wsdl deleted file mode 100644 index 9aa220c7ed2..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/DocumentableItem/Documentation/MathService_vb.wsdl +++ /dev/null @@ -1,352 +0,0 @@ - - - - - All types have been defined here - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Port Type "MathServiceHttpGet" is defined here - - - - - - - - - - - - - - - - - - - - - Port Type "MathServiceHttpPost" is defined here - - - - - - - - - - - - - - - - - - - - - Port Type "MathServiceSoap" is defined here - - - - - - - - - - - - - - - - - - - - - Binding "MathServiceSoap" is defined here - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Binding "MathServiceHttpGet" is defined here - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Binding "MathServiceHttpPost" is defined here - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/DocumentableItem/Documentation/documentableitemsample.vb b/snippets/visualbasic/System.Web.Services.Description/DocumentableItem/Documentation/documentableitemsample.vb deleted file mode 100644 index 19e5d9d8bbd..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/DocumentableItem/Documentation/documentableitemsample.vb +++ /dev/null @@ -1,35 +0,0 @@ -' System.Web.Services.Description.DocumentableItem.Documentation; - -' The following program demonstrates the property 'Documentation' of abstract class -' 'DocumentableItem'. The program reads a wsdl document "MathService_vb.wsdl" and -' instantiates a ServiceDescription instance from the WSDL document. -' This program demonstrates a generic utility function which can accept any of Types,PortType and Binding -' classes as parameters. - -' -Imports System.Web.Services.Description - -Class DocumentableItemSample - Public Shared Sub Main() - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("MathService_vb.wsdl") - Console.WriteLine("Documentation Element for type is ") - PrintDocumentation(myServiceDescription.Types) - Dim myPortType As PortType - For Each myPortType In myServiceDescription.PortTypes - Console.WriteLine("Documentation Element for Port Type {0} is ", myPortType.Name) - PrintDocumentation(myPortType) - Next myPortType - Dim myBinding As Binding - For Each myBinding In myServiceDescription.Bindings - Console.WriteLine("Documentation Element for Port Type {0} is ", myBinding.Name) - PrintDocumentation(myBinding) - Next myBinding - End Sub - - ' Prints documentation associated with a wsdl element. - Public Shared Sub PrintDocumentation(myItem As DocumentableItem) - Console.WriteLine(ControlChars.Tab + myItem.Documentation) - End Sub -End Class -' \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/FaultBinding/Overview/faultbindingcollection_add.vb b/snippets/visualbasic/System.Web.Services.Description/FaultBinding/Overview/faultbindingcollection_add.vb deleted file mode 100644 index 7a49ea1f542..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/FaultBinding/Overview/faultbindingcollection_add.vb +++ /dev/null @@ -1,210 +0,0 @@ -'* The following example demonstrates the 'Add' method of the 'FaultBindingCollection' class -' * and constructor and 'Extensions' property of 'FaultBinding'class and 'Documentation' -' * property of 'DocumentableItem' class. -' * -' * This program generates a WSDL file for a service called StockQuote. The StockQuote service -' * provides one method called 'GetTradePrice'. The 'GetTradePrice' method takes two arguments, -' * a 'tickerSymbol' and 'time' strings. The 'tickerSymbol' is a unique representation of a -' * stock and 'time' is the time for which the trading price is to be returned for the stock -' * specified. The WSDL file generated for the service supports the SOAP protocol only. -' -Imports System.Web.Services.Description -Imports System.Xml -Imports System.Xml.Schema -Imports System.Xml.Serialization - - -Public Class FaultBindingCollection_Add - - - Public Shared Sub Main() - Dim myServiceDescription As New ServiceDescription() - myServiceDescription.Name = "StockQuote" - myServiceDescription.TargetNamespace = "http://www.contoso.com/stockquote.wsdl" - - ' Generate the 'Types' element. - Dim myXmlSchema As New XmlSchema() - myXmlSchema.AttributeFormDefault = XmlSchemaForm.Qualified - myXmlSchema.ElementFormDefault = XmlSchemaForm.Qualified - myXmlSchema.TargetNamespace = "http://www.contoso.com/stockquote.wsdl" - - 'XmlSchemaElement myXmlSchemaElement; - Dim myXmlSchemaComplexType As New XmlSchemaComplexType() - myXmlSchemaComplexType.Name = "GetTradePriceInputType" - Dim myXmlSchemaSequence As New XmlSchemaSequence() - myXmlSchemaSequence.Items.Add(CreateComplexTypeXmlElement("1", "1", "tickerSymbol", True, New XmlQualifiedName("s:string"))) - myXmlSchemaSequence.Items.Add(CreateComplexTypeXmlElement("1", "1", "time", True, New XmlQualifiedName("s:string"))) - myXmlSchemaComplexType.Particle = myXmlSchemaSequence - myXmlSchema.Items.Add(myXmlSchemaComplexType) - - myXmlSchemaComplexType = New XmlSchemaComplexType() - myXmlSchemaComplexType.Name = "GetTradePriceOutputType" - myXmlSchemaSequence = New XmlSchemaSequence() - myXmlSchemaSequence.Items.Add(CreateComplexTypeXmlElement("1", "1", "result", True, New XmlQualifiedName("s:string"))) - myXmlSchemaComplexType.Particle = myXmlSchemaSequence - myXmlSchema.Items.Add(myXmlSchemaComplexType) - - myXmlSchemaComplexType = New XmlSchemaComplexType() - myXmlSchemaComplexType.Name = "GetTradePriceStringFaultType" - myXmlSchemaSequence = New XmlSchemaSequence() - myXmlSchemaSequence.Items.Add(CreateComplexTypeXmlElement("1", "1", "error", True, New XmlQualifiedName("s:string"))) - myXmlSchemaComplexType.Particle = myXmlSchemaSequence - myXmlSchema.Items.Add(myXmlSchemaComplexType) - - myXmlSchemaComplexType = New XmlSchemaComplexType() - myXmlSchemaComplexType.Name = "GetTradePriceStringIntType" - myXmlSchemaSequence = New XmlSchemaSequence() - myXmlSchemaSequence.Items.Add(CreateComplexTypeXmlElement("1", "1", "error", True, New XmlQualifiedName("s:int"))) - myXmlSchemaComplexType.Particle = myXmlSchemaSequence - myXmlSchema.Items.Add(myXmlSchemaComplexType) - - myXmlSchema.Items.Add(CreateOtherXmlElement("GetTradePriceSoapIn", New XmlQualifiedName("s0:GetTradePriceInputType"))) - myXmlSchema.Items.Add(CreateOtherXmlElement("GetTradePriceSoapOut", New XmlQualifiedName("s0:GetTradePriceOutputType"))) - myXmlSchema.Items.Add(CreateOtherXmlElement("GetTradePriceSoapStringFault", New XmlQualifiedName("s0:GetTradePriceStringFaultType"))) - myXmlSchema.Items.Add(CreateOtherXmlElement("GetTradePriceSoapIntFault", New XmlQualifiedName("s0:GetTradePriceIntFaultType"))) - - myServiceDescription.Types.Schemas.Add(myXmlSchema) - - ' Generate the 'Message' element. - Dim myMessageCollection As MessageCollection = myServiceDescription.Messages - myMessageCollection.Add(CreateMessage("GetTradePriceInput", "parameters", "GetTradePriceSoapIn", myServiceDescription.TargetNamespace)) - myMessageCollection.Add(CreateMessage("GetTradePriceOutput", "parameters", "GetTradePriceSoapOut", myServiceDescription.TargetNamespace)) - myMessageCollection.Add(CreateMessage("GetTradePriceStringFault", "parameters", "GetTradePriceStringSoapFault", myServiceDescription.TargetNamespace)) - myMessageCollection.Add(CreateMessage("GetTradePriceIntFault", "parameters", "GetTradePriceIntSoapFault", myServiceDescription.TargetNamespace)) - - ' Generate the 'Port Type' element. - Dim myPortTypeCollection As PortTypeCollection = myServiceDescription.PortTypes - Dim myPortType As New PortType() - myPortType.Name = "StockQuotePortType" - Dim myOperationCollection As OperationCollection = myPortType.Operations - Dim myOperation As New Operation() - myOperation.Name = "GetTradePrice" - Dim myOperationMessage As OperationMessage - Dim myOperationMessageCollection As OperationMessageCollection = myOperation.Messages - myOperationMessage = CType(New OperationInput(), OperationMessage) - myOperationMessage.Message = New XmlQualifiedName("s0:GetTradePriceInput") - myOperationMessageCollection.Add(myOperationMessage) - myOperationMessage = CType(New OperationOutput(), OperationMessage) - myOperationMessage.Message = New XmlQualifiedName("s0:GetTradePriceOutput") - myOperationMessageCollection.Add(myOperationMessage) - Dim myOperationFault As New OperationFault() - myOperationFault.Name = "ErrorString" - myOperationFault.Message = New XmlQualifiedName("s0:GetTradePriceStringFault") - myOperation.Faults.Add(myOperationFault) - myOperationFault = New OperationFault() - myOperationFault.Name = "ErrorInt" - myOperationFault.Message = New XmlQualifiedName("s0:GetTradePriceIntFault") - myOperation.Faults.Add(myOperationFault) - myOperationCollection.Add(myOperation) - myPortTypeCollection.Add(myPortType) - - ' Generate the 'Binding' element. - Dim myExtensions As ServiceDescriptionFormatExtensionCollection - Dim myBindingCollection As BindingCollection = myServiceDescription.Bindings - Dim myBinding As New Binding() - myBinding.Name = "StockQuoteSoapBinding" - myBinding.Type = New XmlQualifiedName("s0:StockQuotePortType") - myExtensions = myBinding.Extensions - Dim mySoapBinding As New SoapBinding() - mySoapBinding.Style = SoapBindingStyle.Document - mySoapBinding.Transport = "http://schemas.xmlsoap.org/soap/http" - myExtensions.Add(mySoapBinding) - Dim myOperationBindingCollection As OperationBindingCollection = myBinding.Operations - Dim myOperationBinding As New OperationBinding() - myExtensions = myOperationBinding.Extensions - Dim mySoapBindingOperation As New SoapOperationBinding() - mySoapBindingOperation.SoapAction = "http://www.contoso.com/GetTradePrice" - myExtensions.Add(mySoapBindingOperation) - myOperationBinding.Name = "GetTradePrice" - myOperationBinding.Input = New InputBinding() - myExtensions = myOperationBinding.Input.Extensions - Dim mySoapBodyBinding As New SoapBodyBinding() - mySoapBodyBinding.Use = SoapBindingUse.Literal - mySoapBodyBinding.Namespace = "http://www.contoso.com/stockquote" - myExtensions.Add(mySoapBodyBinding) - myOperationBinding.Output = New OutputBinding() - myExtensions = myOperationBinding.Output.Extensions - mySoapBodyBinding = New SoapBodyBinding() - mySoapBodyBinding.Use = SoapBindingUse.Literal - mySoapBodyBinding.Namespace = "http://www.contoso.com/stockquote" - myExtensions.Add(mySoapBodyBinding) - ' - ' - ' - Dim myFaultBindingCollection As FaultBindingCollection = myOperationBinding.Faults - Dim myFaultBinding As New FaultBinding() - myFaultBinding.Name = "ErrorString" - ' Associate SOAP fault binding to the fault binding of the operation. - myExtensions = myFaultBinding.Extensions - Dim mySoapFaultBinding As New SoapFaultBinding() - mySoapFaultBinding.Use = SoapBindingUse.Literal - mySoapFaultBinding.Namespace = "http://www.contoso.com/stockquote" - myExtensions.Add(mySoapFaultBinding) - myFaultBindingCollection.Add(myFaultBinding) - ' - ' - ' - myFaultBinding = New FaultBinding() - myFaultBinding.Name = "ErrorInt" - ' Associate SOAP fault binding to the fault binding of the operation. - myExtensions = myFaultBinding.Extensions - mySoapFaultBinding = New SoapFaultBinding() - mySoapFaultBinding.Use = SoapBindingUse.Literal - mySoapFaultBinding.Namespace = "http://www.contoso.com/stockquote" - myExtensions.Add(mySoapFaultBinding) - myFaultBindingCollection.Add(myFaultBinding) - myOperationBindingCollection.Add(myOperationBinding) - myBindingCollection.Add(myBinding) - - ' Generate the 'Service' element. - Dim myServiceCollection As ServiceCollection = myServiceDescription.Services - ' - Dim myService As New Service() - ' Add a simple documentation for the service to ease the readability of the generated WSDL file. - myService.Documentation = "A Simple Stock Quote Service" - myService.Name = "StockQuoteService" - Dim myPortCollection As PortCollection = myService.Ports - Dim myPort As New Port() - myPort.Name = "StockQuotePort" - myPort.Binding = New XmlQualifiedName("s0:StockQuoteSoapBinding") - myExtensions = myPort.Extensions - Dim mySoapAddressBinding As New SoapAddressBinding() - mySoapAddressBinding.Location = "http://www.contoso.com/stockquote" - myExtensions.Add(mySoapAddressBinding) - myPortCollection.Add(myPort) - ' - myServiceCollection.Add(myService) - - ' Display the WSDL generated to the console. - myServiceDescription.Write(Console.Out) - End Sub - - - Public Shared Function CreateComplexTypeXmlElement(minoccurs As String, maxoccurs As String, name As String, isNillable As Boolean, schemaTypeName As XmlQualifiedName) As XmlSchemaElement - Dim myXmlSchemaElement As New XmlSchemaElement() - myXmlSchemaElement.MinOccursString = minoccurs - myXmlSchemaElement.MaxOccursString = maxoccurs - myXmlSchemaElement.Name = name - myXmlSchemaElement.IsNillable = True - myXmlSchemaElement.SchemaTypeName = schemaTypeName - Return myXmlSchemaElement - End Function 'CreateComplexTypeXmlElement - - Public Shared Function CreateOtherXmlElement(name As String, SchemaTypeName As XmlQualifiedName) As XmlSchemaElement - Dim myXmlSchemaElement As New XmlSchemaElement() - myXmlSchemaElement.Name = name - myXmlSchemaElement.SchemaTypeName = SchemaTypeName - Return myXmlSchemaElement - End Function 'CreateOtherXmlElement - - ' Creates a Message with name ="messageName" having one MessagePart with name = "partName". - Public Shared Function CreateMessage(messageName As String, partName As String, element As String, targetNamespace As String) As Message - Dim myMessage As New Message() - myMessage.Name = messageName - Dim myMessagePart As New MessagePart() - myMessagePart.Name = partName - myMessagePart.Element = New XmlQualifiedName(element, targetNamespace) - myMessage.Parts.Add(myMessagePart) - Return myMessage - End Function 'CreateMessage -End Class \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/FaultBindingCollection/Contains/faultbindingcollection_remove.vb b/snippets/visualbasic/System.Web.Services.Description/FaultBindingCollection/Contains/faultbindingcollection_remove.vb deleted file mode 100644 index 3df870f0dcf..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/FaultBindingCollection/Contains/faultbindingcollection_remove.vb +++ /dev/null @@ -1,89 +0,0 @@ - -' * The following example demonstrates the 'Remove', 'CopyTo', 'Insert', 'Contains', -' * 'IndexOf' method and 'Item[int]' property of FaultBindingCollection class -' * -' * The program reverses the fault bindings that appear in the WSDL file. It also reverses -' * the operation faults and displays the resultant WSDL file to the console. -' * -Imports System.Web.Services.Description - - -Public Class FaultBindingCollection_Remove - - Public Shared Sub Main() - ' Read the 'StockQuote.wsdl' file as input. - Dim myServiceDescription As ServiceDescription = ServiceDescription.Read("StockQuote.wsdl") - - Dim myPortTypeCollection As PortTypeCollection = myServiceDescription.PortTypes - Dim myPortType As PortType = myPortTypeCollection(0) - Dim myOperationCollection As OperationCollection = myPortType.Operations - Dim myOperation As Operation = myOperationCollection(0) - Dim myOperationFaultCollection As OperationFaultCollection = myOperation.Faults - ' Reverse the operation fault order. - If myOperationFaultCollection.Count > 1 Then - Dim myOperationFaultArray(myOperationFaultCollection.Count - 1) As OperationFault - ' Copy the operation fault to a temporary array. - myOperationFaultCollection.CopyTo(myOperationFaultArray, 0) - ' Remove all the operation fault instances in the fault binding collection. - Dim i, j As Integer - For i = 0 To myOperationFaultArray.Length - 1 - myOperationFaultCollection.Remove(myOperationFaultArray(i)) - Next i - j = myOperationFaultArray.Length - 1 - For i = 0 To myOperationFaultArray.Length - 1 - myOperationFaultCollection.Insert(i, myOperationFaultArray(j)) - j = j - 1 - Next - - - End If - - ' - ' - ' - ' - ' - ' - Dim myBindingCollection As BindingCollection = myServiceDescription.Bindings - Dim myBinding As Binding = myBindingCollection(0) - Dim myOperationBindingCollection As OperationBindingCollection = myBinding.Operations - Dim myOperationBinding As OperationBinding = myOperationBindingCollection(0) - Dim myFaultBindingCollection As FaultBindingCollection = myOperationBinding.Faults - - ' Reverse the fault bindings order. - If myFaultBindingCollection.Count > 1 Then - Dim myFaultBinding As FaultBinding = myFaultBindingCollection(0) - - Dim myFaultBindingArray(myFaultBindingCollection.Count - 1) As FaultBinding - ' Copy the fault bindings to a temporary array. - myFaultBindingCollection.CopyTo(myFaultBindingArray, 0) - - ' Remove all the fault binding instances in the fault binding collection. - Dim i, j As Integer - - For i = 0 To myFaultBindingArray.Length - 1 - myFaultBindingCollection.Remove(myFaultBindingArray(i)) - Next i - - j = myFaultBindingArray.Length - 1 - For i = 0 To myFaultBindingArray.Length - 1 - myFaultBindingCollection.Insert(i, myFaultBindingArray(j)) - j = j - 1 - Next - - If myFaultBindingCollection.Contains(myFaultBinding) And myFaultBindingCollection.IndexOf(myFaultBinding) = myFaultBindingCollection.Count - 1 Then - ' Display the WSDL generated to the console. - myServiceDescription.Write(Console.Out) - Else - Console.WriteLine("Error while reversing") - End If - End If - End Sub - -End Class -' -' -' -' -' -' \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/FaultBindingCollection/Item/faultbindingcollection_item.vb b/snippets/visualbasic/System.Web.Services.Description/FaultBindingCollection/Item/faultbindingcollection_item.vb deleted file mode 100644 index 829ffea2d29..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/FaultBindingCollection/Item/faultbindingcollection_item.vb +++ /dev/null @@ -1,40 +0,0 @@ - -' The following example demonstrates the 'Item[string]' property of -' FaultBindingCollection class -' The program removes a fault binding with the name 'ErrorString' from -' the WSDL file. It also removes a operation fault with the name -' 'ErrorString' and displays the resultant WSDL file to the console. - - -Imports System.Web.Services.Description - - -Public Class FaultBindingCollection_Remove - - Public Shared Sub Main() - ' Read the 'StockQuote.wsdl' file as input. - Dim myServiceDescription As ServiceDescription = ServiceDescription.Read("StockQuote.wsdl") - - ' Get the operation fault collection and remove the operation fault with the name 'ErrorString'. - Dim myPortTypeCollection As PortTypeCollection = myServiceDescription.PortTypes - Dim myPortType As PortType = myPortTypeCollection(0) - Dim myOperationCollection As OperationCollection = myPortType.Operations - Dim myOperation As Operation = myOperationCollection(0) - Dim myOperationFaultCollection As OperationFaultCollection = myOperation.Faults - If myOperationFaultCollection.Contains(myOperationFaultCollection("ErrorString")) Then - myOperationFaultCollection.Remove(myOperationFaultCollection("ErrorString")) - End If - ' Get the fault binding collection and remove the fault binding with the name 'ErrorString'. - ' - Dim myBindingCollection As BindingCollection = myServiceDescription.Bindings - Dim myBinding As Binding = myBindingCollection(0) - Dim myOperationBindingCollection As OperationBindingCollection = myBinding.Operations - Dim myOperationBinding As OperationBinding = myOperationBindingCollection(0) - Dim myFaultBindingCollection As FaultBindingCollection = myOperationBinding.Faults - If myFaultBindingCollection.Contains(myFaultBindingCollection("ErrorString")) Then - myFaultBindingCollection.Remove(myFaultBindingCollection("ErrorString")) - End If - ' - myServiceDescription.Write(Console.Out) - End Sub -End Class \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/FaultBindingCollection/Overview/StockQuoteService_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/FaultBindingCollection/Overview/StockQuoteService_vb.wsdl deleted file mode 100644 index 7fd6b566e47..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/FaultBindingCollection/Overview/StockQuoteService_vb.wsdl +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - My first service - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/FaultBindingCollection/Overview/StockQuote_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/FaultBindingCollection/Overview/StockQuote_vb.wsdl deleted file mode 100644 index 2b6199bbbc1..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/FaultBindingCollection/Overview/StockQuote_vb.wsdl +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/FaultBindingCollection/Overview/StockQuote_vb.xsd b/snippets/visualbasic/System.Web.Services.Description/FaultBindingCollection/Overview/StockQuote_vb.xsd deleted file mode 100644 index e02ab2e4831..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/FaultBindingCollection/Overview/StockQuote_vb.xsd +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/snippets/visualbasic/System.Web.Services.Description/FaultBindingCollection/Overview/importsample.vb b/snippets/visualbasic/System.Web.Services.Description/FaultBindingCollection/Overview/importsample.vb deleted file mode 100644 index 09f29a6f1dc..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/FaultBindingCollection/Overview/importsample.vb +++ /dev/null @@ -1,92 +0,0 @@ -' System.Web.Services.Description.ImportCollection.Add; -' System.Web.Services.Description.ImportCollection.Insert; -' System.Web.Services.Description.Import.Import(); -' System.Web.Services.Description.Import.Location; -' System.Web.Services.Description.Import.Namespace; -' System.Web.Services.Description.Import.ServiceDescription; -' System.Web.Services.Description.Import; - -' The following example demonstrates the constructor 'Import()' and properties -' 'Namespace','Location','Namespace','ServiceDescription' of Import Class. -' Methods 'Add' and 'Insert' of Class 'ImportCollection' are also demonstrated. -' This example uses a sample provided in WSDL specification to explain Import -' and ImportCollection. It adds import instances to ImportCollection as suggested -' in the specification sample and enumerates the same to the console. -' Note: This is an illustrative sample using an example from WSDL specification. -' The real world web service has been assumed. - -' -Imports System.Web.Services.Description -Imports System.Collections -Imports System.Xml - -Class MySample - Public Shared Sub Main() - Console.WriteLine("Import Sample") - -' - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("StockQuote_vb.wsdl") - myServiceDescription.Imports.Add( _ - CreateImport("http://localhost/stockquote/schemas", _ - "http://localhost/stockquote/stockquote_vb.xsd")) -' - ' Save the ServiceDescripition to an external file. - myServiceDescription.Write("StockQuote_vb.wsdl") - Console.WriteLine("Successfully added Import to WSDL document " _ - & "'StockQuote_vb.wsdl'") - ' Print the import collection to the console. - PrintImportCollection("StockQuote_vb.wsdl") -' - myServiceDescription = _ - ServiceDescription.Read("StockQuoteService_vb.wsdl") - myServiceDescription.Imports.Insert(0, _ - CreateImport("http://localhost/stockquote/definitions", _ - "http://localhost/stockquote/stockquote_vb.wsdl")) -' - ' Save the ServiceDescripition to an external file. - myServiceDescription.Write("StockQuoteService_vb.wsdl") - Console.WriteLine("") - Console.WriteLine("Successfully added Import to " & _ - "WSDL document 'StockQuoteService_vb.wsdl'") - 'Print the import collection to the console. - PrintImportCollection("StockQuoteService_vb.wsdl") - End Sub - -' -' -' - ' Creates an Import object with namespace and location. - Public Shared Function CreateImport(targetNamespace As String, _ - targetlocation As String) As Import - Dim myImport As New Import() - myImport.Location = targetlocation - myImport.Namespace = targetNamespace - Return myImport - End Function 'CreateImport -' -' -' - -' - Public Shared Sub PrintImportCollection(fileName_wsdl As String) - - ' Read import collection properties from generated WSDL file. - Dim myServiceDescription1 As _ - ServiceDescription = ServiceDescription.Read(fileName_wsdl) - Dim myImportCollection As ImportCollection = myServiceDescription1.Imports - Console.WriteLine("Enumerating Import Collection for file '" & _ - fileName_wsdl & "'...") - - ' Print Import properties to the console. - Dim i As Integer - For i = 0 To myImportCollection.Count - 1 - Console.WriteLine("Namespace : " & myImportCollection(i).Namespace) - Console.WriteLine("Location : " & myImportCollection(i).Location) - Console.WriteLine("ServiceDescription : " & _ - myImportCollection(i).ServiceDescription.Name) - Next i - End Sub -' -End Class -' diff --git a/snippets/visualbasic/System.Web.Services.Description/HttpAddressBinding/Overview/httpbinding.vb b/snippets/visualbasic/System.Web.Services.Description/HttpAddressBinding/Overview/httpbinding.vb deleted file mode 100644 index 352176deea7..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/HttpAddressBinding/Overview/httpbinding.vb +++ /dev/null @@ -1,148 +0,0 @@ -' System.Web.Services.HttpBinding;System.Web.Services.HttpBinding.Verb; -' System.Web.Services.HttpAddressBinding;System.Web.Services.HttpAddressBinding.Location; -' -' * The following example demonstrates the 'HttpBinding()' constructor -' and the 'Verb' property of the 'HttpBinding' class and the 'HttpAddressBinding() -' ' constructor and 'Location' property of the 'HttpAddressBinding' class. -' It creates a 'ServiceDescription' instance by using the -' static read method of 'ServiceDescription' by passing the -' 'AddNumbers1.wsdl' name as an argument. It creates a 'Binding' object -' and adds that binding object to 'ServiceDescription'. -' It adds the 'PortType', Messages to the 'ServiceDescription' object. -' Finally it writes the 'ServiceDescrption' as a WSDL file with name -' 'AddNumbers.wsdl. - -Imports System.Web.Services.Description -Imports System.Collections -Imports System.Xml - - - -Class [MyClass] - - Public Shared Sub Main() - Dim myDescription As ServiceDescription = ServiceDescription.Read("AddNumbers1.wsdl") - - ' Create the 'Binding' object. - Dim myBinding As New Binding() - myBinding.Name = "Service1HttpPost" - Dim qualifiedName As New XmlQualifiedName("s0:Service1HttpPost") - myBinding.Type = qualifiedName - - ' - ' - ' Create the 'HttpBinding' object. - Dim myHttpBinding As New HttpBinding() - - myHttpBinding.Verb = "POST" - ' Add the 'HttpBinding' to the 'Binding'. - myBinding.Extensions.Add(myHttpBinding) - ' - ' - - ' Create the 'OperationBinding' object. - Dim myOperationBinding As New OperationBinding() - myOperationBinding.Name = "AddNumbers" - - Dim myOperation As New HttpOperationBinding() - myOperation.Location = "/AddNumbers" - ' Add the 'HttpOperationBinding' to 'OperationBinding'. - myOperationBinding.Extensions.Add(myOperation) - - ' Create the 'InputBinding' object. - Dim myInput As New InputBinding() - Dim postMimeContentbinding As New MimeContentBinding() - postMimeContentbinding.Type = "application/x-www-form-urlencoded" - myInput.Extensions.Add(postMimeContentbinding) - ' Add the 'InputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInput - ' Create the 'OutputBinding' object. - Dim myOutput As New OutputBinding() - Dim postMimeXmlbinding As New MimeXmlBinding() - postMimeXmlbinding.Part = "Body" - myOutput.Extensions.Add(postMimeXmlbinding) - - ' Add the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding.Output = myOutput - - ' Add the 'OperationBinding' to 'Binding'. - myBinding.Operations.Add(myOperationBinding) - - ' Add the 'Binding' to 'BindingCollection' of 'ServiceDescription'. - myDescription.Bindings.Add(myBinding) - - ' Create a 'Port' object. - Dim postPort As New Port() - postPort.Name = "Service1HttpPost" - postPort.Binding = New XmlQualifiedName("s0:Service1HttpPost") - - ' - ' - ' Create the 'HttpAddressBinding' object. - Dim postAddressBinding As New HttpAddressBinding() - - postAddressBinding.Location = "http://localhost/Service1.asmx" - - ' Add the 'HttpAddressBinding' to the 'Port'. - postPort.Extensions.Add(postAddressBinding) - ' - ' - - ' Add the 'Port' to 'PortCollection' of 'ServiceDescription'. - myDescription.Services(0).Ports.Add(postPort) - - ' Create a 'PortType' object. - Dim postPortType As New PortType() - postPortType.Name = "Service1HttpPost" - - Dim postOperation As New Operation() - postOperation.Name = "AddNumbers" - - Dim postInput As OperationMessage = CType(New OperationInput(), OperationMessage) - postInput.Message = New XmlQualifiedName("s0:AddNumbersHttpPostIn") - Dim postOutput As OperationMessage = CType(New OperationOutput(), OperationMessage) - postOutput.Message = New XmlQualifiedName("s0:AddNumbersHttpPostOut") - - postOperation.Messages.Add(postInput) - postOperation.Messages.Add(postOutput) - - ' Add the 'Operation' to 'PortType'. - postPortType.Operations.Add(postOperation) - - ' Adds the 'PortType' to 'PortTypeCollection' of 'ServiceDescription'. - myDescription.PortTypes.Add(postPortType) - - ' Create the 'Message' object. - Dim postMessage1 As New Message() - postMessage1.Name = "AddNumbersHttpPostIn" - ' Create the 'MessageParts'. - Dim postMessagePart1 As New MessagePart() - postMessagePart1.Name = "firstnumber" - postMessagePart1.Type = New XmlQualifiedName("s:string") - - Dim postMessagePart2 As New MessagePart() - postMessagePart2.Name = "secondnumber" - postMessagePart2.Type = New XmlQualifiedName("s:string") - ' Add the 'MessagePart' objects to 'Messages'. - postMessage1.Parts.Add(postMessagePart1) - postMessage1.Parts.Add(postMessagePart2) - - ' Create another 'Message' object. - Dim postMessage2 As New Message() - postMessage2.Name = "AddNumbersHttpPostOut" - - Dim postMessagePart3 As New MessagePart() - postMessagePart3.Name = "Body" - postMessagePart3.Element = New XmlQualifiedName("s0:int") - ' Add the 'MessagePart' to 'Message' - postMessage2.Parts.Add(postMessagePart3) - - ' Add the 'Message' objects to 'ServiceDescription'. - myDescription.Messages.Add(postMessage1) - myDescription.Messages.Add(postMessage2) - - ' Write the 'ServiceDescription' as a WSDL file. - myDescription.Write("AddNumbers.wsdl") - Console.WriteLine("WSDL file with name 'AddNumber.Wsdl' file created Successfully") - End Sub -End Class diff --git a/snippets/visualbasic/System.Web.Services.Description/HttpBinding/Namespace/HttpBinding_ctor_Input_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/HttpBinding/Namespace/HttpBinding_ctor_Input_VB.wsdl deleted file mode 100644 index e49d2c540fa..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/HttpBinding/Namespace/HttpBinding_ctor_Input_VB.wsdl +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/HttpBinding/Namespace/HttpBinding_ctor_Service.vb.asmx b/snippets/visualbasic/System.Web.Services.Description/HttpBinding/Namespace/HttpBinding_ctor_Service.vb.asmx deleted file mode 100644 index 6bb06e09e3a..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/HttpBinding/Namespace/HttpBinding_ctor_Service.vb.asmx +++ /dev/null @@ -1,13 +0,0 @@ -<%@WebService Language="VB" Class="MyHttpBindingService"%> - -Imports System -Imports System.Web.Services - -Public Class MyHttpBindingService - Inherits System.Web.Services.WebService - - _ - Public Function AddNumbers(firstNumber As Integer, secondNumber As Integer) As Integer - Return firstNumber + secondNumber - End Function 'AddNumbers -End Class 'MyHttpBindingService \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/HttpBinding/Namespace/httpbinding_ctor.vb b/snippets/visualbasic/System.Web.Services.Description/HttpBinding/Namespace/httpbinding_ctor.vb deleted file mode 100644 index 0541331c067..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/HttpBinding/Namespace/httpbinding_ctor.vb +++ /dev/null @@ -1,76 +0,0 @@ -' System.Web.Services.Description.HttpBinding.HttpBinding() -' System.Web.Services.Description.HttpBinding.Namespace -' System.Web.Services.Description.HttpAddressBinding.HttpAddressBinding() - -' The following program demonstrates the constructor, field 'Namespace' of -' class 'HttpBinding' and constructor of class 'HttpAddressBinding'. This program writes all 'HttpPost' binding related information to the input wsdl file and genrates an output file which is later on compiled using wsdl tool. - -Imports System.Web.Services.Description -Imports System.Collections -Imports System.Xml - -Class MyHttpBindingClass - - Public Shared Sub Main() - Dim myDescription As ServiceDescription = _ - ServiceDescription.Read("HttpBinding_ctor_Input_VB.wsdl") -' -' - ' Create 'Binding' object. - Dim myBinding As New Binding() - myBinding.Name = "MyHttpBindingServiceHttpPost" - Dim qualifiedName As New XmlQualifiedName("s0:MyHttpBindingServiceHttpPost") - myBinding.Type = qualifiedName - ' Create 'HttpBinding' object. - Dim myHttpBinding As New HttpBinding() - myHttpBinding.Verb = "POST" - Console.WriteLine("HttpBinding Namespace : " + HttpBinding.Namespace) -' - ' Add 'HttpBinding' to 'Binding'. - myBinding.Extensions.Add(myHttpBinding) -' - ' Create 'OperationBinding' object. - Dim myOperationBinding As New OperationBinding() - myOperationBinding.Name = "AddNumbers" - Dim myOperation As New HttpOperationBinding() - myOperation.Location = "/AddNumbers" - ' Add 'HttpOperationBinding' to 'OperationBinding'. - myOperationBinding.Extensions.Add(myOperation) - ' Create 'InputBinding' object. - Dim myInput As New InputBinding() - Dim postMimeContentbinding As New MimeContentBinding() - postMimeContentbinding.Type = "application/x-www-form-urlencoded" - myInput.Extensions.Add(postMimeContentbinding) - ' Add 'InputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInput - ' Create 'OutputBinding' object. - Dim myOutput As New OutputBinding() - Dim postMimeXmlbinding As New MimeXmlBinding() - postMimeXmlbinding.Part = "Body" - myOutput.Extensions.Add(postMimeXmlbinding) - ' Add 'OutPutBinding' to 'OperationBinding'. - myOperationBinding.Output = myOutput - ' Add 'OperationBinding' to 'Binding'. - myBinding.Operations.Add(myOperationBinding) - ' Add 'Binding' to 'BindingCollection' of 'ServiceDescription'. - myDescription.Bindings.Add(myBinding) -' - ' Create a 'Port' object. - Dim postPort As New Port() - postPort.Name = "MyHttpBindingServiceHttpPost" - postPort.Binding = New XmlQualifiedName("s0:MyHttpBindingServiceHttpPost") - ' Create 'HttpAddressBinding' object. - Dim postAddressBinding As New HttpAddressBinding() - postAddressBinding.Location = _ - "http://localhost/HttpBinding_ctor/HttpBinding_ctor_Service.vb.asmx" - ' Add 'HttpAddressBinding' to 'Port'. - postPort.Extensions.Add(postAddressBinding) -' - ' Add 'Port' to 'PortCollection' of 'ServiceDescription'. - myDescription.Services(0).Ports.Add(postPort) - ' Write 'ServiceDescription' as a WSDL file. - myDescription.Write("HttpBinding_ctor_Output_VB.wsdl") - Console.WriteLine _ - ("WSDL file with name 'HttpBinding_ctor_Output_VB.wsdl' file created Successfully") - End Sub -End Class \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ImportCollection/Overview/StockQuoteService_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/ImportCollection/Overview/StockQuoteService_vb.wsdl deleted file mode 100644 index b34a5655eb7..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ImportCollection/Overview/StockQuoteService_vb.wsdl +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - My first service - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ImportCollection/Overview/importcollection_6.vb b/snippets/visualbasic/System.Web.Services.Description/ImportCollection/Overview/importcollection_6.vb deleted file mode 100644 index 71af1140378..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ImportCollection/Overview/importcollection_6.vb +++ /dev/null @@ -1,76 +0,0 @@ -' System.Web.Services.Description.ImportCollection -' System.Web.Services.Description.ImportCollection.Item -' System.Web.Services.Description.ImportCollection.CopyTo -' System.Web.Services.Description.ImportCollection.Contains -' System.Web.Services.Description.ImportCollection.IndexOf -' System.Web.Services.Description.ImportCollection.Remove - -' The following program demonstrates the methods 'CopyTo', 'Contains','IndexOf','Remove' -' and property 'Item' of class 'ImportCollection'. -' The program reads a 'WSDL' document and gets a 'ServiceDescription' instance -' An 'ImportCollection' instance is then retrieved from this 'ServiceDescription' -' instance and it's members have been demonstrated. - -' -Imports System.Web.Services.Description -Imports System.Xml - -Class ServiceDescription_ImportCollection - Public Shared Sub Main() - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("StockQuoteService_vb.wsdl") - Console.WriteLine(" ImportCollection Sample ") -' - ' Get Import Collection. - Dim myImportCollection As ImportCollection = myServiceDescription.Imports - Console.WriteLine("Total Imports in the document = " + _ - myServiceDescription.Imports.Count.ToString()) - ' Print 'Import' properties to console. - Dim i As Integer - For i = 0 To myImportCollection.Count - 1 - Console.WriteLine(ControlChars.Tab + _ - "Import Namespace :{0} Import Location :{1} ", _ - myImportCollection(i).Namespace, _ - myImportCollection(i).Location) - Next i -' - -' - Dim myImports(myServiceDescription.Imports.Count - 1) As Import - ' Copy 'ImportCollection' to an array. - myServiceDescription.Imports.CopyTo(myImports, 0) - Console.WriteLine("Imports that are copied to Importarray ...") - Dim j As Integer - For j = 0 To myImports.Length - 1 - Console.WriteLine(ControlChars.Tab + _ - "Import Namespace :{0} Import Location :{1} ", _ - myImports(j).Namespace, myImports(j).Location) - Next j -' - -' -' -' - ' Get Import by Index. - Dim myImport As Import = _ - myServiceDescription.Imports(myServiceDescription.Imports.Count - 1) - - Console.WriteLine("Import by Index...") - If myImportCollection.Contains(myImport) Then - Console.WriteLine("Import Namespace '" + myImport.Namespace + _ - "' is found in 'ImportCollection'.") - Console.WriteLine("Index of '" + myImport.Namespace + _ - "' in 'ImportCollection' = " + _ - myImportCollection.IndexOf(myImport).ToString()) - Console.WriteLine("Delete Import from 'ImportCollection'...") - myImportCollection.Remove(myImport) - If myImportCollection.IndexOf(myImport) = - 1 Then - Console.WriteLine("Import is successfully removed from Import Collection.") - End If -' -' -' - End If - End Sub -End Class -' \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/InputBinding/Overview/MathService.vb.asmx b/snippets/visualbasic/System.Web.Services.Description/InputBinding/Overview/MathService.vb.asmx deleted file mode 100644 index 3dac745ff63..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/InputBinding/Overview/MathService.vb.asmx +++ /dev/null @@ -1,26 +0,0 @@ -<%@ WebService Language="VB" Class="MathService" %> -Imports System -Imports System.Web.Services - -Public Class MathService - Inherits WebService - - Public Function Add(a As Single, b As Single) As Single - Return a + b - End Function 'Add - - Public Function Subtract(a As Single, b As Single) As Single - Return a - b - End Function 'Subtract - - Public Function Multiply(a As Single, b As Single) As Single - Return a * b - End Function 'Multiply - - Public Function Divide(a As Single, b As Single) As Single - If b = 0 Then - Return - 1 - End If - Return a / b - End Function 'Divide -End Class 'MathService \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/InputBinding/Overview/MathService_input_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/InputBinding/Overview/MathService_input_vb.wsdl deleted file mode 100644 index ec8dfa16f11..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/InputBinding/Overview/MathService_input_vb.wsdl +++ /dev/null @@ -1,491 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/InputBinding/Overview/descriptionnamespacesample1.vb b/snippets/visualbasic/System.Web.Services.Description/InputBinding/Overview/descriptionnamespacesample1.vb deleted file mode 100644 index 480a92087d9..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/InputBinding/Overview/descriptionnamespacesample1.vb +++ /dev/null @@ -1,233 +0,0 @@ -' System.Web.Services.Description.InputBinding.InputBinding(); -' System.Web.Services.Description.InputBinding.Extensions -' System.Web.Services.Description.InputBinding -' System.Web.Services.Description.Message.Message(); -' System.Web.Services.Description.Message.Name; -' System.Web.Services.Description.Message.Parts; -' System.Web.Services.Description.MessageCollection.Add; -' System.Web.Services.Description.MessageCollection.Insert; -' System.Web.Services.Description.MessageCollection; -' System.Web.Services.Description.MessagePart.MessagePart(); -' System.Web.Services.Description.MessagePart.Element; -' System.Web.Services.Description.MessagePart.Name; -' System.Web.Services.Description.MessagePart; -' System.Web.Services.Description.MessagePartCollection.Add; -' System.Web.Services.Description.MessagePartCollection.Insert; - -' The following program takes input a WSDL file 'MathService_input.wsdl' with all information related to -' SOAP protocol removed from it. In a way, it tries to simulate a scenario wherein a service -' initially did not support a protocol, however later on happen to support it. - -' In this example, the WSDL file is modified to insert a new Binding for SOAP. The binding is -' populated based on WSDL document structure defined in WSDL specification. The ServiceDescription -' instance is loaded with values for 'Messages', 'PortTypes', 'Bindings', and 'Port'. The instance is -' then written to an external file 'MathService_new.wsdl'. - -Imports System.Web.Services.Description -Imports System.Collections -Imports System.Xml - -Class MyClass1 - - Public Shared Sub Main() -' - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read ("MathService_input_vb.wsdl") - - ' Create SOAP messages. -' - Dim myMessage As New Message() - myMessage.Name = "AddSoapOut" -' - Dim myMessagePart As New MessagePart() - myMessagePart.Name = "parameters" - myMessagePart.Element = New XmlQualifiedName("AddResponse", _ - myServiceDescription.TargetNamespace) - myMessage.Parts.Add(myMessagePart) -' - myServiceDescription.Messages.Add(myMessage) -' -'
-' - Dim myMessage1 As New Message() - myMessage1.Name = "AddSoapIn" -' - Dim myMessagePart1 As New MessagePart() - myMessagePart1.Name = "parameters" - myMessagePart1.Element = New XmlQualifiedName("Add", _ - myServiceDescription.TargetNamespace) - myMessage1.Parts.Insert(0, myMessagePart1) -' - myServiceDescription.Messages.Insert(16, myMessage1) -' - myServiceDescription.Messages.Add(CreateMessage("SubtractSoapIn", _ - "parameters", "Subtract", myServiceDescription.TargetNamespace)) - myServiceDescription.Messages.Add(CreateMessage("SubtractSoapOut", _ - "parameters", "SubtractResponse", _ - myServiceDescription.TargetNamespace)) - myServiceDescription.Messages.Add(CreateMessage("MultiplySoapIn", _ - "parameters", "Multiply", myServiceDescription.TargetNamespace)) - myServiceDescription.Messages.Add(CreateMessage("MultiplySoapOut", _ - "parameters", "MultiplyResponse", _ - myServiceDescription.TargetNamespace)) - myServiceDescription.Messages.Add(CreateMessage("DivideSoapIn", _ - "parameters", "Divide", myServiceDescription.TargetNamespace)) - myServiceDescription.Messages.Add(CreateMessage("DivideSoapOut", _ - "parameters", "DivideResponse", _ - myServiceDescription.TargetNamespace)) - - ' Create a new PortType. - Dim soapPortType As New PortType() - soapPortType.Name = "MathServiceSoap" - soapPortType.Operations.Add(CreateOperation("Add", "AddSoapIn", _ - "AddSoapOut", myServiceDescription.TargetNamespace)) - soapPortType.Operations.Add(CreateOperation("Subtract", "SubtractSoapIn", _ - "SubtractSoapOut", myServiceDescription.TargetNamespace)) - soapPortType.Operations.Add(CreateOperation("Multiply", "MultiplySoapIn", _ - "MultiplySoapOut", myServiceDescription.TargetNamespace)) - soapPortType.Operations.Add(CreateOperation("Divide", "DivideSoapIn", _ - "DivideSoapOut", myServiceDescription.TargetNamespace)) - myServiceDescription.PortTypes.Add(soapPortType) - - ' Create a new Binding for SOAP protocol. - Dim myBinding As New Binding() - myBinding.Name = myServiceDescription.Services(0).Name & "Soap" - - ' Pass the name of the existing PortType MathServiceSoap and the - ' Xml targetNamespace attribute of the Descriptions tag. - myBinding.Type = New XmlQualifiedName("MathServiceSoap", _ - myServiceDescription.TargetNamespace) - - ' Create a SOAP extensibility element. - Dim mySoapBinding As New SoapBinding() - mySoapBinding.Transport = "http://schemas.xmlsoap.org/soap/http" - mySoapBinding.Style = SoapBindingStyle.Document - - ' Add tag soap:binding as an extensibility element. - myBinding.Extensions.Add(mySoapBinding) - ' Create OperationBindings for each of the operations defined - ' in the .asmx file. - Dim addOperationBinding As OperationBinding = CreateOperationBinding( _ - "Add", myServiceDescription.TargetNamespace) - myBinding.Operations.Add(addOperationBinding) - Dim subtractOperationBinding As OperationBinding = CreateOperationBinding( _ - "Subtract", myServiceDescription.TargetNamespace) - myBinding.Operations.Add(subtractOperationBinding) - Dim multiplyOperationBinding As OperationBinding = CreateOperationBinding( _ - "Multiply", myServiceDescription.TargetNamespace) - myBinding.Operations.Add(multiplyOperationBinding) - Dim divideOperationBinding As OperationBinding = CreateOperationBinding( _ - "Divide", myServiceDescription.TargetNamespace) - myBinding.Operations.Add(divideOperationBinding) - myServiceDescription.Bindings.Insert(0, myBinding) - - Console.WriteLine(ControlChars.NewLine & "Target namespace of the " _ - & "service description to which the binding was added is: " & _ - myServiceDescription.Bindings(0).ServiceDescription.TargetNamespace) - - ' Create a Port. - Dim soapPort As New Port() - soapPort.Name = "MathServiceSoap" - soapPort.Binding = New XmlQualifiedName(myBinding.Name, _ - myServiceDescription.TargetNamespace) - - ' Create a SoapAddress extensibility element to add to the port. - Dim mySoapAddressBinding As New SoapAddressBinding() - mySoapAddressBinding.Location = "http://localhost/MathService.vb.asmx" - soapPort.Extensions.Add(mySoapAddressBinding) - - ' Add the port to the MathService, which is the first service in - ' the service collection. - myServiceDescription.Services(0).Ports.Add(soapPort) - - ' Save the ServiceDescripition to an external file. - myServiceDescription.Write("MathService_new.wsdl") - Console.WriteLine(ControlChars.NewLine & "Successfully added bindings " _ - & "for SOAP protocol and saved results in the file " _ - & "MathService_new.wsdl") - Console.WriteLine(ControlChars.NewLine & " This file should be passed " _ - & "to the WSDL tool as input to generate the proxy") - End Sub - -' - ' Creates a Message with name = messageName having one MessagePart - ' with name = partName. - Public Shared Function CreateMessage(messageName As String, _ - partName As String, element As String, targetNamespace As String) _ - As Message -' -' - Dim myMessage As New Message() - myMessage.Name = messageName -' -' -' -' -' - Dim myMessagePart As New MessagePart() - myMessagePart.Name = partName - myMessagePart.Element = New XmlQualifiedName(element, targetNamespace) - myMessage.Parts.Add(myMessagePart) -' -' -' -' -' - Return myMessage - End Function 'CreateMessage - -' -' - ' Used to create OperationBinding instances within 'Binding'. - Public Shared Function CreateOperationBinding(operation As String, _ - targetNamespace As String) As OperationBinding - - ' Create OperationBinding for operation. - Dim myOperationBinding As New OperationBinding() - myOperationBinding.Name = operation - -' -' - ' Create InputBinding for operation. - Dim myInputBinding As New InputBinding() - Dim mySoapBodyBinding As New SoapBodyBinding() - mySoapBodyBinding.Use = SoapBindingUse.Literal - myInputBinding.Extensions.Add(mySoapBodyBinding) -' -' - ' Create OutputBinding for operation. - Dim myOutputBinding As New OutputBinding() - myOutputBinding.Extensions.Add(mySoapBodyBinding) - - ' Add InputBinding and OutputBinding to OperationBinding. - myOperationBinding.Input = myInputBinding - myOperationBinding.Output = myOutputBinding - - ' Create an extensibility element for SoapOperationBinding. - Dim mySoapOperationBinding As New SoapOperationBinding() - mySoapOperationBinding.Style = SoapBindingStyle.Document - mySoapOperationBinding.SoapAction = targetNamespace & operation - - ' Add the extensibility element SoapOperationBinding to OperationBinding. - myOperationBinding.Extensions.Add(mySoapOperationBinding) - Return myOperationBinding - End Function 'CreateOperationBinding - -' - ' Used to create Operations under PortType. - Public Shared Function CreateOperation(operationName As String, _ - inputMessage As String, outputMessage As String, targetNamespace _ - As String) As Operation - Dim myOperation As New Operation() - myOperation.Name = operationName - Dim input As OperationMessage = _ - CType(New OperationInput(), OperationMessage) - input.Message = New XmlQualifiedName(inputMessage, targetNamespace) - Dim output As OperationMessage = _ - CType(New OperationOutput(), OperationMessage) - output.Message = New XmlQualifiedName(outputMessage, targetNamespace) - myOperation.Messages.Add(input) - myOperation.Messages.Add(output) - Return myOperation - End Function 'CreateOperation -End Class diff --git a/snippets/visualbasic/System.Web.Services.Description/Message/FindPartByName/MathService_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/Message/FindPartByName/MathService_vb.wsdl deleted file mode 100644 index 9aa220c7ed2..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/Message/FindPartByName/MathService_vb.wsdl +++ /dev/null @@ -1,352 +0,0 @@ - - - - - All types have been defined here - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Port Type "MathServiceHttpGet" is defined here - - - - - - - - - - - - - - - - - - - - - Port Type "MathServiceHttpPost" is defined here - - - - - - - - - - - - - - - - - - - - - Port Type "MathServiceSoap" is defined here - - - - - - - - - - - - - - - - - - - - - Binding "MathServiceSoap" is defined here - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Binding "MathServiceHttpGet" is defined here - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Binding "MathServiceHttpPost" is defined here - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/Message/FindPartByName/message_samples3.vb b/snippets/visualbasic/System.Web.Services.Description/Message/FindPartByName/message_samples3.vb deleted file mode 100644 index d0a8d21cec7..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/Message/FindPartByName/message_samples3.vb +++ /dev/null @@ -1,54 +0,0 @@ -' System.Web.Services.Description.Message.FindPartsByName -' System.Web.Services.Description.Message.ServiceDescription -' System.Web.Services.Description.Message.FindPartByName - -' The following program demonstrates the property ' ServiceDescription' and -' methods 'FindPartsByName','FindPartByName' of class 'Message'. The program -' reads a wsdl document "MathService_vb.wsdl" and instantiates a -' ServiceDescription instance from WSDL document. -' The program invokes 'FindPartsByName' to obtain an array of MessagePart's -' and also invokes 'FindPartByName' to retrieve a specific 'MessagePart'. - -Imports System.Web.Services.Description -Imports System.Collections -Imports System.Xml - -Namespace MyMessage - Class MyClass1 - Public Shared Sub Main() - Try -' - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("MathService_vb.wsdl") -' - ' Get message from ServiceDescription. - Dim myMessage1 As Message = myServiceDescription.Messages("AddHttpPostIn") - Console.WriteLine("ServiceDescription :" + _ - myMessage1.ServiceDescription.ToString()) -' - Dim myParts(1) As String - myParts(0) = "a" - myParts(1) = "b" - Dim myMessageParts As MessagePart() = myMessage1.FindPartsByName(myParts) - Console.WriteLine("Results of FindPartsByName operation:") - Dim i As Integer - For i = 0 To myMessageParts.Length - 1 - Console.WriteLine("Part Name: " + myMessageParts(i).Name) - Console.WriteLine("Part Type: " + myMessageParts(i).Type.ToString()) - Next i -' - -' - ' Get another message from ServiceDescription. - Dim myMessage2 As Message = myServiceDescription.Messages("DivideHttpGetOut") - Dim myMessagePart As MessagePart = myMessage2.FindPartByName("Body") - Console.WriteLine("Results of FindPartByName operation:") - Console.WriteLine("Part Name: " + myMessagePart.Name) - Console.WriteLine("Part Element: " + myMessagePart.Element.ToString()) -' - Catch e As Exception - Console.WriteLine("Exception: " + e.Message) - End Try - End Sub - End Class -End Namespace 'MyMessage \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/MessageBinding/Overview/messagebinding_sample.vb b/snippets/visualbasic/System.Web.Services.Description/MessageBinding/Overview/messagebinding_sample.vb deleted file mode 100644 index 7a7abc80037..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/MessageBinding/Overview/messagebinding_sample.vb +++ /dev/null @@ -1,78 +0,0 @@ -' System.Web.Services.Description.MessageBinding -' System.Web.Services.Description.MessageBinding.MessageBinding(); -' System.Web.Services.Description.MessageBinding.Extensions; -' System.Web.Services.Description.MessageBinding.Name; - -' The following program demonstrates the abstract class 'MessageBinding', it's constructor -' MessageBinding()and properties 'Extensions' and 'Name'.'MessageBinding' is an abstract class -' from which 'InputBinding' and 'OutputBinding' are derived. The program contains a utility function -' which could be used to create either an InputBinding or OutputBinding. This generic nature is -' achieved by returning an instance of 'MessageBinding'. -' -Imports System.Web.Services.Description - -Class MyClass1 - - Public Shared Sub Main() - Dim addOperationBinding As OperationBinding = _ - CreateOperationBinding("Add", "http://tempuri.org/") - End Sub - - Public Shared Function CreateInputOutputBinding(myBindName As String, _ - isInputBinding As Boolean) As MessageBinding -' - ' Value isInputBinding = true ---> return type = InputBinding. - ' Value isInputBinding = false --> return type = OutputBinding. -' -' - Dim myMessageBinding As MessageBinding = Nothing - Select Case isInputBinding - Case True - myMessageBinding = New InputBinding() - Console.WriteLine("Added an InputBinding") - Case False - myMessageBinding = New OutputBinding() - Console.WriteLine("Added an OutputBinding") - End Select -' - myMessageBinding.Name = myBindName - Dim mySoapBodyBinding As New SoapBodyBinding() - mySoapBodyBinding.Use = SoapBindingUse.Literal - myMessageBinding.Extensions.Add(mySoapBodyBinding) - Console.WriteLine("Added extensibility element of type: " & _ - mySoapBodyBinding.GetType().ToString()) -' -' - Return myMessageBinding - End Function 'CreateInputOutputBinding - - ' Used to create OperationBinding instances within Binding. - Public Shared Function CreateOperationBinding(myOperation As String, _ - targetNamespace As String) As OperationBinding - - ' Create OperationBinding for operation. - Dim myOperationBinding As New OperationBinding() - myOperationBinding.Name = myOperation - - ' Create InputBinding for operation. - Dim myInputBinding As InputBinding = _ - CType(CreateInputOutputBinding(Nothing, True), InputBinding) - ' Create OutputBinding for operation. - Dim myOutputBinding As OutputBinding = _ - CType(CreateInputOutputBinding(Nothing, False), OutputBinding) - - ' Add InputBinding and OutputBinding to OperationBinding. - myOperationBinding.Input = myInputBinding - myOperationBinding.Output = myOutputBinding - - ' Create an extensibility element for SoapOperationBinding. - Dim mySoapOperationBinding As New SoapOperationBinding() - mySoapOperationBinding.Style = SoapBindingStyle.Document - mySoapOperationBinding.SoapAction = targetNamespace + myOperation - - ' Add the extensibility element SoapOperationBinding to OperationBinding. - myOperationBinding.Extensions.Add(mySoapOperationBinding) - Return myOperationBinding - End Function 'CreateOperationBinding -End Class -' diff --git a/snippets/visualbasic/System.Web.Services.Description/MessageCollection/Contains/messagecollection.vb b/snippets/visualbasic/System.Web.Services.Description/MessageCollection/Contains/messagecollection.vb deleted file mode 100644 index e3e6cea7ee1..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/MessageCollection/Contains/messagecollection.vb +++ /dev/null @@ -1,76 +0,0 @@ -' System.Web.Services.Description.MessageCollection.CopyTo; -' System.Web.Services.Description.MessageCollection.Item Property(Int32); -' System.Web.Services.Description.MessageCollection.Item Property (String); -' System.Web.Services.Description.MessageCollection.Contains; -' System.Web.Services.Description.MessageCollection.IndexOf; -' System.Web.Services.Description.MessageCollection.Remove; - -' The program reads a WSDL document "MathService.wsdl" and gets a -' ServiceDescription instance. A MessageCollection instance is then retrieved -' from this ServiceDescription instance and it's members are demonstrated. - -Imports System.Web.Services.Description -Imports System.Collections -Imports System.Xml - -Class MyClass1 - Public Shared Sub Main() - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("MathService_1.wsdl") - Console.WriteLine("") - Console.WriteLine("MessageCollection Sample") - Console.WriteLine("========================") - Console.WriteLine("") -' - ' Get Message Collection. - Dim myMessageCollection As MessageCollection = myServiceDescription.Messages - Console.WriteLine("Total Messages in the document = " + _ - myServiceDescription.Messages.Count.ToString) - Console.WriteLine("") - Console.WriteLine("Enumerating Messages...") - Console.WriteLine("") - ' Print messages to console. - Dim i As Integer - For i = 0 To myMessageCollection.Count - 1 - Console.WriteLine("Message Name : " + myMessageCollection(i).Name) - Next -' -' - ' Create a Message Array. - Dim myMessages(myServiceDescription.Messages.Count) As Message - ' Copy MessageCollection to an array. - myServiceDescription.Messages.CopyTo(myMessages, 0) - Console.WriteLine("") - Console.WriteLine("Displaying Messages that were copied to Messagearray ...") - Console.WriteLine("") - For i = 0 To myMessageCollection.Count - 1 - Console.WriteLine("Message Name : " + myMessages(i).Name) - Next -' -' -' -' -' - ' Get Message by Name = "AddSoapIn". - Dim myMessage As Message = myServiceDescription.Messages("AddSoapIn") - Console.WriteLine("") - Console.WriteLine("Getting Message = 'AddSoapIn' {by Name}") - If myMessageCollection.Contains(myMessage) Then - Console.WriteLine("") - ' Get Message Name = "AddSoapIn" Index. - Console.WriteLine("Message 'AddSoapIn' was found in Message Collection.") - Console.WriteLine("Index of 'AddSoapIn' in Message Collection = " + _ - myMessageCollection.IndexOf(myMessage).ToString) - Console.WriteLine("Deleting Message from Message Collection...") - myMessageCollection.Remove(myMessage) - If myMessageCollection.IndexOf(myMessage) = -1 Then - Console.WriteLine("Message 'AddSoapIn' was successfully " + _ - " removed from Message Collection.") - End If - End If -' -' -' -' - End Sub -End Class diff --git a/snippets/visualbasic/System.Web.Services.Description/MessagePart/Message/messagepartcollection.vb b/snippets/visualbasic/System.Web.Services.Description/MessagePart/Message/messagepartcollection.vb deleted file mode 100644 index 608170dec39..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/MessagePart/Message/messagepartcollection.vb +++ /dev/null @@ -1,115 +0,0 @@ -' System.Web.Services.Description.MessagePartCollection.Item Property(Int32); -' System.Web.Services.Description.MessagePart.Message; -' System.Web.Services.Description.MessagePartCollection.CopyTo; -' System.Web.Services.Description.MessagePartCollection.Item Property (String); -' System.Web.Services.Description.MessagePartCollection.Contains; -' System.Web.Services.Description.MessagePartCollection.IndexOf; -' System.Web.Services.Description.MessagePartCollection.Remove; -' System.Web.Services.Description.MessagePartCollection; - -' The program reads a wsdl document "MathService.wsdl" and gets -' ServiceDescription instance. A MessagePartCollection instance is then -' retrieved from each Message and it's members are demonstrated. - -' -Imports System.Web.Services.Description -Imports System.Collections -Imports System.Xml - -Class MyClass1 - Public Shared Sub Main() - Console.WriteLine("") - Console.WriteLine("MessagePartCollection Sample") - Console.WriteLine("============================") - Console.WriteLine("") - - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("MathService.wsdl") - ' Get the message collection. - Dim myMessageCollection As MessageCollection = _ - myServiceDescription.Messages - Console.WriteLine("Total Messages in the document = " & _ - myServiceDescription.Messages.Count.ToString) - Console.WriteLine("") - Console.WriteLine("Enumerating PartCollection for each message...") - Console.WriteLine("") -' -' - ' Get the message part collection for each message. - Dim i As Integer - For i =0 to myMessageCollection.Count-1 - Console.WriteLine("Message : " & myMessageCollection(i).Name) - - ' Get the message part collection. - Dim myMessagePartCollection As MessagePartCollection = _ - myMessageCollection(i).Parts - - ' Display the part collection. - Dim k As Integer - For k = 0 To myMessagePartCollection.Count - 1 - Console.WriteLine(ControlChars.Tab & " Part Name : " & _ - myMessagePartCollection(k).Name) - Console.WriteLine(ControlChars.Tab & " Message Name : " & _ - myMessagePartCollection(k).Message.Name) - Next k - Console.WriteLine("") - Next -' -' - Console.WriteLine("Displaying the array copied from the " & _ - "MessagePartCollection for the message AddHttpGetIn.") -' -' - Dim myLocalMessage As Message = _ - myServiceDescription.Messages("AddHttpPostOut") - If myMessageCollection.Contains(myLocalMessage) Then - Console.WriteLine("Message : " & myLocalMessage.Name) - - ' Get the message part collection. - Dim myMessagePartCollection As MessagePartCollection = _ - myLocalMessage.Parts - Dim myMessagePart(myMessagePartCollection.Count) As MessagePart - - ' Copy the MessagePartCollection to an array. - myMessagePartCollection.CopyTo(myMessagePart, 0) - Dim k As Integer - For k = 0 To myMessagePart.Length - 2 - Console.WriteLine(ControlChars.Tab & " Part Name : " & _ - myMessagePartCollection(k).Name) - Next k - Console.WriteLine("") - End If -' -' - -' -' -' - Console.WriteLine("Checking if message is AddHttpPostOut...") - Dim myMessage As Message = myServiceDescription.Messages("AddHttpPostOut") - If myMessageCollection.Contains(myMessage) Then - - ' Get the message part collection. - Dim myMessagePartCollection As MessagePartCollection = myMessage.Parts - - ' Get the part named Body. - Dim myMessagePart As MessagePart = myMessage.Parts("Body") - If myMessagePartCollection.Contains(myMessagePart) Then - - ' Get the index of the part named Body. - Console.WriteLine("Index of Body in MessagePart collection = " & _ - myMessagePartCollection.IndexOf(myMessagePart).ToString) - Console.WriteLine("Deleting Body from MessagePart Collection...") - myMessagePartCollection.Remove(myMessagePart) - If myMessagePartCollection.IndexOf(myMessagePart) = -1 Then - Console.WriteLine("MessagePart Body successfully deleted " & _ - "from the message AddHttpPostOut.") - End If - End If - End If -' -' -' - End Sub -End Class -' diff --git a/snippets/visualbasic/System.Web.Services.Description/MimeContentBinding/Overview/MimeContentSample_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/MimeContentBinding/Overview/MimeContentSample_vb.wsdl deleted file mode 100644 index 29a1e169633..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/MimeContentBinding/Overview/MimeContentSample_vb.wsdl +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/snippets/visualbasic/System.Web.Services.Description/MimeContentBinding/Overview/mimecontentbinding_part_4.vb b/snippets/visualbasic/System.Web.Services.Description/MimeContentBinding/Overview/mimecontentbinding_part_4.vb deleted file mode 100644 index 980947cfde7..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/MimeContentBinding/Overview/mimecontentbinding_part_4.vb +++ /dev/null @@ -1,54 +0,0 @@ -' System.Web.Services.Description.MimeContentBinding.Type -' System.Web.Services.Description.MimeContentBinding.Part -' System.Web.Services.Description.MimeContentBinding.NameSpace -' System.Web.Services.Description.MimeContentBinding - -' The following program demonstrates 'Type' and 'Part' properties -' and the 'NameSpace' field of the 'MimeContentBinding' class. It reads 'MimeContentSample_vb.wsdl' file -' and instantiates a ServiceDescription object. 'MimeContentBinding' objects are retrieved from Extension -' points of OutputBinding for one of the Binding object and its 'Type' and 'Part' properties are displayed. -' It also displays 'NameSpace' of the 'MimeContentBinding' object. - -' -Imports System.Web.Services.Description - -Namespace MimeContentBinding_work - - Class MyMimeContentClass - - Shared Sub Main() -' -' -' - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read ("MimeContentSample_vb.wsdl") - - ' Get the Binding. - Dim myBinding As Binding = myServiceDescription.Bindings("b1") - - ' Get the first OperationBinding. - Dim myOperationBinding As OperationBinding = myBinding.Operations(0) - Dim myOutputBinding As OutputBinding = myOperationBinding.Output - Dim myServiceDescriptionFormatExtensionCollection As _ - ServiceDescriptionFormatExtensionCollection = _ - myOutputBinding.Extensions - - ' Find all MimeContentBinding objects in extensions. - Dim myMimeContentBindings As MimeContentBinding() = _ - CType(myServiceDescriptionFormatExtensionCollection.FindAll( _ - GetType(MimeContentBinding)), MimeContentBinding()) - - ' Enumerate the array and display MimeContentBinding properties. - Dim myMimeContentBinding As MimeContentBinding - For Each myMimeContentBinding In myMimeContentBindings - Console.WriteLine("Type: " & myMimeContentBinding.Type) - Console.WriteLine("Part: " & myMimeContentBinding.Part) - Next myMimeContentBinding -' -' - Console.WriteLine("Namespace: " & MimeContentBinding.Namespace) -' - End Sub - End Class -End Namespace 'MimeContentBinding_work -' diff --git a/snippets/visualbasic/System.Web.Services.Description/MimeMultipartRelatedBinding/Overview/MimeMultiPartRelatedSample_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/MimeMultipartRelatedBinding/Overview/MimeMultiPartRelatedSample_vb.wsdl deleted file mode 100644 index 71d31d9be9c..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/MimeMultipartRelatedBinding/Overview/MimeMultiPartRelatedSample_vb.wsdl +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/MimeMultipartRelatedBinding/Overview/mimemultipartrelatedbinding_parts_2.vb b/snippets/visualbasic/System.Web.Services.Description/MimeMultipartRelatedBinding/Overview/mimemultipartrelatedbinding_parts_2.vb deleted file mode 100644 index f61dd94901f..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/MimeMultipartRelatedBinding/Overview/mimemultipartrelatedbinding_parts_2.vb +++ /dev/null @@ -1,62 +0,0 @@ -' System.Web.Services.Description.MimeMultipartRelatedBinding -' System.Web.Services.Description.MimeMultipartRelatedBinding.Parts; - -' The following program demonstrates the property 'Parts' of class 'MimeMultipartRelatedBinding'. -' It reads 'MimeMultiPartRelatedSample_vb.wsdl'file and instantiates a ServiceDescription object. -' 'MimeMultipartRelatedBinding' object is retrieved from Extension -' points of OutputBinding for one of the Binding object and its property'Parts' has been demonstrated. - -' -Imports System.Web.Services.Description - -Namespace MimeContentBinding_work - - Class MyMimeContentClass - - Shared Sub Main() -' - Dim myServicDescription As ServiceDescription = _ - ServiceDescription.Read("MimeMultiPartRelatedSample_vb.wsdl") - - ' Get the binding collection. - Dim myBindingCollection As BindingCollection = _ - myServicDescription.Bindings - Dim index As Integer = 0 - Dim i As Integer - For i = 0 To myBindingCollection.Count - 1 - ' Get the collection for MimeServiceHttpPost. - If myBindingCollection(i).Name = "MimeServiceHttpPost" Then - Dim myOperationBindingCollection As _ - OperationBindingCollection = myBindingCollection(i).Operations - Dim myOutputBinding As OutputBinding = _ - myOperationBindingCollection(0).Output - Dim myServiceDescriptionFormatExtensionCollection As _ - ServiceDescriptionFormatExtensionCollection = _ - myOutputBinding.Extensions - Dim myMimeMultipartRelatedBinding As _ - MimeMultipartRelatedBinding = _ - CType(myServiceDescriptionFormatExtensionCollection.Find( _ - GetType(MimeMultipartRelatedBinding)), _ - MimeMultipartRelatedBinding) - Dim myMimePartCollection As MimePartCollection = _ - myMimeMultipartRelatedBinding.Parts - Dim myMimePart As MimePart - For Each myMimePart In myMimePartCollection - Console.WriteLine("Extension Types added to MimePart: " & _ - index.ToString()) - Console.WriteLine("----------------------------") - index = index + 1 - Dim myExtension As Object - For Each myExtension In myMimePart.Extensions - Console.WriteLine(myExtension.GetType()) - Next myExtension - Console.WriteLine() - Next myMimePart - Exit For - End If - Next i -' - End Sub - End Class -End Namespace 'MimeContentBinding_work -' diff --git a/snippets/visualbasic/System.Web.Services.Description/MimePart/Overview/MimePart_3_Input_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/MimePart/Overview/MimePart_3_Input_vb.wsdl deleted file mode 100644 index 56eb67388db..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/MimePart/Overview/MimePart_3_Input_vb.wsdl +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/MimePart/Overview/mimepart_3.vb b/snippets/visualbasic/System.Web.Services.Description/MimePart/Overview/mimepart_3.vb deleted file mode 100644 index cb36832f99f..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/MimePart/Overview/mimepart_3.vb +++ /dev/null @@ -1,56 +0,0 @@ -' System.Web.Services.Description.MimePart -' System.Web.Services.Description.MimePart.ctor() -' System.Web.Services.Description.MimePart.Extensions - -' The following program demonstrates the 'MimePart' class, constructor -' and 'Extensions' property of 'MimePart' class. It reads -' 'MimePart_3_Input_vb.wsdl' file which does not have 'MimePart' object -' supporting 'OutPut' of 'HttpPost'. It adds the 'MimePart' and finally -' writes into 'MimePart_3_OutPut_vb.wsdl' file. - -' -Imports System.Xml -Imports System.Web.Services.Description - -Public Class MyMimePart - Public Shared Sub Main() - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("MimePart_3_Input_vb.wsdl") - Dim myServiceDescriptionCol As New ServiceDescriptionCollection() - myServiceDescriptionCol.Add(myServiceDescription) - Dim myXmlQualifiedName As _ - New XmlQualifiedName("MimeServiceHttpPost", "http://tempuri.org/") - - ' Create the Binding. - Dim myBinding As Binding = _ - myServiceDescriptionCol.GetBinding(myXmlQualifiedName) - Dim myOperationBinding As OperationBinding = Nothing - Dim i As Integer - For i = 0 To myBinding.Operations.Count - 1 - If myBinding.Operations(i).Name.Equals("AddNumbers") Then - myOperationBinding = myBinding.Operations(i) - End If - Next i -' -' - ' Create the OutputBinding. - Dim myOutputBinding As OutputBinding = myOperationBinding.Output - Dim myMimeXmlBinding As New MimeXmlBinding() - myMimeXmlBinding.Part = "body" - - ' Create the MimePart. - Dim myMimePart As New MimePart() - myMimePart.Extensions.Add(myMimeXmlBinding) - Dim myMimePartRelatedBinding As New MimeMultipartRelatedBinding() - - ' Add the MimePart to the MimePartRelatedBinding. - myMimePartRelatedBinding.Parts.Add(myMimePart) - myOutputBinding.Extensions.Add(myMimePartRelatedBinding) -' -' - myServiceDescription.Write("MimePart_3_Output_vb.wsdl") - Console.WriteLine( _ - "MimePart_3_Output_vb.wsdl has been generated successfully.") - End Sub -End Class -' diff --git a/snippets/visualbasic/System.Web.Services.Description/MimePartCollection/Add/MimePartCollection_8_Input_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/MimePartCollection/Add/MimePartCollection_8_Input_vb.wsdl deleted file mode 100644 index 7d34ed4a0c8..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/MimePartCollection/Add/MimePartCollection_8_Input_vb.wsdl +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/MimePartCollection/Add/mimepartcollection_8.vb b/snippets/visualbasic/System.Web.Services.Description/MimePartCollection/Add/mimepartcollection_8.vb deleted file mode 100644 index d44544f3c68..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/MimePartCollection/Add/mimepartcollection_8.vb +++ /dev/null @@ -1,139 +0,0 @@ -' System.Web.Services.Description.MimePartCollection.MimePartCollection() -' System.Web.Services.Description.MimePartCollection.Item[System.Int32 index] -' System.Web.Services.Description.MimePartCollection.Insert -' System.Web.Services.Description.MimePartCollection.IndexOf -' System.Web.Services.Description.MimePartCollection.Add -' System.Web.Services.Description.MimePartCollection.Contains -' System.Web.Services.Description.MimePartCollection.CopyTo -' System.Web.Services.Description.MimePartCollection.Remove - -' This program demostrates constructor, 'Item' property ,'Insert','IndexOf','Add', -' 'Contains','CopyTo',and 'Remove' methods of 'MimePartCollection' class. -' It takes 'MimePartCollection_8_Input_vb.wsdl' as an input file which contains -' one 'MimePart' object that supports 'HttpPost'. A mimepartcollection object is -' created and new mimepart objects are added to mimepartcollection using 'Insert' -' and 'Add' methods. A mimepart object is removed from the mimepartcollection using -' 'Remove'method. The ServiceDescription is finally written into output wsdl file -' 'MimePartCollection_8_out_vb.wsdl'. - -Imports System.Collections -Imports System.Xml -Imports System.Web.Services.Description - -Public Class MyMimePartCollection - - Public Shared Sub Main() - Dim myServiceDescription As ServiceDescription = ServiceDescription.Read _ - ("MimePartCollection_8_Input_vb.wsdl") - Dim myServiceDescriptionCol As New ServiceDescriptionCollection() - myServiceDescriptionCol.Add(myServiceDescription) - Dim myXmlQualifiedName As New XmlQualifiedName("MimeServiceHttpPost", "http://tempuri.org/") - ' Create a binding object. - Dim myBinding As Binding = myServiceDescriptionCol.GetBinding(myXmlQualifiedName) - Dim myOperationBinding As OperationBinding = Nothing - Dim i As Integer - For i = 0 To myBinding.Operations.Count - 1 - If myBinding.Operations(i).Name.Equals("AddNumbers") Then - myOperationBinding = myBinding.Operations(i) - End If - Next i - Dim myOutputBinding As OutputBinding = myOperationBinding.Output -' -' -' -' - Dim myMimeMultipartRelatedBinding As MimeMultipartRelatedBinding = Nothing - Dim myIEnumerator As IEnumerator = myOutputBinding.Extensions.GetEnumerator() - While myIEnumerator.MoveNext() - myMimeMultipartRelatedBinding = CType(myIEnumerator.Current, MimeMultipartRelatedBinding) - End While - ' Create an instance of 'MimePartCollection'. - Dim myMimePartCollection As New MimePartCollection() - myMimePartCollection = myMimeMultipartRelatedBinding.Parts - Console.WriteLine("Total number of mimepart elements in the collection initially" + _ - " is: " + myMimePartCollection.Count.ToString()) - ' Get the type of first 'Item' in collection. - Console.WriteLine("The first object in collection is of type: " + _ - myMimePartCollection.Item(0).ToString()) - Dim myMimePart1 As New MimePart() - ' Create an instance of 'MimeXmlBinding'. - Dim myMimeXmlBinding1 As New MimeXmlBinding() - myMimeXmlBinding1.Part = "body" - myMimePart1.Extensions.Add(myMimeXmlBinding1) - ' a mimepart at first position. - myMimePartCollection.Insert(0, myMimePart1) - Console.WriteLine("Inserting a mimepart object...") - ' Check whether 'Insert' was successful or not. - If myMimePartCollection.Contains(myMimePart1) Then - ' Display the index of inserted 'MimePart'. - Console.WriteLine("'MimePart' is successfully inserted at position: " + _ - myMimePartCollection.IndexOf(myMimePart1).ToString()) - End If -' -' -' -' - Console.WriteLine("Total number of mimepart elements after inserting is: " + _ - myMimePartCollection.Count.ToString()) - -' -' - Dim myMimePart2 As New MimePart() - Dim myMimeXmlBinding2 As New MimeXmlBinding() - myMimeXmlBinding2.Part = "body" - myMimePart2.Extensions.Add(myMimeXmlBinding2) - ' Add a mimepart to the mimepartcollection. - myMimePartCollection.Add(myMimePart2) - Console.WriteLine("Adding a mimepart object...") - ' Check if collection contains added mimepart object. - If myMimePartCollection.Contains(myMimePart2) Then - Console.WriteLine("'MimePart' is successfully added at position: " + _ - myMimePartCollection.IndexOf(myMimePart2).ToString()) - End If -' -' - Console.WriteLine("Total number of mimepart elements after adding is: " + _ - myMimePartCollection.Count.ToString()) - -' - Dim myArray(myMimePartCollection.Count-1) As MimePart - ' Copy the mimepartcollection to an array. - myMimePartCollection.CopyTo(myArray, 0) - Console.WriteLine("Displaying the array copied from mimepartcollection") - Dim j As Integer - For j = 0 To myMimePartCollection.Count - 1 - Console.WriteLine("Mimepart object at position : " + j.ToString()) - For i = 0 To (myArray(j).Extensions.Count) - 1 - Dim myMimeXmlBinding3 As MimeXmlBinding = CType(myArray(j).Extensions(i), _ - MimeXmlBinding) - Console.WriteLine("Part: " + myMimeXmlBinding3.Part) - Next i - Next j -' -' - Console.WriteLine("Removing a mimepart object...") - ' Remove the mimepart from the mimepartcollection. - myMimePartCollection.Remove(myMimePart1) - ' Check whether the mimepart is removed or not. - If Not myMimePartCollection.Contains(myMimePart1) Then - Console.WriteLine("Mimepart is successfully removed from mimepartcollection") - End If -' - Console.WriteLine("Total number of elements in collection after removing is: " + _ - myMimePartCollection.Count.ToString()) - Dim myArray1(myMimePartCollection.Count-1) As MimePart - myMimePartCollection.CopyTo(myArray1, 0) - Console.WriteLine("Dispalying the 'MimePartCollection' after removing") - For j = 0 To myMimePartCollection.Count - 1 - Console.WriteLine("Mimepart object at position :" + j.ToString()) - For i = 0 To (myArray1(j).Extensions.Count) - 1 - Dim myMimeXmlBinding3 As MimeXmlBinding = CType(myArray1(j).Extensions(i), _ - MimeXmlBinding) - Console.WriteLine("part: " + myMimeXmlBinding3.Part) - Next i - Next j - myServiceDescription.Write("MimePartCollection_8_output.wsdl") - Console.WriteLine("MimePartCollection_8_output.wsdl has been generated successfully.") - End Sub -End Class - diff --git a/snippets/visualbasic/System.Web.Services.Description/MimePartCollection/Overview/MimePartCollection_1_Input_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/MimePartCollection/Overview/MimePartCollection_1_Input_vb.wsdl deleted file mode 100644 index 7d34ed4a0c8..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/MimePartCollection/Overview/MimePartCollection_1_Input_vb.wsdl +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/MimePartCollection/Overview/mimepartcollection_1.vb b/snippets/visualbasic/System.Web.Services.Description/MimePartCollection/Overview/mimepartcollection_1.vb deleted file mode 100644 index d11d089447c..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/MimePartCollection/Overview/mimepartcollection_1.vb +++ /dev/null @@ -1,63 +0,0 @@ -' System.Web.Services.Description.MimePartCollection - -' The following program demostrates 'MimePartCollection' class. It -' takes 'MimePartCollection_1_Input_vb.wsdl' as input which -' contains one 'MimePart' object that supports 'HttpPost'. -' A mimepartcollection object is created and mimepart is added to the -' mimepartcollection at the specified location, finally writes -' into the file'MimePartCollection_1_Output_VB.wsdl'. - -' -Imports System.Collections -Imports System.Xml -Imports System.Web.Services.Description - -Public Class MyMimePartCollection - - Public Shared Sub Main() - Dim myServiceDescription As ServiceDescription = ServiceDescription.Read _ - ("MimePartCollection_1_Input_vb.wsdl") - Dim myServiceDescriptionCol As New ServiceDescriptionCollection() - myServiceDescriptionCol.Add(myServiceDescription) - Dim myXmlQualifiedName As New XmlQualifiedName("MimeServiceHttpPost", "http://tempuri.org/") - ' Create a 'Binding' object. - Dim myBinding As Binding = myServiceDescriptionCol.GetBinding(myXmlQualifiedName) - Dim myOperationBinding As OperationBinding = Nothing - Dim i As Integer - For i = 0 To myBinding.Operations.Count - 1 - If myBinding.Operations(i).Name.Equals("AddNumbers") Then - myOperationBinding = myBinding.Operations(i) - End If - Next i - Dim myOutputBinding As OutputBinding = myOperationBinding.Output - Dim myMimeMultipartRelatedBinding As MimeMultipartRelatedBinding = Nothing - Dim myIEnumerator As IEnumerator = myOutputBinding.Extensions.GetEnumerator() - While myIEnumerator.MoveNext() - myMimeMultipartRelatedBinding = CType(myIEnumerator.Current, MimeMultipartRelatedBinding) - End While - ' Create an instances of 'MimePartCollection'. - Dim myMimePartCollection As New MimePartCollection() - myMimePartCollection = myMimeMultipartRelatedBinding.Parts - - Console.WriteLine("Total number of mimepart elements initially is: " + _ - myMimePartCollection.Count.ToString()) - ' Create an instance of 'MimePart'. - Dim myMimePart As New MimePart() - ' Create an instance of 'MimeXmlBinding'. - Dim myMimeXmlBinding As New MimeXmlBinding() - myMimeXmlBinding.Part = "body" - myMimePart.Extensions.Add(myMimeXmlBinding) - ' Insert a mimepart at first position. - myMimePartCollection.Insert(0, myMimePart) - Console.WriteLine("Inserting a mimepart object...") - If myMimePartCollection.Contains(myMimePart) Then - Console.WriteLine("'MimePart' is succesffully added at position: " + _ - myMimePartCollection.IndexOf(myMimePart).ToString()) - Console.WriteLine("Total number of mimepart elements after inserting is: " + _ - myMimePartCollection.Count.ToString()) - End If - myServiceDescription.Write("MimePartCollection_1_Output_VB.wsdl") - Console.WriteLine("MimePartCollection_1_Output_VB.wsdl has been generated successfully.") - End Sub -End Class -' \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/MimeTextBinding/Overview/MimeText_Binding_MatchService.vb.asmx b/snippets/visualbasic/System.Web.Services.Description/MimeTextBinding/Overview/MimeText_Binding_MatchService.vb.asmx deleted file mode 100644 index 9bcb17ad6af..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/MimeTextBinding/Overview/MimeText_Binding_MatchService.vb.asmx +++ /dev/null @@ -1,18 +0,0 @@ -<%@ WebService Language="VB" Class="MimeText_Binding_MatchService"%> - -Imports System -Imports System.Collections -Imports System.ComponentModel -Imports System.Data -Imports System.Diagnostics -Imports System.Web -Imports System.Web.Services - -Public Class MimeText_Binding_MatchService - Inherits System.Web.Services.WebService - _ - Public Function AddNumbers(firstNumber As Integer, _ - secondNumber As Integer) As Integer - Return firstNumber + secondNumber - End Function 'AddNumbers -End Class 'MimeText_Binding_MatchService \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/MimeTextBinding/Overview/MimeText_Binding_Match_8_Input_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/MimeTextBinding/Overview/MimeText_Binding_Match_8_Input_vb.wsdl deleted file mode 100644 index c6b11cde0e5..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/MimeTextBinding/Overview/MimeText_Binding_Match_8_Input_vb.wsdl +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/MimeTextBinding/Overview/mimetext_binding_match_8.vb b/snippets/visualbasic/System.Web.Services.Description/MimeTextBinding/Overview/mimetext_binding_match_8.vb deleted file mode 100644 index d84b19eb55c..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/MimeTextBinding/Overview/mimetext_binding_match_8.vb +++ /dev/null @@ -1,122 +0,0 @@ -' System.Web.Services.Description.MimeTextBinding -' System.Web.Services.Description.MimeTextBinding() -' System.Web.Services.Description.MimeTextMatch() -' System.Web.Services.Description.MimeTextMatch.Name -' System.Web.Services.Description.MimeTextMatch.Type -' System.Web.Services.Description.MimeTextMatch.Pattern -' System.Web.Services.Description.MimeTextMatch.IgnoreCase -' System.Web.Services.Description.MimeTextBinding.Matches - -' This program demostrates constructor and 'Matches' property -' of 'MimeTextBinding' class and 'Name', 'Type', 'Pattern', -' 'IgnoreCase' properties of 'MimeTextMatch' class. -' It takes 'MimeText_Binding_Match_8_Input_vb.wsdl' as an -' input file which does not contain 'Binding' object that supports -' 'HttpPost'. A text pattern 'TITLE>(.*?)<' with text name -' as 'Title' and with type name set, is added to the wsdl file. Finally the -' modified ServiceDescription is written to 'MimeText_Binding_Match_8_Output_vb.wsdl'. - -' -Imports System.Web.Services.Description -Imports System.Collections -Imports System.Xml - -Class MyTextBinding - Public Shared Sub Main() - Try - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("MimeText_Binding_Match_8_Input_vb.wsdl") - - ' Create a Binding. - Dim myBinding As New Binding() - - ' Initialize the Name property of the Binding. - myBinding.Name = "MimeText_Binding_MatchServiceHttpPost" - Dim myXmlQualifiedName As _ - New XmlQualifiedName("s0:MimeText_Binding_MatchServiceHttpPost") - myBinding.Type = myXmlQualifiedName - - ' Create an HttpBinding. - Dim myHttpBinding As New HttpBinding() - myHttpBinding.Verb = "POST" - - ' Add the HttpBinding to the Binding. - myBinding.Extensions.Add(myHttpBinding) - - ' Create an OperationBinding. - Dim myOperationBinding As New OperationBinding() - myOperationBinding.Name = "AddNumbers" - - Dim myHttpOperationBinding As New HttpOperationBinding() - myHttpOperationBinding.Location = "/AddNumbers" - - ' Add the HttpOperationBinding to the OperationBinding. - myOperationBinding.Extensions.Add(myHttpOperationBinding) - - ' Create an InputBinding. - Dim myInputBinding As New InputBinding() - Dim postMimeContentbinding As New MimeContentBinding() - postMimeContentbinding.Type = "application/x-www-form-urlencoded" - myInputBinding.Extensions.Add(postMimeContentbinding) - - ' Add the InputBinding to the OperationBinding. - myOperationBinding.Input = myInputBinding -' -' -' -' -' -' -' - ' Create an OutputBinding. - Dim myOutputBinding As New OutputBinding() - - ' Create a MimeTextBinding. - Dim myMimeTextBinding As New MimeTextBinding() - - ' Create a MimeTextMatch. - Dim myMimeTextMatch As New MimeTextMatch() - Dim myMimeTextMatchCollection As MimeTextMatchCollection - - ' Initialize properties of the MimeTextMatch. - myMimeTextMatch.Name = "Title" - myMimeTextMatch.Type = "*/*" - myMimeTextMatch.Pattern = "'TITLE>(.*?)<" - myMimeTextMatch.IgnoreCase = True - - ' Initialize a MimeTextMatchCollection. - myMimeTextMatchCollection = myMimeTextBinding.Matches - - ' Add the MimeTextMatch to the MimeTextMatchCollection. - myMimeTextMatchCollection.Add(myMimeTextMatch) - myOutputBinding.Extensions.Add(myMimeTextBinding) - - ' Add the OutputBinding to the OperationBinding. - myOperationBinding.Output = myOutputBinding -' -' -' -' -' -' -' - ' Add the OutputBinding to the OperationBinding. - myOperationBinding.Output = myOutputBinding - - ' Add the OperationBinding to the Binding. - myBinding.Operations.Add(myOperationBinding) - - ' Add the Binding to the BindingCollection of the ServiceDescription. - myServiceDescription.Bindings.Add(myBinding) - - ' Write the ServiceDescription as a WSDL file. - myServiceDescription.Write("MimeText_Binding_Match_8_Output_vb.wsdl") - Console.WriteLine("WSDL file named " & _ - "'MimeText_Binding_Match_8_Output_vb.wsdl' was" & _ - " created successfully.") - Catch e As Exception - Console.WriteLine("Exception: {0}", e.Message) - End Try - End Sub -End Class -' diff --git a/snippets/visualbasic/System.Web.Services.Description/MimeTextMatch/Capture/MimeTextMatchService.VB.asmx b/snippets/visualbasic/System.Web.Services.Description/MimeTextMatch/Capture/MimeTextMatchService.VB.asmx deleted file mode 100644 index 490b6151069..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/MimeTextMatch/Capture/MimeTextMatchService.VB.asmx +++ /dev/null @@ -1,18 +0,0 @@ -<%@WebService Language="vb" Class="MimeText_Match_MatchCollService"%> - -Imports System -Imports System.Collections -Imports System.ComponentModel -Imports System.Data -Imports System.Diagnostics -Imports System.Web -Imports System.Web.Services - -Public Class MimeText_Match_MatchCollService - Inherits System.Web.Services.WebService - - _ - Public Function AddNumbers(firstNumber As Integer, secondNumber As Integer) As Integer - Return firstNumber + secondNumber - End Function 'AddNumbers -End Class 'MimeText_Match_MatchCollService diff --git a/snippets/visualbasic/System.Web.Services.Description/MimeTextMatch/Capture/MimeTextMatch_5_Input_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/MimeTextMatch/Capture/MimeTextMatch_5_Input_VB.wsdl deleted file mode 100644 index c72889a25e8..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/MimeTextMatch/Capture/MimeTextMatch_5_Input_VB.wsdl +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/MimeTextMatch/Capture/mimetextmatch_5.vb b/snippets/visualbasic/System.Web.Services.Description/MimeTextMatch/Capture/mimetextmatch_5.vb deleted file mode 100644 index e9e5cdfad20..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/MimeTextMatch/Capture/mimetextmatch_5.vb +++ /dev/null @@ -1,113 +0,0 @@ -' System.Web.Services.Description.MimeTextMatch -' System.Web.Services.Description.MimeTextMatch.Capture -' System.Web.Services.Description.MimeTextMatch.Group -' System.Web.Services.Description.MimeTextMatch.Repeats -' System.Web.Services.Description.MimeTextMatch.RepeatsString - -' The following program demostrates constructor, 'Capture', 'Group', -' 'Repeats' and 'RepeatsString' properties of 'MimeTextMatch'class. -' It takes 'MimeTextMatch_5_Input_VB.wsdl' as input which does not -' contain 'Binding' object supporting 'HttpPost'. A text pattern -' ''TITLE>(.*?)<' with text name as 'Title' and type -' name set which is to be searched in a HTTP transmission is added to the ServiceDescription. -' The modified ServiceDescription is written into 'MimeTextMatch_5_Output_VB.wsdl'. - -' -Imports System.Web.Services.Description -Imports System.Collections -Imports System.Xml - -Class MyMimeTextMatchClass - - Public Shared Sub Main() - Try - Dim myInt As Integer = 0 - Dim myServiceDescription As ServiceDescription = ServiceDescription.Read _ - ("MimeTextMatch_5_Input_VB.wsdl") - ' Create the 'Binding' object. - Dim myBinding As New Binding() - ' Initialize 'Name' property of 'Binding' class. - myBinding.Name = "MimeTextMatchServiceHttpPost" - Dim myXmlQualifiedName As New XmlQualifiedName("s0:MimeTextMatchServiceHttpPost") - myBinding.Type = myXmlQualifiedName - ' Create the 'HttpBinding' object. - Dim myHttpBinding As New HttpBinding() - myHttpBinding.Verb = "POST" - ' Add the 'HttpBinding' to the 'Binding'. - myBinding.Extensions.Add(myHttpBinding) - ' Create the 'OperationBinding' object. - Dim myOperationBinding As New OperationBinding() - myOperationBinding.Name = "AddNumbers" - Dim myHttpOperationBinding As New HttpOperationBinding() - myHttpOperationBinding.Location = "/AddNumbers" - ' Add the 'HttpOperationBinding' object to 'OperationBinding'. - myOperationBinding.Extensions.Add(myHttpOperationBinding) -' -' -' -' - ' Create an InputBinding. - Dim myInputBinding As New InputBinding() - Dim myMimeTextBinding As New MimeTextBinding() - Dim myMimeTextMatchCollection1 As New MimeTextMatchCollection() - Dim myMimeTextMatch(2) As MimeTextMatch - myMimeTextMatchCollection1 = myMimeTextBinding.Matches - - ' Intialize the MimeTextMatch. - For myInt = 0 To 2 - - ' Get a new MimeTextMatch. - myMimeTextMatch(myInt) = New MimeTextMatch() - - ' Assign values to properties of the MimeTextMatch. - myMimeTextMatch(myInt).Name = "Title" + Convert.ToString(myInt) - myMimeTextMatch(myInt).Type = "*/*" - myMimeTextMatch(myInt).Pattern = "TITLE>(.*?)<" - myMimeTextMatch(myInt).IgnoreCase = True - myMimeTextMatch(myInt).Capture = 2 - myMimeTextMatch(myInt).Group = 2 - If myInt <> 0 Then - - ' Assign the Repeats property if the index is not 0. - myMimeTextMatch(myInt).Repeats = 2 - Else - - ' Assign the RepeatsString property if the index is 0. - myMimeTextMatch(myInt).RepeatsString = "4" - End If - - ' Add 'MimeTextMatch' instance to collection. - myMimeTextMatchCollection1.Add(myMimeTextMatch(myInt)) - Next myInt -' -' -' -' - myInputBinding.Extensions.Add(myMimeTextBinding) - ' Add the 'InputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInputBinding - ' Create the 'OutputBinding' instance. - Dim myOutput As New OutputBinding() - Dim postMimeXmlbinding As New MimeXmlBinding() - ' Initialize 'Part' property of 'MimeXmlBinding' class. - postMimeXmlbinding.Part = "Body" - ' Add 'MimeXmlBinding' instance to 'OutputBinding' instance. - myOutput.Extensions.Add(postMimeXmlbinding) - ' Add the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding.Output = myOutput - ' Add the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding.Output = myOutput - ' Add the 'OperationBinding' to 'Binding'. - myBinding.Operations.Add(myOperationBinding) - ' Add the 'Binding' to 'BindingCollection' of 'ServiceDescription'. - myServiceDescription.Bindings.Add(myBinding) - ' Write the 'ServiceDescription' as a WSDL file. - myServiceDescription.Write("MimeTextMatch_5_Output_VB.wsdl") - Console.WriteLine("WSDL file with name 'MimeTextMatch_5_Output_VB.wsdl' is" + _ - " created successfully.") - Catch e As Exception - Console.WriteLine("Exception: {0}", e.Message) - End Try - End Sub -End Class -' diff --git a/snippets/visualbasic/System.Web.Services.Description/MimeTextMatchCollection/Overview/MimeText_Match_MatchCollService.vb.asmx b/snippets/visualbasic/System.Web.Services.Description/MimeTextMatchCollection/Overview/MimeText_Match_MatchCollService.vb.asmx deleted file mode 100644 index 25c57b6a320..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/MimeTextMatchCollection/Overview/MimeText_Match_MatchCollService.vb.asmx +++ /dev/null @@ -1,18 +0,0 @@ -<%@ WebService Language="VB" Class="MimeText_Match_MatchCollService"%> - -Imports System -Imports System.Collections -Imports System.ComponentModel -Imports System.Data -Imports System.Diagnostics -Imports System.Web -Imports System.Web.Services - -Public Class MimeText_Match_MatchCollService - Inherits System.Web.Services.WebService - _ - Public Function AddNumbers(firstNumber As Integer, _ - secondNumber As Integer) As Integer - Return firstNumber + secondNumber - End Function 'AddNumbers -End Class 'MimeText_Match_MatchCollService \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/MimeTextMatchCollection/Overview/MimeText_Match_MatchColl_9_Input_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/MimeTextMatchCollection/Overview/MimeText_Match_MatchColl_9_Input_vb.wsdl deleted file mode 100644 index 922377f2f16..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/MimeTextMatchCollection/Overview/MimeText_Match_MatchColl_9_Input_vb.wsdl +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/MimeTextMatchCollection/Overview/mimetext_match_matchcoll_9.vb b/snippets/visualbasic/System.Web.Services.Description/MimeTextMatchCollection/Overview/mimetext_match_matchcoll_9.vb deleted file mode 100644 index 58bd37fa252..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/MimeTextMatchCollection/Overview/mimetext_match_matchcoll_9.vb +++ /dev/null @@ -1,146 +0,0 @@ -' System.Web.Services.Description.MimeTextMatchCollection -' System.Web.Services.Description.MimeTextMatchCollection() -' System.Web.Services.Description.MimeTextMatchCollection.Contains -' System.Web.Services.Description.MimeTextMatchCollection.Add -' System.Web.Services.Description.MimeTextMatchCollection.CopyTo -' System.Web.Services.Description.MimeTextMatchCollection.Remove -' System.Web.Services.Description.MimeTextMatchCollection.Item -' System.Web.Services.Description.MimeTextMatchCollection.IndexOf -' System.Web.Services.Description.MimeTextMatchCollection.Insert - -' This program demostrates constructor, Contains, Add, Item, -' IndexOf, Insert and Remove property of 'MimeTextMatchCollection'. -' This program takes 'MimeText_Match_MatchColl_9_Input_vb.wsdl' as an -' input file which does not contain 'Binding' object that supports -' 'HttpPost'. A name, type, Group and Capture properties are set -' which are to be searched in a HTTP transmission and -' 'MimeTextMatchCollection' collection object is created -' for input and output of 'HttpPost' and finally writes into -' 'MimeText_Match_MatchColl_9_Output_vb.wsdl'. - -Imports System.Web.Services.Description -Imports System.Collections -Imports System.Xml - -Class MyMimeTextMatchCollection - Public Shared Sub Main() - Try - Dim myInt As Integer = 0 - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("MimeText_Match_MatchColl_9_Input_vb.wsdl") - ' Create the 'Binding' object. - Dim myBinding As New Binding() - ' Initialize 'Name' property of 'Binding' class. - myBinding.Name = "MimeText_Match_MatchCollServiceHttpPost" - Dim myXmlQualifiedName As _ - New XmlQualifiedName("s0:MimeText_Match_MatchCollServiceHttpPost") - myBinding.Type = myXmlQualifiedName - ' Create the 'HttpBinding' object. - Dim myHttpBinding As New HttpBinding() - myHttpBinding.Verb = "POST" - ' Add the 'HttpBinding' to the 'Binding'. - myBinding.Extensions.Add(myHttpBinding) - ' Create the 'OperationBinding' object. - Dim myOperationBinding As New OperationBinding() - myOperationBinding.Name = "AddNumbers" - Dim myHttpOperationBinding As New HttpOperationBinding() - myHttpOperationBinding.Location = "/AddNumbers" - ' Add the 'HttpOperationBinding' to 'OperationBinding'. - myOperationBinding.Extensions.Add(myHttpOperationBinding) -' - ' Create the 'InputBinding' object. - Dim myInputBinding As New InputBinding() - Dim myMimeTextBinding As New MimeTextBinding() - Dim myMimeTextMatchCollection As MimeTextMatchCollection -' -' -' - ' Get an array instance of 'MimeTextMatch' class. - Dim myMimeTextMatch(3) As MimeTextMatch - myMimeTextMatchCollection = myMimeTextBinding.Matches - ' Initialize properties of 'MimeTextMatch' class. - For myInt = 0 To 3 - ' Create the 'MimeTextMatch' instance. - myMimeTextMatch(myInt) = New MimeTextMatch() - myMimeTextMatch(myInt).Name = "Title" - myMimeTextMatch(myInt).Type = "*/*" - myMimeTextMatch(myInt).IgnoreCase = True - - If True = myMimeTextMatchCollection.Contains(myMimeTextMatch(0)) Then - myMimeTextMatch(myInt).Name = "Title" + Convert.ToString(myInt) - myMimeTextMatch(myInt).Capture = 2 - myMimeTextMatch(myInt).Group = 2 - myMimeTextMatchCollection.Add(myMimeTextMatch(myInt)) - Else - myMimeTextMatchCollection.Add(myMimeTextMatch(myInt)) - myMimeTextMatchCollection(myInt).RepeatsString = "2" - End If - Next myInt - myMimeTextMatchCollection = myMimeTextBinding.Matches - ' Copy collection to 'MimeTextMatch' array instance. - myMimeTextMatchCollection.CopyTo(myMimeTextMatch, 0) -' -' -' - myInputBinding.Extensions.Add(myMimeTextBinding) - ' Add the 'InputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInputBinding - - ' Create the 'OutputBinding' instance. - Dim myOutputBinding As New OutputBinding() - ' Create the 'MimeTextBinding' instance. - Dim myMimeTextBinding1 As New MimeTextBinding() -' -' -' -' -' - ' Get an instance of 'MimeTextMatchCollection'. - Dim myMimeTextMatchCollection1 As New MimeTextMatchCollection() - Dim myMimeTextMatch1(4) As MimeTextMatch - myMimeTextMatchCollection1 = myMimeTextBinding1.Matches - For myInt = 0 To 3 - myMimeTextMatch1(myInt) = New MimeTextMatch() - myMimeTextMatch1(myInt).Name = "Title" + Convert.ToString(myInt) - If myInt <> 0 Then - myMimeTextMatch1(myInt).RepeatsString = "7" - End If - myMimeTextMatchCollection1.Add(myMimeTextMatch1(myInt)) - Next myInt - myMimeTextMatch1(4) = New MimeTextMatch() - ' Remove 'MimeTextMatch' instance from collection. - myMimeTextMatchCollection1.Remove(myMimeTextMatch1(1)) - ' Using MimeTextMatchCollection.Item indexer to comapre. - If myMimeTextMatch1(2) Is myMimeTextMatchCollection1(1) Then - ' Check whether 'MimeTextMatch' instance exists. - myInt = myMimeTextMatchCollection1.IndexOf(myMimeTextMatch1(2)) - ' Insert 'MimeTextMatch' instance at a desired position. - myMimeTextMatchCollection1.Insert(1, myMimeTextMatch1(myInt)) - myMimeTextMatchCollection1(1).RepeatsString = "5" - myMimeTextMatchCollection1.Insert(4, myMimeTextMatch1(myInt)) - End If -' -' -' -' -' -' - myOutputBinding.Extensions.Add(myMimeTextBinding1) - ' Add the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding.Output = myOutputBinding - ' Add the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding.Output = myOutputBinding - ' Add the 'OperationBinding' to 'Binding'. - myBinding.Operations.Add(myOperationBinding) - ' Add the 'Binding' to 'BindingCollection' of 'ServiceDescription'. - myServiceDescription.Bindings.Add(myBinding) - ' Write the 'ServiceDescription' as a WSDL file. - myServiceDescription.Write("MimeText_Match_MatchColl_9_Output_vb.wsdl") - Console.WriteLine("WSDL file with name " + _ - "'MimeText_Match_MatchColl_9_Output_vb.wsdl' is" + _ - " created successfully.") - Catch e As Exception - Console.WriteLine("Exception: {0}", e.Message) - End Try - End Sub -End Class \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/MimeXmlBinding/Overview/MimeXmlBinding_Part_3_Input_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/MimeXmlBinding/Overview/MimeXmlBinding_Part_3_Input_VB.wsdl deleted file mode 100644 index f8e95c1c4e8..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/MimeXmlBinding/Overview/MimeXmlBinding_Part_3_Input_VB.wsdl +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/MimeXmlBinding/Overview/MimeXmlBinding_Part_3_Service.vb.asmx b/snippets/visualbasic/System.Web.Services.Description/MimeXmlBinding/Overview/MimeXmlBinding_Part_3_Service.vb.asmx deleted file mode 100644 index e4bdfc0204e..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/MimeXmlBinding/Overview/MimeXmlBinding_Part_3_Service.vb.asmx +++ /dev/null @@ -1,18 +0,0 @@ -<%@WebService Language="vb" Class="MimeXmlBinding_Part_3_Service"%> - -Imports System -Imports System.Collections -Imports System.ComponentModel -Imports System.Data -Imports System.Diagnostics -Imports System.Web -Imports System.Web.Services - -Public Class MimeXmlBinding_Part_3_Service - Inherits System.Web.Services.WebService - - _ - Public Function AddNumbers(firstNumber As Integer, secondNumber As Integer) As Integer - Return firstNumber + secondNumber - End Function 'AddNumbers -End Class 'MimeXmlBinding_Part_3_Service diff --git a/snippets/visualbasic/System.Web.Services.Description/MimeXmlBinding/Overview/mimexmlbinding_part_3.vb b/snippets/visualbasic/System.Web.Services.Description/MimeXmlBinding/Overview/mimexmlbinding_part_3.vb deleted file mode 100644 index 10d3547b105..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/MimeXmlBinding/Overview/mimexmlbinding_part_3.vb +++ /dev/null @@ -1,75 +0,0 @@ -' System.Web.Services.Description.MimeXmlBinding -' System.Web.Services.Description.MimeXmlBinding.MimeXmlBinding() -' System.Web.Services.Description.MimeXmlBinding.Part - -' The following program demonstrates constructor and 'Part'property -' of 'MimeXmlBinding' class. This program takes 'MimeXmlBinding_Part_3_Input_VB.wsdl' -' as input, which does not contain 'Binding' object that supports 'HttpPost'. -' It sets message part property to 'Body' on which 'MimeXmlBinding' is -' applied and finally writes into 'MimeXmlBinding_Part_3_Output_VB.wsdl'. - -' -Imports System.Web.Services.Description -Imports System.Collections -Imports System.Xml - -Class MyXmlBinding - - Public Shared Sub Main() - Try - Dim myDescription As ServiceDescription = ServiceDescription.Read _ - ("MimeXmlBinding_Part_3_Input_VB.wsdl") - ' Create the 'Binding' object. - Dim myBinding As New Binding() - ' Initialize 'Name' property of 'Binding' class. - myBinding.Name = "MimeXmlBinding_Part_3_ServiceHttpPost" - Dim myXmlQualifiedName As New XmlQualifiedName("s0:MimeXmlBinding_Part_3_ServiceHttpPost") - myBinding.Type = myXmlQualifiedName - ' Create the 'HttpBinding' object. - Dim myHttpBinding As New HttpBinding() - myHttpBinding.Verb = "POST" - ' Add the 'HttpBinding' to the 'Binding'. - myBinding.Extensions.Add(myHttpBinding) - ' Create the 'OperationBinding' object. - Dim myOperationBinding As New OperationBinding() - myOperationBinding.Name = "AddNumbers" - Dim myHttpOperationBinding As New HttpOperationBinding() - myHttpOperationBinding.Location = "/AddNumbers" - ' Add the 'HttpOperationBinding' to 'OperationBinding'. - myOperationBinding.Extensions.Add(myHttpOperationBinding) - ' Create the 'InputBinding' object. - Dim myInputBinding As New InputBinding() - Dim myMimeContentBinding As New MimeContentBinding() - myMimeContentBinding.Type = "application/x-www-form-urlencoded" - myInputBinding.Extensions.Add(myMimeContentBinding) - ' Add the 'InputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInputBinding -' -' - ' Create an OutputBinding. - Dim myOutputBinding As New OutputBinding() - Dim myMimeXmlBinding As New MimeXmlBinding() - - ' Initialize the Part property of the MimeXmlBinding. - myMimeXmlBinding.Part = "Body" - - ' Add the MimeXmlBinding to the OutputBinding. - myOutputBinding.Extensions.Add(myMimeXmlBinding) -' -' - ' Add the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding.Output = myOutputBinding - ' Add the 'OperationBinding' to 'Binding'. - myBinding.Operations.Add(myOperationBinding) - ' Add the 'Binding' to 'BindingCollection' of 'ServiceDescription'. - myDescription.Bindings.Add(myBinding) - ' Write the 'ServiceDescription' as a WSDL file. - myDescription.Write("MimeXmlBinding_Part_3_Output_VB.wsdl") - Console.WriteLine("WSDL file with name 'MimeXmlBinding_Part_3_Output_VB.wsdl' is" + _ - " created successfully.") - Catch e As Exception - Console.WriteLine("Exception: {0}", e.Message) - End Try - End Sub -End Class -' diff --git a/snippets/visualbasic/System.Web.Services.Description/Operation/Faults/Operation_Faults_Input_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/Operation/Faults/Operation_Faults_Input_VB.wsdl deleted file mode 100644 index 6cef360e898..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/Operation/Faults/Operation_Faults_Input_VB.wsdl +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/Operation/Faults/operation_faults.vb b/snippets/visualbasic/System.Web.Services.Description/Operation/Faults/operation_faults.vb deleted file mode 100644 index df53a1c53d9..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/Operation/Faults/operation_faults.vb +++ /dev/null @@ -1,45 +0,0 @@ -' System.Web.Services.Description.Operation.Faults - -' The following program demonstrates the 'Faults' property of 'Operation' -' class. It reads from a 'Operation_Faults_Input_VB.wsdl' file removes fault -' binding and operation fault with the name 'ErrorString'. The modified -' ServiceDescriptor is written to 'Operation_Faults_Output_VB.wsdl' file. - -Imports System.Web.Services.Description - -Public Class MyOperationClass - - Public Shared Sub Main() -' - ' Read the 'Operation_Faults_Input_VB.wsdl' file as input. - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("Operation_Faults_Input_VB.wsdl") - - ' Get the operation fault collection. - Dim myPortTypeCollection As PortTypeCollection = myServiceDescription.PortTypes - Dim myPortType As PortType = myPortTypeCollection(0) - Dim myOperationCollection As OperationCollection = myPortType.Operations - - ' Remove the operation fault with the name 'ErrorString'. - Dim myOperation As Operation = myOperationCollection(0) - Dim myOperationFaultCollection As OperationFaultCollection = myOperation.Faults - If myOperationFaultCollection.Contains(myOperationFaultCollection("ErrorString")) Then - myOperationFaultCollection.Remove(myOperationFaultCollection("ErrorString")) - End If -' - - ' Get the fault binding collection. - Dim myBindingCollection As BindingCollection = myServiceDescription.Bindings - Dim myBinding As Binding = myBindingCollection(0) - Dim myOperationBindingCollection As OperationBindingCollection = myBinding.Operations - ' Remove the fault binding with the name 'ErrorString'. - Dim myOperationBinding As OperationBinding = myOperationBindingCollection(0) - Dim myFaultBindingCollection As FaultBindingCollection = myOperationBinding.Faults - If myFaultBindingCollection.Contains(myFaultBindingCollection("ErrorString")) Then - myFaultBindingCollection.Remove(myFaultBindingCollection("ErrorString")) - End If - myServiceDescription.Write("Operation_Faults_Output_VB.wsdl") - Console.WriteLine _ - ("WSDL file with name 'Operation_Faults_Output_VB.wsdl' file created Successfully") - End Sub -End Class \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/Operation/IsBoundBy/Operation_IsBoundBy_Input_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/Operation/IsBoundBy/Operation_IsBoundBy_Input_VB.wsdl deleted file mode 100644 index 77958f40ba6..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/Operation/IsBoundBy/Operation_IsBoundBy_Input_VB.wsdl +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/Operation/IsBoundBy/Operation_IsBoundBy_Service.vb.asmx b/snippets/visualbasic/System.Web.Services.Description/Operation/IsBoundBy/Operation_IsBoundBy_Service.vb.asmx deleted file mode 100644 index 1fbffcb305a..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/Operation/IsBoundBy/Operation_IsBoundBy_Service.vb.asmx +++ /dev/null @@ -1,17 +0,0 @@ -<%@WebService Language="VB" Class="MyOperationIsBoundByService"%> - -Imports System -Imports System.Collections -Imports System.ComponentModel -Imports System.Data -Imports System.Diagnostics -Imports System.Web -Imports System.Web.Services - -Public Class MyOperationIsBoundByService - Inherits System.Web.Services.WebService - _ - Public Function AddNumbers(firstNumber As Integer, secondNumber As Integer) As Integer - Return firstNumber + secondNumber - End Function 'AddNumbers -End Class 'MyOperationIsBoundByService diff --git a/snippets/visualbasic/System.Web.Services.Description/Operation/IsBoundBy/operation_isboundby.vb b/snippets/visualbasic/System.Web.Services.Description/Operation/IsBoundBy/operation_isboundby.vb deleted file mode 100644 index 40f7797e372..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/Operation/IsBoundBy/operation_isboundby.vb +++ /dev/null @@ -1,87 +0,0 @@ -' System.Web.Services.Description.Operation.IsBoundBy - -' The following program demonstrates the 'IsBoundBy' method of -' 'Operation' class. It takes "Operation_IsBoundBy_Input_VB.wsdl" -' as input which does not contain 'PortType' and 'Binding' objects -' supporting 'HttpPost'. It then adds those objects and writes into -' 'Operation_IsBoundBy_Output_VB.wsdl'. - -Imports System.Web.Services.Description -Imports System.Collections -Imports System.Xml - -Class MyOperationClass - - Public Shared Sub Main() - Dim myServiceDescription As ServiceDescription = ServiceDescription.Read _ - ("Operation_IsBoundBy_Input_VB.wsdl") - ' Create the 'Binding' object. - Dim myBinding As New Binding() - myBinding.Name = "MyOperationIsBoundByServiceHttpPost" - Dim myXmlQualifiedName As New XmlQualifiedName("s0:OperationServiceHttpPost") - myBinding.Type = myXmlQualifiedName - ' Create the 'HttpBinding' object. - Dim myHttpBinding As New HttpBinding() - myHttpBinding.Verb = "POST" - ' Add the 'HttpBinding' to the 'Binding'. - myBinding.Extensions.Add(myHttpBinding) - ' Create the 'OperationBinding' object. - Dim myOperationBinding As New OperationBinding() - myOperationBinding.Name = "AddNumbers" - - Dim myHttpOperationBinding As New HttpOperationBinding() - myHttpOperationBinding.Location = "/AddNumbers" - ' Add the 'HttpOperationBinding' to 'OperationBinding'. - myOperationBinding.Extensions.Add(myHttpOperationBinding) - - ' Create the 'InputBinding' object. - Dim myInputBinding As New InputBinding() - Dim myPostMimeContentBinding As New MimeContentBinding() - myPostMimeContentBinding.Type = "application/x-www-form-urlencoded" - myInputBinding.Extensions.Add(myPostMimeContentBinding) - ' Add the 'InputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInputBinding - ' Create the 'OutputBinding' object. - Dim myOutputBinding As New OutputBinding() - Dim myPostMimeXmlBinding As New MimeXmlBinding() - myPostMimeXmlBinding.Part = "Body" - myOutputBinding.Extensions.Add(myPostMimeXmlBinding) - - ' Add the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding.Output = myOutputBinding - - ' Add the 'OperationBinding' to 'Binding'. - myBinding.Operations.Add(myOperationBinding) - - ' Add the 'Binding' to 'BindingCollection' of 'ServiceDescription'. - myServiceDescription.Bindings.Add(myBinding) - - ' Create a 'PortType' object. - Dim myPostPortType As New PortType() - myPostPortType.Name = "OperationServiceHttpPost" -' - Dim myPostOperation As New Operation() - myPostOperation.Name = myOperationBinding.Name - Console.WriteLine("'Operation' instance uses 'OperationBinding': " + _ - myPostOperation.IsBoundBy(myOperationBinding).ToString()) -' - Dim myOperationMessage As OperationMessage = CType(New OperationInput(), OperationMessage) - myOperationMessage.Message = New XmlQualifiedName("s0:AddNumbersHttpPostIn") - Dim myOperationMessage1 As OperationMessage = CType(New OperationOutput(), OperationMessage) - myOperationMessage1.Message = New XmlQualifiedName("s0:AddNumbersHttpPostOut") - - myPostOperation.Messages.Add(myOperationMessage) - myPostOperation.Messages.Add(myOperationMessage1) - - ' Add the 'Operation' to 'PortType'. - myPostPortType.Operations.Add(myPostOperation) - - ' Adds the 'PortType' to 'PortTypeCollection' of 'ServiceDescription'. - myServiceDescription.PortTypes.Add(myPostPortType) - - ' Write the 'ServiceDescription' as a WSDL file. - myServiceDescription.Write("Operation_IsBoundBy_Output_VB.wsdl") - Console.WriteLine("WSDL file with name 'Operation_IsBoundBy_Output_VB.wsdl' " + _ - "created Successfully") - End Sub -End Class \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/Operation/Overview/Operation_5_Input_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/Operation/Overview/Operation_5_Input_VB.wsdl deleted file mode 100644 index eacad5362c0..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/Operation/Overview/Operation_5_Input_VB.wsdl +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/Operation/Overview/Operation_5_Service.vb.asmx b/snippets/visualbasic/System.Web.Services.Description/Operation/Overview/Operation_5_Service.vb.asmx deleted file mode 100644 index d9c7ab314e3..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/Operation/Overview/Operation_5_Service.vb.asmx +++ /dev/null @@ -1,18 +0,0 @@ -<%@WebService Language="VB" Class="OperationService"%> - -Imports System -Imports System.Collections -Imports System.ComponentModel -Imports System.Data -Imports System.Diagnostics -Imports System.Web -Imports System.Web.Services - -Public Class OperationService - Inherits System.Web.Services.WebService - - _ - Public Function AddNumbers(firstNumber As Integer, secondNumber As Integer) As Integer - Return firstNumber + secondNumber - End Function 'AddNumbers -End Class 'OperationService diff --git a/snippets/visualbasic/System.Web.Services.Description/Operation/Overview/operation_5.vb b/snippets/visualbasic/System.Web.Services.Description/Operation/Overview/operation_5.vb deleted file mode 100644 index 8b17455fb7c..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/Operation/Overview/operation_5.vb +++ /dev/null @@ -1,68 +0,0 @@ -' System.Web.Services.Description.Operation -' System.Web.Services.Description.Operation.Operation -' System.Web.Services.Description.Operation.Messages -' System.Web.Services.Description.Operation.Name -' System.Web.Services.Description.Operation.PortType - -' The following program demonstrates 'Operation' class, its contructor -' and 'Messages','Name' and 'PortType' properties. It reads the file -' 'Operation_5_Input_VB.wsdl' which does not have 'PortType' object that -' supports 'HttpPost'. It adds a 'PortType' object that supports 'HttpPost' -' protocol and writes into 'Operation_5_Output_VB.wsdl'. - -' -Imports System.Web.Services.Description -Imports System.Collections -Imports System.Xml - -Class MyOperationClass - - Public Shared Sub Main() - Dim myDescription As ServiceDescription = ServiceDescription.Read("Operation_5_Input_VB.wsdl") - ' Create a 'PortType' object. - Dim myPortType As New PortType() - myPortType.Name = "OperationServiceHttpPost" - Dim myOperation As Operation = CreateOperation("AddNumbers", "s0:AddNumbersHttpPostIn", _ - "s0:AddNumbersHttpPostOut") - myPortType.Operations.Add(myOperation) -' - ' Get the PortType of the Operation. - Dim myPort As PortType = myOperation.PortType - Console.WriteLine( _ - "The port type of the operation is: " & myPort.Name) -' - ' Add the 'PortType's to 'PortTypeCollection' of 'ServiceDescription'. - myDescription.PortTypes.Add(myPortType) - - ' Write the 'ServiceDescription' as a WSDL file. - myDescription.Write("Operation_5_Output_VB.wsdl") - Console.WriteLine("WSDL file with name 'Operation_5_Output_VB.wsdl'" + _ - "file created Successfully") - End Sub - - Public Shared Function CreateOperation(myOperationName As String, myInputMesg As String, _ - myOutputMesg As String) As Operation -' -' -' - ' Create an Operation. - Dim myOperation As New Operation() - myOperation.Name = myOperationName - Dim myInput As OperationMessage = _ - CType(New OperationInput(), OperationMessage) - myInput.Message = New XmlQualifiedName(myInputMesg) - Dim myOutput As OperationMessage = _ - CType(New OperationOutput(), OperationMessage) - myOutput.Message = New XmlQualifiedName(myOutputMesg) - - ' Add messages to the OperationMessageCollection. - myOperation.Messages.Add(myInput) - myOperation.Messages.Add(myOutput) - Console.WriteLine("Operation name is: " & myOperation.Name) -' -' -' - Return myOperation - End Function 'CreateOperation -End Class -' diff --git a/snippets/visualbasic/System.Web.Services.Description/Operation/ParameterOrder/Operation_2_Input_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/Operation/ParameterOrder/Operation_2_Input_VB.wsdl deleted file mode 100644 index 121f06222bd..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/Operation/ParameterOrder/Operation_2_Input_VB.wsdl +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/Operation/ParameterOrder/Operation_2_Service.vb.asmx b/snippets/visualbasic/System.Web.Services.Description/Operation/ParameterOrder/Operation_2_Service.vb.asmx deleted file mode 100644 index b0ee482d4fb..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/Operation/ParameterOrder/Operation_2_Service.vb.asmx +++ /dev/null @@ -1,17 +0,0 @@ -<%@ WebService Language="VB" Class="Operation_2_Service" %> -Imports System -Imports System.Collections -Imports System.ComponentModel -Imports System.Data -Imports System.Diagnostics -Imports System.Web -Imports System.Web.Services - -Public Class Operation_2_Service - Inherits System.Web.Services.WebService - - _ - Public Function AddNumbers(firstNumber As Integer, secondNumber As Integer) As Integer - Return firstNumber + secondNumber - End Function 'AddNumbers -End Class 'Operation_2_Service \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/Operation/ParameterOrder/operation_2.vb b/snippets/visualbasic/System.Web.Services.Description/Operation/ParameterOrder/operation_2.vb deleted file mode 100644 index 48ddbbd04f4..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/Operation/ParameterOrder/operation_2.vb +++ /dev/null @@ -1,137 +0,0 @@ -' System.Web.Services.Description Operation.ParameterOrderString -' System.Web.Services.Description Operation.ParameterOrder - -' The following program demonstrates the 'ParameterOrderString' and -' 'ParameterOrder' properties of 'Operation' class. It collects the -' message part names from the input WSDL file and sets to the -' 'ParameterOrderString'. It then displays the same using 'ParameterOrder' -' property. - -Imports System.Web.Services.Description -Imports System.Collections -Imports System.Xml - -Class MyOperationClass - - Public Shared Sub Main() - Try - Dim myDescription As ServiceDescription = _ - ServiceDescription.Read("Operation_2_Input_VB.wsdl") - Dim myBinding As New Binding() - myBinding.Name = "Operation_2_ServiceHttpPost" - Dim myQualifiedName As New XmlQualifiedName("s0:Operation_2_ServiceHttpPost") - myBinding.Type = myQualifiedName - Dim myHttpBinding As New HttpBinding() - myHttpBinding.Verb = "POST" - ' Add the 'HttpBinding' to the 'Binding'. - myBinding.Extensions.Add(myHttpBinding) - Dim myOperationBinding As New OperationBinding() - myOperationBinding.Name = "AddNumbers" - Dim myHttpOperationBinding As New HttpOperationBinding() - myHttpOperationBinding.Location = "/AddNumbers" - ' Add the 'HttpOperationBinding' to 'OperationBinding'. - myOperationBinding.Extensions.Add(myHttpOperationBinding) - Dim myInputBinding As New InputBinding() - Dim myPostMimeContentbinding As New MimeContentBinding() - myPostMimeContentbinding.Type = "application/x-www-form-urlencoded" - myInputBinding.Extensions.Add(myPostMimeContentbinding) - ' Add the 'InputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInputBinding - Dim myOutputBinding As New OutputBinding() - Dim myPostMimeXmlbinding As New MimeXmlBinding() - myPostMimeXmlbinding.Part = "Body" - myOutputBinding.Extensions.Add(myPostMimeXmlbinding) - ' Add the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding.Output = myOutputBinding - ' Add the 'OperationBinding' to 'Binding'. - myBinding.Operations.Add(myOperationBinding) - ' Add the 'Binding' to 'BindingCollection' of 'ServiceDescription'. - myDescription.Bindings.Add(myBinding) - Dim myPostPort As New Port() - myPostPort.Name = "Operation_2_ServiceHttpPost" - myPostPort.Binding = New XmlQualifiedName("s0:Operation_2_ServiceHttpPost") - Dim myPostAddressBinding As New HttpAddressBinding() - myPostAddressBinding.Location = "http://localhost/Operation_2/Operation_2_Service.vb.asmx" - ' Add the 'HttpAddressBinding' to the 'Port'. - myPostPort.Extensions.Add(myPostAddressBinding) - ' Add the 'Port' to 'PortCollection' of 'ServiceDescription'. - myDescription.Services(0).Ports.Add(myPostPort) - Dim myPostPortType As New PortType() - myPostPortType.Name = "Operation_2_ServiceHttpPost" - Dim myPostOperation As New Operation() - myPostOperation.Name = "AddNumbers" - Dim myPostOperationInput As OperationMessage = _ - CType(New OperationInput(), OperationMessage) - myPostOperationInput.Message = New XmlQualifiedName("s0:AddNumbersHttpPostIn") - Dim myPostOperationOutput As OperationMessage = _ - CType(New OperationOutput(), OperationMessage) - myPostOperationOutput.Message = New XmlQualifiedName("s0:AddNumbersHttpPostout") - myPostOperation.Messages.Add(myPostOperationInput) - myPostOperation.Messages.Add(myPostOperationOutput) - ' Add the 'Operation' to 'PortType'. - myPostPortType.Operations.Add(myPostOperation) - ' Adds the 'PortType' to 'PortTypeCollection' of 'ServiceDescription'. - myDescription.PortTypes.Add(myPostPortType) - Dim myPostMessage1 As New Message() - myPostMessage1.Name = "AddNumbersHttpPostIn" - Dim myPostMessagePart1 As New MessagePart() - myPostMessagePart1.Name = "firstnumber" - myPostMessagePart1.Type = New XmlQualifiedName("s:string") - Dim myPostMessagePart2 As New MessagePart() - myPostMessagePart2.Name = "secondnumber" - myPostMessagePart2.Type = New XmlQualifiedName("s:string") - ' Add the 'MessagePart' objects to 'Messages'. - myPostMessage1.Parts.Add(myPostMessagePart1) - myPostMessage1.Parts.Add(myPostMessagePart2) - Dim myPostMessage2 As New Message() - myPostMessage2.Name = "AddNumbersHttpPostout" - Dim myPostMessagePart3 As New MessagePart() - myPostMessagePart3.Name = "Body" - myPostMessagePart3.Element = New XmlQualifiedName("s0:int") - ' Add the 'MessagePart' to 'Message'. - myPostMessage2.Parts.Add(myPostMessagePart3) - ' Add the 'Message' objects to 'ServiceDescription'. - myDescription.Messages.Add(myPostMessage1) - myDescription.Messages.Add(myPostMessage2) - ' Write the 'ServiceDescription' as a WSDL file. - myDescription.Write("Operation_2_Output_VB.wsdl") - Console.WriteLine(" 'Operation_2_Output_VB.wsdl' file created Successfully") -' -' - Dim myString As String = Nothing - Dim myOperation As New Operation() - myDescription = ServiceDescription.Read("Operation_2_Input_VB.wsdl") - Dim myMessage(myDescription.Messages.Count) As Message - - ' Copy the messages from the service description. - myDescription.Messages.CopyTo(myMessage, 0) - Dim i As Integer - For i = 0 To myDescription.Messages.Count - 1 - Dim myMessagePart(myMessage(i).Parts.Count) As MessagePart - - ' Copy the message parts into a MessagePart. - myMessage(i).Parts.CopyTo(myMessagePart, 0) - Dim j As Integer - For j = 0 To (myMessage(i).Parts.Count) - 1 - myString += myMessagePart(j).Name - myString += " " - Next j - Next i - - ' Set the ParameterOrderString equal to the list of - ' message part names. - myOperation.ParameterOrderString = myString - Dim myString1 As String() = myOperation.ParameterOrder - Dim k As Integer = 0 - Console.WriteLine("The list of message part names is as follows:") - While k < 5 - Console.WriteLine(myString1(k)) - k += 1 - End While -' -' - Catch e As Exception - Console.WriteLine("The following Exception is raised : " + e.Message) - End Try - End Sub -End Class diff --git a/snippets/visualbasic/System.Web.Services.Description/OperationBinding/Overview/MathService_input_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/OperationBinding/Overview/MathService_input_vb.wsdl deleted file mode 100644 index 766bfb3e6e6..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/OperationBinding/Overview/MathService_input_vb.wsdl +++ /dev/null @@ -1,312 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/OperationBinding/Overview/MathService_vb.asmx b/snippets/visualbasic/System.Web.Services.Description/OperationBinding/Overview/MathService_vb.asmx deleted file mode 100644 index 221f9c0c472..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/OperationBinding/Overview/MathService_vb.asmx +++ /dev/null @@ -1,31 +0,0 @@ -<%@ WebService Language="VB" Class="MathService" %> - -Imports System -Imports System.Web.Services - -Public Class MathService - Inherits WebService - - _ - Public Function Add(a As Single, b As Single) As Single - Return a + b - End Function 'Add - - _ - Public Function Subtract(a As Single, b As Single) As Single - Return a - b - End Function 'Subtract - - _ - Public Function Multiply(a As Single, b As Single) As Single - Return a * b - End Function 'Multiply - - _ - Public Function Divide(a As Single, b As Single) As Single - If b = 0 Then - Return - 1 - End If - Return a / b - End Function 'Divide -End Class 'MathService \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/OperationBinding/Overview/operationbinding_operationbinding.vb b/snippets/visualbasic/System.Web.Services.Description/OperationBinding/Overview/operationbinding_operationbinding.vb deleted file mode 100644 index a8527382ab5..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/OperationBinding/Overview/operationbinding_operationbinding.vb +++ /dev/null @@ -1,127 +0,0 @@ -' System.Web.Services.Description.OperationBinding -' System.Web.Services.Description.OperationBinding.OperationBinding -' System.Web.Services.Description.OperationBinding.Name -' System.Web.Services.Description.OperationBinding.Input -' System.Web.Services.Description.OperationBinding.Output -' System.Web.Services.Description.OperationBinding.Extensions -' System.Web.Services.Description.OperationBinding.Faults -' System.Web.Services.Description.OperationBinding.Binding - - -' The following example demonstrates the usage of the 'OperationBinding' -' class, the 'OperationBinding()' constructor, and various properties of the class. The -' input to the program is a WSDL file 'MathService_input_cs.wsdl' without the -' add operation binding for SOAP protocol. In the example, the WSDL file is modified to insert -' a new 'OperationBinding' instance for SOAP. The 'OperationBinding' instance -' is populated based on WSDL document structure defined in WSDL specification. The updated -' instance is then written to 'MathService_new_cs.wsdl'. -' - - -' -Imports System.Web.Services.Description - -Class MyOperationBindingSample - - Shared Sub Main() - Try - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("MathService_input_vb.wsdl") - Dim myTargetNamespace As String = _ - myServiceDescription.TargetNamespace - -' -' - ' Create an OperationBinding for the Add operation. - Dim addOperationBinding As New OperationBinding() - Dim addOperation As String = "Add" - addOperationBinding.Name = addOperation -' - -' - ' Create an InputBinding for the Add operation. - Dim myInputBinding As New InputBinding() - Dim mySoapBodyBinding As New SoapBodyBinding() - mySoapBodyBinding.Use = SoapBindingUse.Literal - myInputBinding.Extensions.Add(mySoapBodyBinding) - - ' Add the InputBinding to the OperationBinding. - addOperationBinding.Input = myInputBinding -' - -' - ' Create an OutputBinding for the Add operation. - Dim myOutputBinding As New OutputBinding() - myOutputBinding.Extensions.Add(mySoapBodyBinding) - - ' Add the OutputBinding to the OperationBinding. - addOperationBinding.Output = myOutputBinding -' - -' - ' Create an extensibility element for a SoapOperationBinding. - Dim mySoapOperationBinding As New SoapOperationBinding() - mySoapOperationBinding.Style = SoapBindingStyle.Document - mySoapOperationBinding.SoapAction = myTargetNamespace & addOperation - - ' Add the extensibility element SoapOperationBinding to - ' the OperationBinding. - addOperationBinding.Extensions.Add(mySoapOperationBinding) -' -' - -' - Dim myExtensions As ServiceDescriptionFormatExtensionCollection - - ' Get the FaultBindingCollection from the OperationBinding. - Dim myFaultBindingCollection As FaultBindingCollection = _ - addOperationBinding.Faults - Dim myFaultBinding As New FaultBinding() - myFaultBinding.Name = "ErrorFloat" - - ' Associate SOAP fault binding to the fault binding of the operation. - myExtensions = myFaultBinding.Extensions - Dim mySoapFaultBinding As New SoapFaultBinding() - mySoapFaultBinding.Use = SoapBindingUse.Literal - mySoapFaultBinding.Namespace = myTargetNamespace - myExtensions.Add(mySoapFaultBinding) - myFaultBindingCollection.Add(myFaultBinding) -' - - ' Get the BindingCollection from the ServiceDescription. - Dim myBindingCollection As BindingCollection = _ - myServiceDescription.Bindings - - ' Get the OperationBindingCollection of SOAP binding - ' from the BindingCollection. - Dim myOperationBindingCollection As OperationBindingCollection = _ - myBindingCollection(0).Operations - myOperationBindingCollection.Add(addOperationBinding) - - Console.WriteLine( _ - "The operations supported by this service are:") - Dim myOperationBinding As OperationBinding - For Each myOperationBinding In myOperationBindingCollection -' - Dim myBinding As Binding = myOperationBinding.Binding - Console.WriteLine(" Binding : " & myBinding.Name & _ - " :: Name of operation : " & myOperationBinding.Name) -' - Dim myFaultBindingCollection1 As FaultBindingCollection = _ - myOperationBinding.Faults - Dim myFaultBinding1 As FaultBinding - For Each myFaultBinding1 In myFaultBindingCollection1 - Console.WriteLine(" Fault : " & myFaultBinding1.Name) - Next myFaultBinding1 - Next myOperationBinding - - ' Save the ServiceDescripition to an external file. - myServiceDescription.Write("MathService_new_vb.wsdl") - Catch e As Exception - Console.WriteLine("Exception caught!!!") - Console.WriteLine("Source : " & e.Source.ToString()) - Console.WriteLine("Message : " & e.Message.ToString()) - End Try - End Sub -End Class -' diff --git a/snippets/visualbasic/System.Web.Services.Description/OperationBindingCollection/Overview/MathService_input_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/OperationBindingCollection/Overview/MathService_input_vb.wsdl deleted file mode 100644 index 95324b3a06c..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/OperationBindingCollection/Overview/MathService_input_vb.wsdl +++ /dev/null @@ -1,312 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/OperationBindingCollection/Overview/MathService_vb.asmx b/snippets/visualbasic/System.Web.Services.Description/OperationBindingCollection/Overview/MathService_vb.asmx deleted file mode 100644 index 221f9c0c472..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/OperationBindingCollection/Overview/MathService_vb.asmx +++ /dev/null @@ -1,31 +0,0 @@ -<%@ WebService Language="VB" Class="MathService" %> - -Imports System -Imports System.Web.Services - -Public Class MathService - Inherits WebService - - _ - Public Function Add(a As Single, b As Single) As Single - Return a + b - End Function 'Add - - _ - Public Function Subtract(a As Single, b As Single) As Single - Return a - b - End Function 'Subtract - - _ - Public Function Multiply(a As Single, b As Single) As Single - Return a * b - End Function 'Multiply - - _ - Public Function Divide(a As Single, b As Single) As Single - If b = 0 Then - Return - 1 - End If - Return a / b - End Function 'Divide -End Class 'MathService \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/OperationBindingCollection/Overview/operationbindingcollection_operationbindingcollection.vb b/snippets/visualbasic/System.Web.Services.Description/OperationBindingCollection/Overview/operationbindingcollection_operationbindingcollection.vb deleted file mode 100644 index d02811a56e9..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/OperationBindingCollection/Overview/operationbindingcollection_operationbindingcollection.vb +++ /dev/null @@ -1,138 +0,0 @@ -' System.Web.Services.Description.OperationBindingCollection -' System.Web.Services.Description.OperationBindingCollection.Contains -' System.Web.Services.Description.OperationBindingCollection.Add -' System.Web.Services.Description.OperationBindingCollection.Item -' System.Web.Services.Description.OperationBindingCollection.Remove -' System.Web.Services.Description.OperationBindingCollection.Insert -' System.Web.Services.Description.OperationBindingCollection.IndexOf -' System.Web.Services.Description.OperationBindingCollection.CopyTo - -' The following example demonstrates the usage of the -' 'OperationBindingCollection' class, the 'Item' property and various methods of the -' class. The input to the program is a WSDL file 'MathService_input_cs.wsdl' without -' the add operation binding of SOAP protocol. In this example the WSDL file -' is modified to insert a new 'OperationBinding' for SOAP. The -' 'OperationBindingCollection' is populated based on WSDL document -' structure defined in WSDL specification. The updated instance is then -' written to 'MathService_new_cs.wsdl'. -' - -' -Imports System.Web.Services.Description - -Class MyOperationBindingCollectionSample - - Shared Sub Main() - Try - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("MathService_input_vb.wsdl") - - ' Add the OperationBinding for the Add operation. - Dim addOperationBinding As New OperationBinding() - Dim addOperation As String = "Add" - Dim myTargetNamespace As String = myServiceDescription.TargetNamespace - addOperationBinding.Name = addOperation - - ' Add the InputBinding for the operation. - Dim myInputBinding As New InputBinding() - Dim mySoapBodyBinding As New SoapBodyBinding() - mySoapBodyBinding.Use = SoapBindingUse.Literal - myInputBinding.Extensions.Add(mySoapBodyBinding) - addOperationBinding.Input = myInputBinding - - ' Add the OutputBinding for the operation. - Dim myOutputBinding As New OutputBinding() - myOutputBinding.Extensions.Add(mySoapBodyBinding) - addOperationBinding.Output = myOutputBinding - - ' Add the extensibility element for the SoapOperationBinding. - Dim mySoapOperationBinding As New SoapOperationBinding() - mySoapOperationBinding.Style = SoapBindingStyle.Document - mySoapOperationBinding.SoapAction = myTargetNamespace & addOperation - addOperationBinding.Extensions.Add(mySoapOperationBinding) - - ' Get the BindingCollection from the ServiceDescription. - Dim myBindingCollection As BindingCollection = _ - myServiceDescription.Bindings - - ' Get the OperationBindingCollection of SOAP binding from - ' the BindingCollection. - Dim myOperationBindingCollection As OperationBindingCollection = _ - myBindingCollection(0).Operations - -' - ' Check for the Add OperationBinding in the collection. - Dim contains As Boolean = _ - myOperationBindingCollection.Contains(addOperationBinding) - Console.WriteLine(ControlChars.NewLine & _ - "Whether the collection contains the Add " & _ - "OperationBinding : " & contains.ToString()) -' - -' - ' Add the Add OperationBinding to the collection. - myOperationBindingCollection.Add(addOperationBinding) - Console.WriteLine(ControlChars.NewLine & _ - "Added the OperationBinding of the Add " & _ - "operation to the collection.") -' - -' -' - ' Get the OperationBinding of the Add operation from the collection. - Dim myOperationBinding As OperationBinding = _ - myOperationBindingCollection(3) - - ' Remove the OperationBinding of the 'Add' operation from - ' the collection. - myOperationBindingCollection.Remove(myOperationBinding) - Console.WriteLine(ControlChars.NewLine & _ - "Removed the OperationBinding of the " & _ - "Add operation from the collection.") -' -' -' -' - ' Insert the OperationBinding of the Add operation at index 0. - myOperationBindingCollection.Insert(0, addOperationBinding) - Console.WriteLine(ControlChars.NewLine & _ - "Inserted the OperationBinding of the " & _ - "Add operation in the collection.") - - ' Get the index of the OperationBinding of the Add - ' operation from the collection. - Dim index As Integer = myOperationBindingCollection.IndexOf( _ - addOperationBinding) - Console.WriteLine(ControlChars.NewLine & _ - "The index of the OperationBinding of the " & _ - "Add operation : " & index.ToString()) -' -' - Console.WriteLine("") - -' - Dim operationBindingArray(myOperationBindingCollection.Count -1 ) _ - As OperationBinding - - ' Copy this collection to the OperationBinding array. - myOperationBindingCollection.CopyTo(operationBindingArray, 0) - Console.WriteLine("The operations supported by this service " & _ - "are :") - Dim myOperationBinding1 As OperationBinding - For Each myOperationBinding1 In operationBindingArray - Dim myBinding As Binding = myOperationBinding1.Binding - Console.WriteLine(" Binding : " & myBinding.Name & " Name of " & _ - "operation : " & myOperationBinding1.Name) - Next myOperationBinding1 -' - - ' Save the ServiceDescription to an external file. - myServiceDescription.Write("MathService_new_vb.wsdl") - Catch e As Exception - Console.WriteLine("Exception caught!!!") - Console.WriteLine("Source : " & e.Source.ToString()) - Console.WriteLine("Message : " & e.Message.ToString()) - End Try - End Sub -End Class -' diff --git a/snippets/visualbasic/System.Web.Services.Description/OperationCollection/Overview/MathService.vb.asmx b/snippets/visualbasic/System.Web.Services.Description/OperationCollection/Overview/MathService.vb.asmx deleted file mode 100644 index 626d493c154..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/OperationCollection/Overview/MathService.vb.asmx +++ /dev/null @@ -1,31 +0,0 @@ -<%@ WebService Language="VB" Class="MathService" %> -Imports System -Imports System.Web.Services - -Public Class MathService - Inherits WebService - - _ - Public Function Add(a As Single, b As Single) As Single - Return a + b - End Function - - _ - Public Function Subtract(a As Single, b As Single) As Single - Return a - b - End Function - - _ - Public Function Multiply(a As Single, b As Single) As Single - Return a * b - End Function - - _ - Public Function Divide(a As Single, b As Single) As Single - If b = 0 Then - Return - 1 - End If - Return a / b - End Function - -End Class \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/OperationCollection/Overview/MathService_input_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/OperationCollection/Overview/MathService_input_vb.wsdl deleted file mode 100644 index b694af50327..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/OperationCollection/Overview/MathService_input_vb.wsdl +++ /dev/null @@ -1,326 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/OperationCollection/Overview/operationcollection_methods.vb b/snippets/visualbasic/System.Web.Services.Description/OperationCollection/Overview/operationcollection_methods.vb deleted file mode 100644 index 831bed4b150..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/OperationCollection/Overview/operationcollection_methods.vb +++ /dev/null @@ -1,91 +0,0 @@ -' System.Web.Sevices.Description.OperationCollection -' System.Web.Sevices.Description.OperationCollection.Add -' System.Web.Sevices.Description.OperationCollection.Contains -' System.Web.Sevices.Description.OperationCollection.IndexOf -' System.Web.Sevices.Description.OperationCollection.Remove -' System.Web.Sevices.Description.OperationCollection.Insert -' System.Web.Sevices.Description.OperationCollection.Item -' System.Web.Sevices.Description.OperationCollection.CopyTo - -' The following example demonstrates the usage of the -' 'OperationCollection' class , its property 'Item' and its methods -' 'Add', 'Contains', 'CopyTo', 'IndexOf', 'Insert' and 'Remove'. -' The input to the program is a WSDL file 'MathService_input_vb.wsdl'with -' information related to the 'Add' operation for the SOAP protocol, -' removed from it. It creates a new file 'MathService_new_vb.wsdl' with -' the added information about the 'Add' method. - -' -Option Strict On -Imports System.Web.Services -Imports System.Xml -Imports System.Web.Services.Description - -Class MyOperationCollectionSample - Public Shared Sub Main() - Try - ' Read the 'MathService_Input_vb.wsdl' file. - Dim myDescription As ServiceDescription = _ - ServiceDescription.Read("MathService_Input_vb.wsdl") - Dim myPortTypeCollection As PortTypeCollection = _ - myDescription.PortTypes - ' Get the 'OperationCollection' for 'SOAP' protocol. -' - Dim myOperationCollection As OperationCollection = _ - myPortTypeCollection(0).Operations - Dim myOperation As New Operation() - myOperation.Name = "Add" - Dim myOperationMessageInput As OperationMessage = _ - CType(New OperationInput(), OperationMessage) - myOperationMessageInput.Message = New XmlQualifiedName _ - ("AddSoapIn", myDescription.TargetNamespace) - Dim myOperationMessageOutput As OperationMessage = _ - CType(New OperationOutput(), OperationMessage) - myOperationMessageOutput.Message = New XmlQualifiedName _ - ("AddSoapOut", myDescription.TargetNamespace) - myOperation.Messages.Add(myOperationMessageInput) - myOperation.Messages.Add(myOperationMessageOutput) - myOperationCollection.Add(myOperation) -' - -' -' - If myOperationCollection.Contains(myOperation) = True Then - Console.WriteLine("The index of the added 'myOperation' " + _ - "operation is : " + _ - myOperationCollection.IndexOf(myOperation).ToString) - End If -' -' - -' -' -' - myOperationCollection.Remove(myOperation) - ' Insert the 'myOpearation' operation at the index '0'. - myOperationCollection.Insert(0, myOperation) - Console.WriteLine("The operation at index '0' is : " + _ - myOperationCollection.Item(0).Name) -' -' -' - -' - Dim myOperationArray(myOperationCollection.Count) As Operation - myOperationCollection.CopyTo(myOperationArray, 0) - Console.WriteLine("The operation(s) in the collection are :") - Dim i As Integer - For i = 0 To myOperationCollection.Count - 1 - Console.WriteLine(" " + myOperationArray(i).Name) - Next i -' - - myDescription.Write("MathService_New_vb.wsdl") - Catch e As Exception - Console.WriteLine("Exception caught!!!") - Console.WriteLine("Source : " + e.Source) - Console.WriteLine("Message : " + e.Message) - End Try - End Sub -End Class -' diff --git a/snippets/visualbasic/System.Web.Services.Description/OperationFault/Overview/operationfault_operationfault.vb b/snippets/visualbasic/System.Web.Services.Description/OperationFault/Overview/operationfault_operationfault.vb deleted file mode 100644 index d7486a7f60f..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/OperationFault/Overview/operationfault_operationfault.vb +++ /dev/null @@ -1,54 +0,0 @@ -' System.Web.Services.Description.OperationFault -' System.Web.Services.Description.OperationFault.OperationFault - -' The following example demonstrates the usage of the 'OperationFault' -' class and its constructor. The program generates a WSDL file -' 'StockQuoteNew_vb.wsdl' which contains 'Fault' information written -' out. - -' -Imports System.Web.Services.Description -Imports System.Xml -Imports System.Xml.Schema -Imports System.Xml.Serialization - -Public Class MyOperationFaultSample - Public Shared Sub Main() - Try - ' Read the 'StockQuote_vb.wsdl' file as input. - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("StockQuote_vb.wsdl") - Dim myPortTypeCollection As PortTypeCollection = _ - myServiceDescription.PortTypes - Dim myPortType As PortType = myPortTypeCollection(0) - Dim myOperationCollection As OperationCollection = myPortType.Operations - Dim myOperation As Operation = myOperationCollection(0) -' - Dim myOperationFault As New OperationFault() - myOperationFault.Name = "ErrorString" - myOperationFault.Message = _ - New XmlQualifiedName("s0:GetTradePriceStringFault") - myOperation.Faults.Add(myOperationFault) - Console.WriteLine("Added OperationFault with Name: " + _ - myOperationFault.Name) - myOperationFault = New OperationFault() - myOperationFault.Name = "ErrorInt" - myOperationFault.Message = _ - New XmlQualifiedName("s0:GetTradePriceIntFault") - myOperation.Faults.Add(myOperationFault) -' - myOperationCollection.Add(myOperation) - Console.WriteLine("Added Second OperationFault with Name: " + _ - myOperationFault.Name) - myServiceDescription.Write("StockQuoteNew_vb.wsdl") - Console.WriteLine(ControlChars.NewLine + _ - "The file 'StockQuoteNew_vb.wsdl' is " + _ - "created successfully.") - Catch e As Exception - Console.WriteLine("Exception caught!!!") - Console.WriteLine("Source : " + e.Source) - Console.WriteLine("Message : " + e.Message) - End Try - End Sub -End Class -' diff --git a/snippets/visualbasic/System.Web.Services.Description/OperationFault/Overview/stockquote_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/OperationFault/Overview/stockquote_vb.wsdl deleted file mode 100644 index 1fb1f33ce60..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/OperationFault/Overview/stockquote_vb.wsdl +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/OperationFaultCollection/Add/operationfaultcollection_add.vb b/snippets/visualbasic/System.Web.Services.Description/OperationFaultCollection/Add/operationfaultcollection_add.vb deleted file mode 100644 index 7c2471654e9..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/OperationFaultCollection/Add/operationfaultcollection_add.vb +++ /dev/null @@ -1,53 +0,0 @@ -' System.Web.Services.Description.OperationFaultCollection.Add - -' The following example demonstrates the 'Add' method of the -' 'OperationFaultCollection' class. Based on 'StockQuote_vb.wsdl', the program generates a WSDL file -' 'StockQuoteNew_vb.wsdl' which contains 'Fault' information written out. - -Imports System.Web.Services.Description -Imports System.Xml -Imports System.Xml.Schema -Imports System.Xml.Serialization - -Public Class MyFaultCollectionSample - Public Shared Sub Main() - Try - ' Read the 'StockQuote.wsdl' file as input. - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("StockQuote_vb.wsdl") - Dim myPortTypeCollection As PortTypeCollection = _ - myServiceDescription.PortTypes - Dim myPortType As PortType = myPortTypeCollection(0) - Dim myOperationCollection As OperationCollection = _ - myPortType.Operations - Dim myOperation As Operation = myOperationCollection(0) - -' - Dim myOperationFaultCollection As OperationFaultCollection = myOperation.Faults - Dim myOperationFault As New OperationFault() - myOperationFault.Name = "ErrorString" - myOperationFault.Message = New XmlQualifiedName("s0:GetTradePriceStringFault") - myOperationFaultCollection.Add(myOperationFault) -' - - Console.WriteLine("Added OperationFault with Name: " + _ - myOperationFault.Name) - myOperationFault = New OperationFault() - myOperationFault.Name = "ErrorInt" - myOperationFault.Message = _ - New XmlQualifiedName("s0:GetTradePriceIntFault") - myOperationFaultCollection.Add(myOperationFault) - - Console.WriteLine("Added Second OperationFault with Name: " + _ - myOperationFault.Name) - myServiceDescription.Write("StockQuoteNew_vb.wsdl") - Console.WriteLine(ControlChars.NewLine + _ - "The file 'StockQuoteNew_vb.wsdl' is created" + _ - " successfully.") - Catch e As Exception - Console.WriteLine("Exception caught!!!") - Console.WriteLine("Source : " + e.Source) - Console.WriteLine("Message : " + e.Message) - End Try - End Sub -End Class \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/OperationFaultCollection/Add/stockquote_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/OperationFaultCollection/Add/stockquote_vb.wsdl deleted file mode 100644 index 1fb1f33ce60..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/OperationFaultCollection/Add/stockquote_vb.wsdl +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/OperationFaultCollection/Item/operationfaultcollection_item.vb b/snippets/visualbasic/System.Web.Services.Description/OperationFaultCollection/Item/operationfaultcollection_item.vb deleted file mode 100644 index cc572add9d7..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/OperationFaultCollection/Item/operationfaultcollection_item.vb +++ /dev/null @@ -1,57 +0,0 @@ -' System.Web.Services.Description.OperationFaultCollection.Item[String] - -' The following example demonstrates the 'Item' property of the -' 'OperationFaultCollection' class. The program removes a fault binding -' with the name 'ErrorString' from the WSDL file. It also removes an -' operation fault with the name 'ErrorString' and generates a WSDL file. - -Imports System.Web.Services.Description - -Public Class MySample - Public Shared Sub Main() - Try - ' Read the 'StockQuote.wsdl' file as input. - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("StockQuote_vb.wsdl") - ' Remove the operation fault with the name 'ErrorString'. - Dim myPortTypeCollection As PortTypeCollection = _ - myServiceDescription.PortTypes - Dim myPortType As PortType = myPortTypeCollection(0) - Dim myOperationCollection As OperationCollection = myPortType.Operations - Dim myOperation As Operation = myOperationCollection(0) - -' - Dim myOperationFaultCollection As OperationFaultCollection = _ - myOperation.Faults - Dim myOperationFault As OperationFault = _ - myOperationFaultCollection("ErrorString") - If Not (myOperationFault Is Nothing) Then - myOperationFaultCollection.Remove(myOperationFault) - End If -' - - ' Remove the fault binding with the name 'ErrorString'. - Dim myBindingCollection As BindingCollection = _ - myServiceDescription.Bindings - Dim myBinding As Binding = myBindingCollection(0) - Dim myOperationBindingCollection As OperationBindingCollection = _ - myBinding.Operations - Dim myOperationBinding As OperationBinding = _ - myOperationBindingCollection(0) - Dim myFaultBindingCollection As FaultBindingCollection = _ - myOperationBinding.Faults - If myFaultBindingCollection.Contains _ - (myFaultBindingCollection("ErrorString")) Then - myFaultBindingCollection.Remove(myFaultBindingCollection("ErrorString")) - End If - - myServiceDescription.Write("OperationFaultCollection_out.wsdl") - Console.WriteLine("WSDL file with name 'OperationFaultCollection_out.wsdl'" + _ - " created Successfully") - Catch e As Exception - Console.WriteLine("Exception caught!!!") - Console.WriteLine("Source : " + e.Source) - Console.WriteLine("Message : " + e.Message) - End Try - End Sub -End Class \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/OperationFaultCollection/Item/stockquote_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/OperationFaultCollection/Item/stockquote_vb.wsdl deleted file mode 100644 index c48d6636898..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/OperationFaultCollection/Item/stockquote_vb.wsdl +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/OperationFaultCollection/Overview/operationfaultcollection_7.vb b/snippets/visualbasic/System.Web.Services.Description/OperationFaultCollection/Overview/operationfaultcollection_7.vb deleted file mode 100644 index 5134d8d4a31..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/OperationFaultCollection/Overview/operationfaultcollection_7.vb +++ /dev/null @@ -1,137 +0,0 @@ -' System.Web.Services.Description.OperationFaultCollection -' System.Web.Services.Description.OperationFaultCollection.Contains -' System.Web.Services.Description.OperationFaultCollection.CopyTo -' System.Web.Services.Description.OperationFaultCollection.IndexOf -' System.Web.Services.Description.OperationFaultCollection.Insert -' System.Web.Services.Description.OperationFaultCollection.Item -' System.Web.Services.Description.OperationFaultCollection.Remove - -' The following example demonstrates the usage of the -' 'OperationFaultCollection' class, the 'Contains', 'CopyTo', 'IndexOf', -' 'Insert', 'Remove', methods and the 'Item' property of the class. -' The program reverses the fault bindings that appear in the WSDL file. -' It also reverses the operation faults and writes the resultant WSDL -' file. - -' -Imports System.Web.Services.Description - -Public Class MyOperationFaultCollectionSample - - Public Shared Sub Main() - Try - ' Read the StockQuote.wsdl file as input. - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("StockQuote_vb.wsdl") -' -' -' -' -' -' - Dim myPortTypeCollection As PortTypeCollection = _ - myServiceDescription.PortTypes - Dim myPortType As PortType = myPortTypeCollection(0) - Dim myOperationCollection As OperationCollection = _ - myPortType.Operations - Dim myOperation As Operation = myOperationCollection(0) - Dim myOperationFaultCollection As OperationFaultCollection = _ - myOperation.Faults - - ' Reverse the operation fault order. - If myOperationFaultCollection.Count > 1 Then - Dim myOperationFault As OperationFault = _ - myOperationFaultCollection(0) - Dim myOperationFaultArray(myOperationFaultCollection.Count -1 ) _ - As OperationFault - - ' Copy the operation faults to a temporary array. - myOperationFaultCollection.CopyTo(myOperationFaultArray, 0) - - ' Remove all the operation faults from the collection. - Dim i As Integer - For i = 0 To myOperationFaultArray.Length - 1 - myOperationFaultCollection.Remove(myOperationFaultArray(i)) - Next i - - ' Insert the operation faults in the reverse order. - Dim j As Integer = myOperationFaultArray.Length - 1 - i = 0 - While i < myOperationFaultArray.Length - myOperationFaultCollection.Insert(i, myOperationFaultArray(j)) - i += 1 - j -= 1 - End While - If myOperationFaultCollection.Contains(myOperationFault) And _ - myOperationFaultCollection.IndexOf(myOperationFault) = _ - myOperationFaultCollection.Count - 1 Then - Console.WriteLine("Succeeded in reversing the operation faults.") - Else - Console.WriteLine("Error while reversing the faults.") - End If - End If -' -' -' -' -' -' - Dim myBindingCollection As BindingCollection = _ - myServiceDescription.Bindings - Dim myBinding As Binding = myBindingCollection(0) - Dim myOperationBindingCollection As OperationBindingCollection = _ - myBinding.Operations - Dim myOperationBinding As OperationBinding = _ - myOperationBindingCollection(0) - Dim myFaultBindingCollection As FaultBindingCollection = _ - myOperationBinding.Faults - - ' Reverse the fault binding order. - If myFaultBindingCollection.Count > 1 Then - Dim myFaultBinding As FaultBinding = myFaultBindingCollection(0) - - Dim myFaultBindingArray(myFaultBindingCollection.Count -1 ) _ - As FaultBinding - - ' Copy the fault bindings to a temporary array. - myFaultBindingCollection.CopyTo(myFaultBindingArray, 0) - - ' Remove all the fault bindings. - Dim i As Integer - For i = 0 To myFaultBindingArray.Length - 1 - myFaultBindingCollection.Remove(myFaultBindingArray(i)) - Next i - - Dim j As Integer = myFaultBindingArray.Length - 1 - i = 0 - - ' Insert the fault bindings in the reverse order. - While i < myFaultBindingArray.Length - myFaultBindingCollection.Insert(i, myFaultBindingArray(j)) - i += 1 - j -= 1 - End While - - ' Check whether the first element before the reversal - ' is now the last element. - If myFaultBindingCollection.Contains(myFaultBinding) And _ - myFaultBindingCollection.IndexOf(myFaultBinding) = _ - myFaultBindingCollection.Count - 1 Then - - ' Write the WSDL generated to a file. - myServiceDescription.Write("StockQuoteOut_vb.wsdl") - Console.WriteLine( _ - "The file StockQuoteOut_vb.wsdl was successfully written.") - Else - Console.WriteLine( _ - "An Error occurred while reversing the input WSDL file.") - End If - End If - Catch e As Exception - Console.WriteLine("Exception caught!!!") - Console.WriteLine("Source : " & e.Source.ToString()) - Console.WriteLine("Message : " & e.Message.ToString()) - End Try - End Sub -End Class -' diff --git a/snippets/visualbasic/System.Web.Services.Description/OperationFaultCollection/Overview/stockquote_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/OperationFaultCollection/Overview/stockquote_vb.wsdl deleted file mode 100644 index f2219ebfb18..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/OperationFaultCollection/Overview/stockquote_vb.wsdl +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/OperationFlow/Overview/MathService.vb.asmx b/snippets/visualbasic/System.Web.Services.Description/OperationFlow/Overview/MathService.vb.asmx deleted file mode 100644 index 221f9c0c472..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/OperationFlow/Overview/MathService.vb.asmx +++ /dev/null @@ -1,31 +0,0 @@ -<%@ WebService Language="VB" Class="MathService" %> - -Imports System -Imports System.Web.Services - -Public Class MathService - Inherits WebService - - _ - Public Function Add(a As Single, b As Single) As Single - Return a + b - End Function 'Add - - _ - Public Function Subtract(a As Single, b As Single) As Single - Return a - b - End Function 'Subtract - - _ - Public Function Multiply(a As Single, b As Single) As Single - Return a * b - End Function 'Multiply - - _ - Public Function Divide(a As Single, b As Single) As Single - If b = 0 Then - Return - 1 - End If - Return a / b - End Function 'Divide -End Class 'MathService \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/OperationFlow/Overview/MathService_input_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/OperationFlow/Overview/MathService_input_vb.wsdl deleted file mode 100644 index 651152acba9..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/OperationFlow/Overview/MathService_input_vb.wsdl +++ /dev/null @@ -1,328 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/OperationFlow/Overview/operationflow_enum.vb b/snippets/visualbasic/System.Web.Services.Description/OperationFlow/Overview/operationflow_enum.vb deleted file mode 100644 index 1eb8e3f5b69..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/OperationFlow/Overview/operationflow_enum.vb +++ /dev/null @@ -1,131 +0,0 @@ -' System.Web.Sevices.Description.OperationFlow -' System.Web.Sevices.Description.OperationFlow.None -' System.Web.Sevices.Description.OperationFlow.OneWay -' System.Web.Sevices.Description.OperationFlow.Notification -' System.Web.Sevices.Description.OperationFlow.SolicitResponse -' System.Web.Sevices.Description.OperationFlow.RequestResponse - -' The following example demonstrates the usage of the 'OperationFlow' -' Enumeration, its members 'None', 'OneWay', 'Notification', -' 'SolicitResponse', 'RequestResponse'. The input to the program is a -' WSDL file 'MathService_input_vb.wsdl' It creates a new file -' 'MathService_new_vb.wsdl' by adding the operation messages -' 'OperationInput' and 'OperationOutput' in such way that all members of -' the 'OperationFlow' enumeration are generated. - -' -Imports System.Xml -Imports System.Web.Services -Imports System.Web.Services.Description - - -Class MyOperationFlowSample - - Public Shared Sub Main() - Try - Dim myDescription As ServiceDescription = _ - ServiceDescription.Read("MathService_Input_vb.wsdl") - Dim myPortTypeCollection As PortTypeCollection = _ - myDescription.PortTypes - - ' Get the OperationCollection for SOAP protocol. - Dim myOperationCollection As OperationCollection = _ - myPortTypeCollection(0).Operations - ' Get the OperationMessageCollection for the Add operation. - Dim myOperationMessageCollection As OperationMessageCollection = _ - myOperationCollection(0).Messages - - ' Indicate that the endpoint or service receives no - ' transmissions (None). - Console.WriteLine("myOperationMessageCollection does not " & _ - "contain any operation messages.") - DisplayOperationFlowDescription(myOperationMessageCollection.Flow) - Console.WriteLine() - - ' Indicate that the endpoint or service receives a message (OneWay). - Dim myInputOperationMessage As OperationMessage = _ - CType(New OperationInput(), OperationMessage) - Dim myXmlQualifiedName As New XmlQualifiedName("AddSoapIn", _ - myDescription.TargetNamespace) - myInputOperationMessage.Message = myXmlQualifiedName - myOperationMessageCollection.Add(myInputOperationMessage) - Console.WriteLine("myOperationMessageCollection contains " & _ - "only input operation messages.") - DisplayOperationFlowDescription(myOperationMessageCollection.Flow) - Console.WriteLine() - - myOperationMessageCollection.Remove(myInputOperationMessage) - - ' Indicate that an endpoint or service sends a message (Notification). - Dim myOutputOperationMessage As OperationMessage = _ - CType(New OperationOutput(), OperationMessage) - Dim myXmlQualifiedName1 As New XmlQualifiedName("AddSoapOut", _ - myDescription.TargetNamespace) - myOutputOperationMessage.Message = myXmlQualifiedName1 - myOperationMessageCollection.Add(myOutputOperationMessage) - Console.WriteLine("myOperationMessageCollection contains only " & _ - "output operation messages.") - DisplayOperationFlowDescription(myOperationMessageCollection.Flow) - Console.WriteLine() - - ' Indicate that an endpoint or service sends a message, then - ' receives a correlated message (SolicitResponse). - myOperationMessageCollection.Add(myInputOperationMessage) - Console.WriteLine("myOperationMessageCollection contains " & _ - "an output operation message first, then " & _ - "an input operation message.") - DisplayOperationFlowDescription(myOperationMessageCollection.Flow) - Console.WriteLine() - - ' Indicate that an endpoint or service receives a message, - ' then sends a correlated message (RequestResponse). - myOperationMessageCollection.Remove(myInputOperationMessage) - myOperationMessageCollection.Insert(0, myInputOperationMessage) - Console.WriteLine("myOperationMessageCollection contains " & _ - "an input operation message first, then " & _ - "an output operation message.") - DisplayOperationFlowDescription(myOperationMessageCollection.Flow) - Console.WriteLine() - - myDescription.Write("MathService_new_vb.wsdl") - Console.WriteLine( _ - "The file MathService_new_vb.wsdl was successfully written.") - Catch e As Exception - Console.WriteLine("Exception caught!!!") - Console.WriteLine("Source : " & e.Source.ToString()) - Console.WriteLine("Message : " & e.Message.ToString()) - End Try - End Sub - ' - ' - ' - ' - ' - Public Shared Sub DisplayOperationFlowDescription(myOperationFlow As OperationFlow) - Select Case myOperationFlow - Case OperationFlow.None - Console.WriteLine("Indicates that the endpoint or service " & _ - "receives no transmissions (None).") - Case OperationFlow.OneWay - Console.WriteLine("Indicates that the endpoint or service " & _ - "receives a message (OneWay).") - Case OperationFlow.Notification - Console.WriteLine("Indicates that the endpoint or service " & _ - "sends a message (Notification).") - Case OperationFlow.SolicitResponse - Console.WriteLine("Indicates that the endpoint or service " & _ - "sends a message, then receives a correlated message " & _ - "(SolicitResponse).") - Case OperationFlow.RequestResponse - Console.WriteLine("Indicates that the endpoint or service " & _ - "receives a message, then sends a correlated message " & _ - "(RequestResponse).") - End Select - End Sub -' -' -' -' -' -End Class -' diff --git a/snippets/visualbasic/System.Web.Services.Description/OperationInput/Overview/AddNumbersIn_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/OperationInput/Overview/AddNumbersIn_vb.wsdl deleted file mode 100644 index 4d9d8985b8c..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/OperationInput/Overview/AddNumbersIn_vb.wsdl +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/OperationInput/Overview/Service.vb.asmx b/snippets/visualbasic/System.Web.Services.Description/OperationInput/Overview/Service.vb.asmx deleted file mode 100644 index c1b71c214c7..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/OperationInput/Overview/Service.vb.asmx +++ /dev/null @@ -1,17 +0,0 @@ -<%@ WebService Language="VB" Class="Service" %> -Imports System -Imports System.Collections -Imports System.ComponentModel -Imports System.Data -Imports System.Diagnostics -Imports System.Web -Imports System.Web.Services - -Public Class Service - Inherits System.Web.Services.WebService - - _ - Public Function AddNumbers(firstNumber As Integer, secondNumber As Integer) As Integer - Return firstNumber + secondNumber - End Function -End Class \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/OperationInput/Overview/operationinput_operationinput.vb b/snippets/visualbasic/System.Web.Services.Description/OperationInput/Overview/operationinput_operationinput.vb deleted file mode 100644 index 8eef144435d..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/OperationInput/Overview/operationinput_operationinput.vb +++ /dev/null @@ -1,123 +0,0 @@ -' System.Web.Services.Description.OperationInput -' System.Web.Services.Description.OperationInput.OperationInput - -' The following example demonstrates the usage of the 'OperationInput' -' class and its constructor 'OperationInput'. It instantiates the -' 'ServiceDescription' object by reading a file 'AddNumbersIn_vb.wsdl' -' and then creates 'AddNumbersOut_vb.wsdl' file which corresponds to -' added attributes in the 'ServiceDescription' instance. - -' -Imports System.Web.Services.Description -Imports System.Collections -Imports System.Xml - -Class MyOperationInputSample - Public Shared Sub Main() - Try - Dim myDescription As ServiceDescription = _ - ServiceDescription.Read("AddNumbersIn_vb.wsdl") - - ' Add the ServiceHttpPost binding. - Dim myBinding As New Binding() - myBinding.Name = "ServiceHttpPost" - Dim myXmlQualifiedName As New XmlQualifiedName("s0:ServiceHttpPost") - myBinding.Type = myXmlQualifiedName - Dim myHttpBinding As New HttpBinding() - myHttpBinding.Verb = "POST" - myBinding.Extensions.Add(myHttpBinding) - - ' Add the operation name AddNumbers. - Dim myOperationBinding As New OperationBinding() - myOperationBinding.Name = "AddNumbers" - Dim myOperation As New HttpOperationBinding() - myOperation.Location = "/AddNumbers" - myOperationBinding.Extensions.Add(myOperation) - - ' Add the input binding. - Dim myInput As New InputBinding() - Dim postMimeContentbinding As New MimeContentBinding() - postMimeContentbinding.Type = "application/x-www-form-urlencoded" - myInput.Extensions.Add(postMimeContentbinding) - - ' Add the InputBinding to the OperationBinding. - myOperationBinding.Input = myInput - - ' Add the ouput binding. - Dim myOutput As New OutputBinding() - Dim postMimeXmlBinding As New MimeXmlBinding() - postMimeXmlBinding.Part = "Body" - myOutput.Extensions.Add(postMimeXmlBinding) - - ' Add the OutputBinding to the OperationBinding. - myOperationBinding.Output = myOutput - - myBinding.Operations.Add(myOperationBinding) - myDescription.Bindings.Add(myBinding) - - ' Add the port definition. - Dim postPort As New Port() - postPort.Name = "ServiceHttpPost" - postPort.Binding = New XmlQualifiedName("s0:ServiceHttpPost") - Dim postAddressBinding As New HttpAddressBinding() - postAddressBinding.Location = "http://localhost/Service.vb.asmx" - postPort.Extensions.Add(postAddressBinding) - myDescription.Services(0).Ports.Add(postPort) - - ' Add the post port type definition. - Dim postPortType As New PortType() - postPortType.Name = "ServiceHttpPost" - Dim postOperation As New Operation() - postOperation.Name = "AddNumbers" - Dim postOutput As OperationMessage = _ - CType(New OperationOutput(), OperationMessage) - postOutput.Message = New XmlQualifiedName("s0:AddNumbersHttpPostOut") - -' - Dim postInput As New OperationInput() - postInput.Message = New XmlQualifiedName("s0:AddNumbersHttpPostIn") - - postOperation.Messages.Add(postInput) - postOperation.Messages.Add(postOutput) - postPortType.Operations.Add(postOperation) -' - - myDescription.PortTypes.Add(postPortType) - - ' Add the first message information. - Dim postMessage1 As New Message() - postMessage1.Name = "AddNumbersHttpPostIn" - Dim postMessagePart1 As New MessagePart() - postMessagePart1.Name = "firstnumber" - postMessagePart1.Type = New XmlQualifiedName("s:string") - - ' Add the second message information. - Dim postMessagePart2 As New MessagePart() - postMessagePart2.Name = "secondnumber" - postMessagePart2.Type = New XmlQualifiedName("s:string") - postMessage1.Parts.Add(postMessagePart1) - postMessage1.Parts.Add(postMessagePart2) - Dim postMessage2 As New Message() - postMessage2.Name = "AddNumbersHttpPostOut" - - ' Add the third message information. - Dim postMessagePart3 As New MessagePart() - postMessagePart3.Name = "Body" - postMessagePart3.Element = New XmlQualifiedName("s0:int") - postMessage2.Parts.Add(postMessagePart3) - - myDescription.Messages.Add(postMessage1) - myDescription.Messages.Add(postMessage2) - - ' Write the ServiceDescription as a WSDL file. - myDescription.Write("AddNumbersOut_vb.wsdl") - Console.WriteLine("WSDL file named AddNumberOut_vb.Wsdl" & _ - " created successfully.") - Catch e As Exception - Console.WriteLine("Exception caught!!!") - Console.WriteLine("Source : " & e.Source) - Console.WriteLine("Message : " & e.Message) - End Try - End Sub -End Class -' diff --git a/snippets/visualbasic/System.Web.Services.Description/OperationMessage/Overview/MathService_input_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/OperationMessage/Overview/MathService_input_vb.wsdl deleted file mode 100644 index 39bbf1eab50..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/OperationMessage/Overview/MathService_input_vb.wsdl +++ /dev/null @@ -1,329 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/OperationMessage/Overview/MathService_vb.asmx b/snippets/visualbasic/System.Web.Services.Description/OperationMessage/Overview/MathService_vb.asmx deleted file mode 100644 index d36015d0134..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/OperationMessage/Overview/MathService_vb.asmx +++ /dev/null @@ -1,31 +0,0 @@ -<%@ WebService Language="VB" Class="MathService" %> - -Imports System -Imports System.Web.Services - -Public Class MathService - Inherits WebService - - _ - Public Function Add(a As Single, b As Single) As Single - Return a + b - End Function 'Add - - _ - Public Function Subtract(a As Single, b As Single) As Single - Return a - b - End Function 'Subtract - - _ - Public Function Multiply(a As Single, b As Single) As Single - Return a * b - End Function 'Multiply - - _ - Public Function Divide(a As Single, b As Single) As Single - If b = 0 Then - Return - 1 - End If - Return a / b - End Function 'Divide -End Class 'MathService \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/OperationMessage/Overview/operationmessage_properties.vb b/snippets/visualbasic/System.Web.Services.Description/OperationMessage/Overview/operationmessage_properties.vb deleted file mode 100644 index d4948ed160e..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/OperationMessage/Overview/operationmessage_properties.vb +++ /dev/null @@ -1,62 +0,0 @@ -' System.Web.Services.Description.OperationMessage -' System.Web.Services.Description.OperationMessage.OperationMessage -' System.Web.Services.Description.OperationMessage.Message -' System.Web.Services.Description.OperationMessage.Operation - -' The following example demonstrates the usage of the 'OperationMessage' -' class, its constructor and the properties 'Message' and 'Operation'. -' The input to the program is a WSDL file 'MathService_input_cs.wsdl' without -' the input message of 'Add' operation for the SOAP -' protocol. In this example a new input message for the 'Add' operation is created. -' The input message in the ServiceDescription instance is loaded with values for -' 'InputMessage'. The instance is then written to 'MathService_new_cs.wsdl'. -' - -' -Imports System.Xml -Imports System.Web.Services -Imports System.Web.Services.Description - -Class MyOperationMessageSample - - Shared Sub Main() - Try - Dim myDescription As ServiceDescription = _ - ServiceDescription.Read("MathService_input_vb.wsdl") - Dim myPortTypeCollection As PortTypeCollection = _ - myDescription.PortTypes - - ' Get the OperationCollection for the SOAP protocol. - Dim myOperationCollection As OperationCollection = _ - myPortTypeCollection(0).Operations - - ' Get the OperationMessageCollection for the Add operation. - Dim myOperationMessageCollection As OperationMessageCollection = _ - myOperationCollection(0).Messages - -' -' -' - Dim myInputOperationMessage As OperationMessage = _ - CType(New OperationInput(), OperationMessage) - Dim myXmlQualifiedName As New XmlQualifiedName("AddSoapIn", _ - myDescription.TargetNamespace) - myInputOperationMessage.Message = myXmlQualifiedName -' - myOperationMessageCollection.Insert(0, myInputOperationMessage) - ' Display the operation name of the InputMessage. - Console.WriteLine("The operation name is " & _ - myInputOperationMessage.Operation.Name) - -' -' - ' Add the OperationMessage to the collection. - myDescription.Write("MathService_new_vb.wsdl") - Catch e As Exception - Console.WriteLine("Exception caught!!!") - Console.WriteLine("Source : " & e.Source.ToString()) - Console.WriteLine("Message : " & e.Message.ToString()) - End Try - End Sub -End Class -' diff --git a/snippets/visualbasic/System.Web.Services.Description/OperationMessageCollection/Overview/MathService_input_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/OperationMessageCollection/Overview/MathService_input_vb.wsdl deleted file mode 100644 index ae0a9ea4b3c..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/OperationMessageCollection/Overview/MathService_input_vb.wsdl +++ /dev/null @@ -1,329 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/OperationMessageCollection/Overview/MathService_vb.asmx b/snippets/visualbasic/System.Web.Services.Description/OperationMessageCollection/Overview/MathService_vb.asmx deleted file mode 100644 index d36015d0134..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/OperationMessageCollection/Overview/MathService_vb.asmx +++ /dev/null @@ -1,31 +0,0 @@ -<%@ WebService Language="VB" Class="MathService" %> - -Imports System -Imports System.Web.Services - -Public Class MathService - Inherits WebService - - _ - Public Function Add(a As Single, b As Single) As Single - Return a + b - End Function 'Add - - _ - Public Function Subtract(a As Single, b As Single) As Single - Return a - b - End Function 'Subtract - - _ - Public Function Multiply(a As Single, b As Single) As Single - Return a * b - End Function 'Multiply - - _ - Public Function Divide(a As Single, b As Single) As Single - If b = 0 Then - Return - 1 - End If - Return a / b - End Function 'Divide -End Class 'MathService \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/OperationMessageCollection/Overview/operationmessagecollection_sample.vb b/snippets/visualbasic/System.Web.Services.Description/OperationMessageCollection/Overview/operationmessagecollection_sample.vb deleted file mode 100644 index 8230d2495ba..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/OperationMessageCollection/Overview/operationmessagecollection_sample.vb +++ /dev/null @@ -1,131 +0,0 @@ -' System.Web.Services.Description.OperationMessageCollection -' System.Web.Services.Description.OperationMessageCollection.Item -' System.Web.Services.Description.OperationMessageCollection.CopyTo -' System.Web.Services.Description.OperationMessageCollection.Add -' System.Web.Services.Description.OperationMessageCollection.Contains -' System.Web.Services.Description.OperationMessageCollection.IndexOf -' System.Web.Services.Description.OperationMessageCollection.Remove -' System.Web.Services.Description.OperationMessageCollection.Insert -' System.Web.Services.Description.OperationMessageCollection.Flow -' System.Web.Services.Description.OperationMessageCollection.Input -' System.Web.Services.Description.OperationMessageCollection.Output - -' The following example demonstrates the usage of the -' 'OperationMessageCollection' class and various methods and properties of it. -' The input to the program is a WSDL file 'MathService_input_vb.wsdl' without -' the input message of 'Add' operation for the SOAP -' protocol. In a way, it tries to simulate a scenario -' wherein the operation flow was 'Notification', however later operation -' flow changed to 'Request-Response'. The WSDL file is -' modified by inserting a new input message for the 'Add' operation. The -' input message in the ServiceDescription instance is loaded with values for -' 'Input Message'. The instance is then written to 'MathService_new_vb.wsdl'. - -' -Imports System.Xml -Imports System.Web.Services -Imports System.Web.Services.Description - -Class MyOperationMessageCollectionSample - - Shared Sub Main() - Try - Dim myDescription As ServiceDescription = _ - ServiceDescription.Read("MathService_input_vb.wsdl") - Dim myPortTypeCollection As PortTypeCollection = _ - myDescription.PortTypes - - ' Get the OperationCollection for the SOAP protocol. - Dim myOperationCollection As OperationCollection = _ - myPortTypeCollection(0).Operations - - ' Get the OperationMessageCollection for the Add operation. - Dim myOperationMessageCollection As OperationMessageCollection = _ - myOperationCollection(0).Messages - ' Display the Flow, Input, and Output properties. - DisplayFlowInputOutput(myOperationMessageCollection, "Start") - -' -' - ' Get the operation message for the Add operation. - Dim myOperationMessage As OperationMessage = _ - myOperationMessageCollection.Item(0) - Dim myInputOperationMessage As OperationMessage = _ - CType(New OperationInput(), OperationMessage) - Dim myXmlQualifiedName As _ - New XmlQualifiedName("AddSoapIn", myDescription.TargetNamespace) - myInputOperationMessage.Message = myXmlQualifiedName - -' - Dim myCollection(myOperationMessageCollection.Count -1 ) _ - As OperationMessage - myOperationMessageCollection.CopyTo(myCollection, 0) - Console.WriteLine("Operation name(s) :") - Dim i As Integer - For i = 0 To myCollection.Length - 1 - Console.WriteLine(" " & myCollection(i).Operation.Name) - Next i - -' - ' Add the OperationMessage to the collection. - myOperationMessageCollection.Add(myInputOperationMessage) -' - DisplayFlowInputOutput(myOperationMessageCollection, "Add") - -' -' - If myOperationMessageCollection.Contains(myOperationMessage) _ - = True Then - Dim myIndex As Integer = _ - myOperationMessageCollection.IndexOf(myOperationMessage) - Console.WriteLine(" The index of the Add operation " & _ - "message in the collection is : " & myIndex.ToString()) - End If -' -' -' - -' -' - myOperationMessageCollection.Remove(myInputOperationMessage) - - ' Display Flow, Input, and Output after removing. - DisplayFlowInputOutput(myOperationMessageCollection, "Remove") - - ' Insert the message at index 0 in the collection. - myOperationMessageCollection.Insert(0, myInputOperationMessage) - - ' Display Flow, Input, and Output after inserting. - DisplayFlowInputOutput(myOperationMessageCollection, "Insert") - -' -' - myDescription.Write("MathService_new_vb.wsdl") - Catch e As Exception - Console.WriteLine("Exception caught!!!") - Console.WriteLine("Source : " & e.Source.ToString()) - Console.WriteLine("Message : " & e.Message.ToString()) - End Try - End Sub - -' -' -' - ' Displays the properties of the OperationMessageCollection. - Public Shared Sub DisplayFlowInputOutput(myOperationMessageCollection As _ - OperationMessageCollection, myOperation As String) - - Console.WriteLine("After " & myOperation.ToString() & ":") - Console.WriteLine("Flow : " & _ - myOperationMessageCollection.Flow.ToString()) - Console.WriteLine("The first occurrence of operation Input " & _ - "in the collection {0}" , myOperationMessageCollection.Input) - Console.WriteLine("The first occurrence of operation Output " & _ - "in the collection " & myOperationMessageCollection.Output.ToString()) - Console.WriteLine() - End Sub -End Class -' -' -' -' diff --git a/snippets/visualbasic/System.Web.Services.Description/OperationOutput/Overview/AddNumbersIn_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/OperationOutput/Overview/AddNumbersIn_vb.wsdl deleted file mode 100644 index 3bff607495f..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/OperationOutput/Overview/AddNumbersIn_vb.wsdl +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/OperationOutput/Overview/Service_vb.asmx b/snippets/visualbasic/System.Web.Services.Description/OperationOutput/Overview/Service_vb.asmx deleted file mode 100644 index d6d762b0e08..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/OperationOutput/Overview/Service_vb.asmx +++ /dev/null @@ -1,16 +0,0 @@ -<%@ WebService Language="VB" Class="Service" %> -Imports System -Imports System.Collections -Imports System.ComponentModel -Imports System.Data -Imports System.Diagnostics -Imports System.Web -Imports System.Web.Services - -Public Class Service - Inherits System.Web.Services.WebService - _ - Public Function AddNumbers(firstNumber As Integer, secondNumber As Integer) As Integer - Return firstNumber + secondNumber - End Function 'AddNumbers -End Class 'Service1 \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/OperationOutput/Overview/operationoutput_operationoutput.vb b/snippets/visualbasic/System.Web.Services.Description/OperationOutput/Overview/operationoutput_operationoutput.vb deleted file mode 100644 index 5f86eafd6ee..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/OperationOutput/Overview/operationoutput_operationoutput.vb +++ /dev/null @@ -1,122 +0,0 @@ -' System.Web.Services.Description.OperationOutput -' System.Web.Services.Description.OperationOutput.OperationOutput - -' The following example demonstrates the usage of the 'OperationOutput' -' class and its constructor 'OperationOutput'. It creates a -' 'ServiceDescription' object by reading the file 'AddNumbersIn_cs.wsdl' and -' then creates 'AddNumbersOut_cs.wsdl' file which corresponds to added -' attributes in the 'ServiceDescription' instance. - -' -Imports System.Web.Services.Description -Imports System.Collections -Imports System.Xml - -Class MyOperationOutputSample - - Public Shared Sub Main() - Try - Dim myDescription As ServiceDescription = _ - ServiceDescription.Read("AddNumbersIn_vb.wsdl") - - ' Add the ServiceHttpPost binding. - Dim myBinding As New Binding() - myBinding.Name = "ServiceHttpPost" - Dim myXmlQualifiedName As New XmlQualifiedName("s0:ServiceHttpPost") - myBinding.Type = myXmlQualifiedName - Dim myHttpBinding As New HttpBinding() - myHttpBinding.Verb = "POST" - myBinding.Extensions.Add(myHttpBinding) - - ' Add the operation name AddNumbers. - Dim myOperationBinding As New OperationBinding() - myOperationBinding.Name = "AddNumbers" - Dim myOperation As New HttpOperationBinding() - myOperation.Location = "/AddNumbers" - myOperationBinding.Extensions.Add(myOperation) - - ' Add the input binding. - Dim myInput As New InputBinding() - Dim postMimeContentbinding As New MimeContentBinding() - postMimeContentbinding.Type = "application/x-www-form-urlencoded" - myInput.Extensions.Add(postMimeContentbinding) - - ' Add the InputBinding to the OperationBinding. - myOperationBinding.Input = myInput - - ' Add the ouput binding. - Dim myOutput As New OutputBinding() - Dim postMimeXmlbinding As New MimeXmlBinding() - postMimeXmlbinding.Part = "Body" - myOutput.Extensions.Add(postMimeXmlbinding) - - ' Add the OutPutBinding to the OperationBinding. - myOperationBinding.Output = myOutput - - myBinding.Operations.Add(myOperationBinding) - myDescription.Bindings.Add(myBinding) - - ' Add the port definition. - Dim postPort As New Port() - postPort.Name = "ServiceHttpPost" - postPort.Binding = New XmlQualifiedName("s0:ServiceHttpPost") - Dim postAddressBinding As New HttpAddressBinding() - postAddressBinding.Location = "http://localhost/Service_vb.asmx" - postPort.Extensions.Add(postAddressBinding) - myDescription.Services(0).Ports.Add(postPort) - - ' Add the post port type definition. - Dim postPortType As New PortType() - postPortType.Name = "ServiceHttpPost" - Dim postOperation As New Operation() - postOperation.Name = "AddNumbers" - Dim postInput As OperationMessage = _ - CType(New OperationInput(), OperationMessage) - postInput.Message = New XmlQualifiedName("s0:AddNumbersHttpPostIn") -' - Dim postOutput As New OperationOutput() - postOutput.Message = New XmlQualifiedName("s0:AddNumbersHttpPostOut") - - postOperation.Messages.Add(postInput) - postOperation.Messages.Add(postOutput) - postPortType.Operations.Add(postOperation) -' - myDescription.PortTypes.Add(postPortType) - - ' Add the first message information. - Dim postMessage1 As New Message() - postMessage1.Name = "AddNumbersHttpPostIn" - Dim postMessagePart1 As New MessagePart() - postMessagePart1.Name = "firstnumber" - postMessagePart1.Type = New XmlQualifiedName("s:string") - - ' Add the second message information. - Dim postMessagePart2 As New MessagePart() - postMessagePart2.Name = "secondnumber" - postMessagePart2.Type = New XmlQualifiedName("s:string") - postMessage1.Parts.Add(postMessagePart1) - postMessage1.Parts.Add(postMessagePart2) - Dim postMessage2 As New Message() - postMessage2.Name = "AddNumbersHttpPostOut" - - ' Add the third message information. - Dim postMessagePart3 As New MessagePart() - postMessagePart3.Name = "Body" - postMessagePart3.Element = New XmlQualifiedName("s0:int") - postMessage2.Parts.Add(postMessagePart3) - - myDescription.Messages.Add(postMessage1) - myDescription.Messages.Add(postMessage2) - - ' Write the 'ServiceDescription' as a WSDL file. - myDescription.Write("AddNumbersOut_vb.wsdl") - Console.WriteLine("WSDL file named AddNumberOut_vb.Wsdl" & _ - " created successfully.") - Catch e As Exception - Console.WriteLine("Exception caught!!!") - Console.WriteLine("Source : " & e.Source.ToString()) - Console.WriteLine("Message : " & e.Message.ToString()) - End Try - End Sub -End Class -' diff --git a/snippets/visualbasic/System.Web.Services.Description/Port/Overview/AddNumbers.vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/Port/Overview/AddNumbers.vb.wsdl deleted file mode 100644 index 2f1656c15c3..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/Port/Overview/AddNumbers.vb.wsdl +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/Port/Overview/portclass.vb b/snippets/visualbasic/System.Web.Services.Description/Port/Overview/portclass.vb deleted file mode 100644 index 9e51a5dc185..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/Port/Overview/portclass.vb +++ /dev/null @@ -1,149 +0,0 @@ -' System.Web.Services.Description.Port.ctor(). -' System.Web.Services.Description.Port.Binding(). -' System.Web.Services.Description.Portt.Extensions. -' System.Web.Services.Description.Port.Name. -' System.Web.Services.Description.Port.Service. - -' The following example demonstrates the constructor and the properties 'Binding', -' 'Extensions','Name',and 'Service' of the 'Port' class. -' The input to the program is a WSDL file 'AddNumbers.vb.wsdl'. -' It creates a 'ServiceDescription' instance by using the static read method of -' 'ServiceDescription' by passing the 'AddNumbers.wsdl' name as an argument. -' It creates a 'Binding' object and adds that binding object to 'ServiceDescription'. -' It adds the 'PortType',Messages to the 'ServiceDescription' object. Finally it writes the -' 'ServiceDescrption' as a WSDL file with name 'AddNumbersOne.wsdl. - -Imports System.Web.Services.Description -Imports System.Web -Imports System.Collections -Imports System.Xml - -Class PortClass - - Public Shared Sub Main() - Try - Dim myDescription As ServiceDescription = _ - ServiceDescription.Read("AddNumbers.vb.wsdl") - ' Create the 'Binding' object. - Dim myBinding As New Binding() - myBinding.Name = "PortServiceHttpPost" - Dim qualifiedName As New XmlQualifiedName("s0:PortServiceHttpPost") - myBinding.Type = qualifiedName - - ' Create the 'HttpBinding' object. - Dim myHttpBinding As New HttpBinding() - myHttpBinding.Verb = "POST" - ' Add the 'HttpBinding' to the 'Binding'. - myBinding.Extensions.Add(myHttpBinding) - ' Create the 'OperationBinding' object. - Dim myOperationBinding As New OperationBinding() - myOperationBinding.Name = "AddNumbers" - Dim myOperation As New HttpOperationBinding() - myOperation.Location = "/AddNumbers" - ' Add the 'HttpOperationBinding' to 'OperationBinding'. - myOperationBinding.Extensions.Add(myOperation) - - ' Create the 'InputBinding' object. - Dim myInput As New InputBinding() - Dim postMimeContentbinding As New MimeContentBinding() - postMimeContentbinding.Type = "application/x-www-form-urlencoded" - myInput.Extensions.Add(postMimeContentbinding) - ' Add the 'InputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInput - ' Create the 'OutputBinding' object. - Dim myOutput As New OutputBinding() - Dim postMimeXmlbinding As New MimeXmlBinding() - postMimeXmlbinding.Part = "Body" - myOutput.Extensions.Add(postMimeXmlbinding) - - ' Add the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding.Output = myOutput - ' Add the 'OperationBinding' to 'Binding'. - myBinding.Operations.Add(myOperationBinding) - - ' Add the 'Binding' to 'BindingCollection' of 'ServiceDescription'. - myDescription.Bindings.Add(myBinding) -' -' -' -' -' - - ' Create a Port. - Dim postPort As New Port() - postPort.Name = "PortServiceHttpPost" - postPort.Binding = New XmlQualifiedName("s0:PortServiceHttpPost") - -' -' - - ' Create an HttpAddressBinding. - Dim postAddressBinding As New HttpAddressBinding() - postAddressBinding.Location = _ - "http://localhost/PortClass/PortService.vb.asmx" - - ' Add the HttpAddressBinding to the Port. - postPort.Extensions.Add(postAddressBinding) -' - - ' Get the Service of the postPort. - Dim myService As Service = postPort.Service - - ' Print the service name for the port. - Console.WriteLine("This is the service name of the postPort:*" & _ - myDescription.Services(0).Ports(0).Service.Name & "*") - - ' Add the Port to the PortCollection of the ServiceDescription. - myDescription.Services(0).Ports.Add(postPort) - -' -' - - ' Create a 'PortType' object. - Dim postPortType As New PortType() - postPortType.Name = "PortServiceHttpPost" - Dim postOperation As New Operation() - postOperation.Name = "AddNumbers" - Dim postInput As OperationMessage = CType(New OperationInput(), OperationMessage) - postInput.Message = New XmlQualifiedName("s0:AddNumbersHttpPostIn") - Dim postOutput As OperationMessage = CType(New OperationOutput(), OperationMessage) - postOutput.Message = New XmlQualifiedName("s0:AddNumbersHttpPostOut") - postOperation.Messages.Add(postInput) - postOperation.Messages.Add(postOutput) - ' Add the 'Operation' to 'PortType'. - postPortType.Operations.Add(postOperation) - ' Adds the 'PortType' to 'PortTypeCollection' of 'ServiceDescription'. - myDescription.PortTypes.Add(postPortType) - ' Create the 'Message' object. - Dim postMessage1 As New Message() - postMessage1.Name = "AddNumbersHttpPostIn" - ' Create the 'MessageParts'. - Dim postMessagePart1 As New MessagePart() - postMessagePart1.Name = "firstnumber" - postMessagePart1.Type = New XmlQualifiedName("s:string") - Dim postMessagePart2 As New MessagePart() - postMessagePart2.Name = "secondnumber" - postMessagePart2.Type = New XmlQualifiedName("s:string") - ' Add the 'MessagePart' objects to 'Messages'. - postMessage1.Parts.Add(postMessagePart1) - postMessage1.Parts.Add(postMessagePart2) - ' Create another 'Message' object. - Dim postMessage2 As New Message() - postMessage2.Name = "AddNumbersHttpPostOut" - Dim postMessagePart3 As New MessagePart() - postMessagePart3.Name = "Body" - postMessagePart3.Element = New XmlQualifiedName("s0:int") - ' Add the 'MessagePart' to 'Message' - postMessage2.Parts.Add(postMessagePart3) - ' Add the 'Message' objects to 'ServiceDescription'. - myDescription.Messages.Add(postMessage1) - myDescription.Messages.Add(postMessage2) - ' Write the 'ServiceDescription' as a WSDL file. - myDescription.Write("AddNumbersOne.wsdl") - Console.WriteLine("WSDL file with name 'AddNumbersOne.Wsdl' file created Successfully") - - Catch ex As Exception - Console.WriteLine("Exception " + ex.Message + " occurred") - End Try - End Sub -End Class diff --git a/snippets/visualbasic/System.Web.Services.Description/PortCollection/Add/MathServiceAdd_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/PortCollection/Add/MathServiceAdd_vb.wsdl deleted file mode 100644 index 5290348d8c9..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/PortCollection/Add/MathServiceAdd_vb.wsdl +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/PortCollection/Add/portcollection_add.vb b/snippets/visualbasic/System.Web.Services.Description/PortCollection/Add/portcollection_add.vb deleted file mode 100644 index 9934d355a65..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/PortCollection/Add/portcollection_add.vb +++ /dev/null @@ -1,73 +0,0 @@ -' System.Web.Services.Description.PortCollection.Contains -' System.Web.Services.Description.PortCollection.Add - -' The following sample reads the contents of a file 'MathServiceAdd_vb.wsdl' -' into a 'ServiceDescription' instance. It gets the collection of Service -' instances from 'ServiceDescription'. It then adds a new port and checks -' whether a port exists. The programs writes a new web service description -' file. - -Imports System.Web.Services.Description -Imports System.Xml - -Class PortCollection_2 - Public Shared Sub Main() - Try - Dim myService As Service - Dim myPortCollection As PortCollection - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("MathServiceAdd_vb.wsdl") - - Console.WriteLine(ControlChars.NewLine + _ - "Total Number of Services :" + _ - myServiceDescription.Services.Count.ToString) - - Dim i As Integer - For i =0 To myServiceDescription.Services.Count - 1 - myService = myServiceDescription.Services(i) - Console.WriteLine("Name : " + myService.Name) -' -' - myPortCollection = myService.Ports - Dim myNewPort As Port = myPortCollection(0) - myPortCollection.Remove(myNewPort) - - ' Display the number of ports. - Console.WriteLine(ControlChars.NewLine & _ - "Total number of ports before " & _ - "adding a new port : " & _ - myService.Ports.Count.ToString) - - ' Add a new port. - myPortCollection.Add(myNewPort) - - ' Display the number of ports after adding a port. - Console.WriteLine("Total number of ports after " & _ - "adding a new port : " & _ - myService.Ports.Count.ToString) - -' - Dim bContain As Boolean = myPortCollection.Contains(myNewPort) - - Console.WriteLine(ControlChars.NewLine + "Port '" + _ - myNewPort.Name + "' exists : " + bContain.ToString) - - ' Remove a port from the collection. - myPortCollection.Remove(myPortCollection(myNewPort.Name)) - - bContain = myPortCollection.Contains(myNewPort) - - Console.WriteLine("Port '" + myNewPort.Name + "' exists : " + _ - bContain.ToString) - - ' Create the description file. - myPortCollection.Insert(0, myNewPort) - myServiceDescription.Write("MathServiceAddNew_vb.wsdl") -' - - Next - Catch ex As Exception - Console.WriteLine("Exception:" + ex.Message) - End Try - End Sub -End Class diff --git a/snippets/visualbasic/System.Web.Services.Description/PortCollection/CopyTo/MathServiceCopyTo_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/PortCollection/CopyTo/MathServiceCopyTo_vb.wsdl deleted file mode 100644 index 772f9d21cf4..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/PortCollection/CopyTo/MathServiceCopyTo_vb.wsdl +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/PortCollection/CopyTo/portcollection_copyto.vb b/snippets/visualbasic/System.Web.Services.Description/PortCollection/CopyTo/portcollection_copyto.vb deleted file mode 100644 index f0fd62a5b19..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/PortCollection/CopyTo/portcollection_copyto.vb +++ /dev/null @@ -1,67 +0,0 @@ -' System.Web.Services.Description.PortCollection.Insert -' System.Web.Services.Description.PortCollection.IndexOf -' System.Web.Services.Description.PortCollection.CopyTo - -' The following sample reads the contents of a file 'MathServiceCopyTo_vb.wsdl' -' into a 'ServiceDescription' instance. It gets the collection of Service -' instances from 'ServiceDescription'. It instantiates 'PortCollection' for -' each service in the collection. 'CopyTo' is called to copy -' the contents into an array.Calls 'IndexOf' for a given port. -' 'Insert' method is called to insert a new port in the collection. - -Imports System.Web.Services.Description -Imports System.Xml - -Class PortCollection_3 - Public Shared Sub Main() - Try - Dim myService As Service - Dim myPortCollection As PortCollection - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("MathServiceCopyTo_vb.wsdl") - - Console.WriteLine("Total Number of Services :" + _ - myServiceDescription.Services.Count.ToString) - - Dim i As Integer - For i =0 to myServiceDescription.Services.Count -1 - myService = myServiceDescription.Services(i) - Console.WriteLine("Name : " + myService.Name) - -' -' -' - myPortCollection = myService.Ports - - ' Create an array of Port objects. - Console.WriteLine(ControlChars.NewLine & "Port collection :") - Dim myPortArray(myService.Ports.Count) As Port - myPortCollection.CopyTo(myPortArray, 0) - Dim i1 As Integer - For i1 = 0 to myService.Ports.Count -1 - Console.WriteLine("Port[" & i1.ToString + "] : " & _ - myPortArray(i1).Name) - Next -' - Dim myIndexPort As Port = myPortCollection(0) - Console.WriteLine(ControlChars.NewLine + ControlChars.NewLine + _ - "The index of port '" + myIndexPort.Name + "' is : " + _ - myPortCollection.IndexOf(myIndexPort).ToString) -' - Dim myPortTestInsert As Port = myPortCollection(0) - myPortCollection.Remove(myPortTestInsert) - myPortCollection.Insert(0, myPortTestInsert) - Console.WriteLine(ControlChars.NewLine + ControlChars.NewLine + _ - "Total Number of Ports after inserting " + "a new port '" + _ - myPortTestInsert.Name + "' is : " + myService.Ports.Count.ToString) - While i1 < myService.Ports.Count - Console.WriteLine("Port[" + i1.ToString + "] : " + myPortArray(i1).Name) - End While - myServiceDescription.Write("MathServiceCopyToNew_vb.wsdl") -' - Next - Catch ex As Exception - Console.WriteLine("Exception:" + ex.Message) - End Try - End Sub -End Class diff --git a/snippets/visualbasic/System.Web.Services.Description/PortCollection/Overview/MathServiceItem_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/PortCollection/Overview/MathServiceItem_vb.wsdl deleted file mode 100644 index 4cb20b2aeba..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/PortCollection/Overview/MathServiceItem_vb.wsdl +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/PortCollection/Overview/portcollection_item.vb b/snippets/visualbasic/System.Web.Services.Description/PortCollection/Overview/portcollection_item.vb deleted file mode 100644 index 9a1f47fc9e5..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/PortCollection/Overview/portcollection_item.vb +++ /dev/null @@ -1,76 +0,0 @@ -' System.Web.Services.Description.PortCollection -' System.Web.Services.Description.PortCollection.Remove -' System.Web.Services.Description.PortCollection.Item(String) -' System.Web.Services.Description.PortCollection.Item(Int32) - -' The following sample reads the contents of a file 'MathServiceItem_vb.wsdl' -' into a 'ServiceDescription' instance. It gets the collection of Service -' instances from 'ServiceDescription'. It instantiates 'PortCollection' for -' each service in the collection. It access the ports from the collection and -' displays them. It accesses a port by its name from the collection and -' displays its index. It adds a new port and calls 'Remove' -' to remove the newly added port. The programs writes a new web service -' description file. - -Imports System.Web.Services.Description - -Class PortCollection_Item - Public Shared Sub Main() - Try -' -' -' -' - Dim myService As Service - Dim myPortCollection As PortCollection - - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("MathServiceItem_vb.wsdl") - - Console.WriteLine("Total number of services : " & _ - myServiceDescription.Services.Count.ToString) - - Dim i As Integer - For i = 0 to myServiceDescription.Services.Count - 1 - myService = myServiceDescription.Services(i) - Console.WriteLine("Name : " & myService.Name) - - myPortCollection = myService.Ports - - ' Create an array of ports. - Console.WriteLine(ControlChars.NewLine & "Port collection :") - Dim i1 As Integer - For i1 = 0 to myService.Ports.Count - 1 - Console.WriteLine("Port[" & i1.ToString & "] : " & _ - myPortCollection(i1).Name) - Next -' - Dim strPort As String = myPortCollection(0).Name - Dim myPort As Port = myPortCollection(strPort) - Console.WriteLine(ControlChars.NewLine & _ - "Index of Port[" & strPort & "] : " & _ - myPortCollection.IndexOf(myPort).ToString) - -' - Dim myPortTestRemove As Port = myPortCollection(0) - - Console.WriteLine(ControlChars.NewLine & _ - "Total number of ports before removing " & _ - "a port '" & myPortTestRemove.Name & "' is : " & _ - myService.Ports.Count.ToString) - myPortCollection.Remove(myPortTestRemove) - Console.WriteLine("Total number of ports after removing " & _ - "a port '" & myPortTestRemove.Name & "' is : " & _ - myService.Ports.Count.ToString) - - ' Create the WSDL file. - myPortCollection.Insert(0, myPortTestRemove) - myServiceDescription.Write("MathServiceItemNew_vb.wsdl") - Next -' -' - Catch ex As Exception - Console.WriteLine("Exception: " & ex.Message) - End Try - End Sub -End Class diff --git a/snippets/visualbasic/System.Web.Services.Description/PortType/Operations/MathService_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/PortType/Operations/MathService_VB.wsdl deleted file mode 100644 index de9ba30da40..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/PortType/Operations/MathService_VB.wsdl +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/PortType/Operations/porttype.vb b/snippets/visualbasic/System.Web.Services.Description/PortType/Operations/porttype.vb deleted file mode 100644 index a2f83126ade..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/PortType/Operations/porttype.vb +++ /dev/null @@ -1,77 +0,0 @@ -' System.Web.Services.Description.PortType.Operations -' System.Web.Services.Description.PortType.PortType() -' System.Web.Services.Description.PortType.Name - -' The following sample demonstrates the properties 'Operations','Name' and constructor -' 'PortType()' of class 'PortType'. This sample reads the contents of a file 'MathService.wsdl' -' into a 'ServiceDescription' instance. It gets the collection of 'PortType' -' instances from 'ServiceDescription'. It removes a 'PortType' from the collection, creates a -' new 'PortType' and adds it into collection. The programs writes a new web service description -' file 'MathService_New.wsdl'. - -' -Imports System.Web.Services.Description -Imports System.Xml - -Class MyPortTypeClass - Public Shared Sub Main() - Try -' -' - Dim myPortTypeCollection As PortTypeCollection - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("MathService_VB.wsdl") - - myPortTypeCollection = myServiceDescription.PortTypes - Dim noOfPortTypes As Integer = myServiceDescription.PortTypes.Count - Console.WriteLine( _ - ControlChars.Newline & "Total number of PortTypes : " & _ - noOfPortTypes.ToString()) - - Dim myPortType As PortType = myPortTypeCollection("MathServiceSoap") - myPortTypeCollection.Remove(myPortType) - - ' Create a new PortType. - Dim myNewPortType As New PortType() - myNewPortType.Name = "MathServiceSoap" - Dim myOperationCollection As OperationCollection = _ - myServiceDescription.PortTypes(0).Operations - Dim i As Integer - Dim inputMsg As String - Dim outputMsg As String - For i = 0 To myOperationCollection.Count - 1 - inputMsg = myOperationCollection(i).Name & "SoapIn" - outputMsg = myOperationCollection(i).Name & "SoapOut" - Console.WriteLine(" Operation = " & myOperationCollection(i).Name) - myNewPortType.Operations.Add( _ - CreateOperation(myOperationCollection(i).Name, inputMsg, _ - outputMsg, myServiceDescription.TargetNamespace)) - Next i - ' Add the PortType to the collection. - myPortTypeCollection.Add(myNewPortType) - noOfPortTypes = myServiceDescription.PortTypes.Count - Console.WriteLine( _ - ControlChars.Newline & "Total number of PortTypes : " & _ - noOfPortTypes.ToString()) - myServiceDescription.Write("MathService_New.wsdl") -' -' - Catch e As Exception - Console.WriteLine("Exception:" + e.Message.ToString()) - End Try - End Sub - - Public Shared Function CreateOperation(operationName As String, inputMessage As String, _ - outputMessage As String, targetNamespace As String) As Operation - Dim myOperation As New Operation() - myOperation.Name = operationName - Dim input As OperationMessage = CType(New OperationInput(), OperationMessage) - input.Message = New XmlQualifiedName(inputMessage, targetNamespace) - Dim output As OperationMessage = CType(New OperationOutput(), OperationMessage) - output.Message = New XmlQualifiedName(outputMessage, targetNamespace) - myOperation.Messages.Add(input) - myOperation.Messages.Add(output) - Return myOperation - End Function 'CreateOperation -End Class -' diff --git a/snippets/visualbasic/System.Web.Services.Description/PortType/Overview/MathService_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/PortType/Overview/MathService_vb.wsdl deleted file mode 100644 index 2bded8c89b2..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/PortType/Overview/MathService_vb.wsdl +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/PortType/Overview/porttype_class.vb b/snippets/visualbasic/System.Web.Services.Description/PortType/Overview/porttype_class.vb deleted file mode 100644 index f3a6c61c3b0..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/PortType/Overview/porttype_class.vb +++ /dev/null @@ -1,75 +0,0 @@ -' System.Web.Services.Description.PortType - -' The following sample demonstrates the class 'PortType'. This sample reads -' the contents of a file 'MathService.wsdl' into a 'ServiceDescription' instance. -' It gets the collection of 'PortType' instances from 'ServiceDescription'. -' It removes a 'PortType' from the collection, creates a new 'PortType' and adds -' it into collection. The programs writes a new web service description -' file 'MathService_New.wsdl'. - -' -Imports System.Web.Services.Description -Imports System.Xml - -Class MyPortTypeClass - Public Shared Sub Main() - Try - Dim myPortTypeCollection As PortTypeCollection - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("MathService_vb.wsdl") - - myPortTypeCollection = myServiceDescription.PortTypes - Dim noOfPortTypes As Integer = _ - myServiceDescription.PortTypes.Count - Console.WriteLine(ControlChars.Newline & _ - "Total number of PortTypes : " & noOfPortTypes.ToString()) - - Dim myPortType As PortType = _ - myPortTypeCollection("MathServiceSoap") - myPortTypeCollection.Remove(myPortType) - - ' Create a new PortType. - Dim myNewPortType As New PortType() - myNewPortType.Name = "MathServiceSoap" - Dim myOperationCollection As OperationCollection = _ - myServiceDescription.PortTypes(0).Operations - Dim i As Integer - For i = 0 To myOperationCollection.Count - 1 - Dim inputmsg As String = _ - myOperationCollection(i).Name & "SoapIn" - Dim outputmsg As String = _ - myOperationCollection(i).Name & "SoapOut" - Console.WriteLine("Operation = " & myOperationCollection(i).Name) - myNewPortType.Operations.Add( _ - CreateOperation(myOperationCollection(i).Name, inputmsg, _ - outputmsg, myServiceDescription.TargetNamespace)) - Next i - - ' Add the PortType to the collection. - myPortTypeCollection.Add(myNewPortType) - noOfPortTypes = myServiceDescription.PortTypes.Count - Console.WriteLine(ControlChars.Newline & _ - "Total Number of PortTypes : " & noOfPortTypes.ToString()) - myServiceDescription.Write("MathService_New.wsdl") - Catch e As Exception - Console.WriteLine("Exception: " & e.Message) - End Try - End Sub - - Public Shared Function CreateOperation(operationName As String, _ - inputMessage As String, outputMessage As String, _ - targetNamespace As String) As Operation - Dim myOperation As New Operation() - myOperation.Name = operationName - Dim input As OperationMessage = _ - CType(New OperationInput(), OperationMessage) - input.Message = New XmlQualifiedName(inputMessage, targetNamespace) - Dim output As OperationMessage = _ - CType(New OperationOutput(), OperationMessage) - output.Message = New XmlQualifiedName(outputMessage, targetNamespace) - myOperation.Messages.Add(input) - myOperation.Messages.Add(output) - Return myOperation - End Function 'CreateOperation -End Class -' diff --git a/snippets/visualbasic/System.Web.Services.Description/PortTypeCollection/Add/MathService_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/PortTypeCollection/Add/MathService_VB.wsdl deleted file mode 100644 index 404874df7b7..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/PortTypeCollection/Add/MathService_VB.wsdl +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/PortTypeCollection/Add/porttypecollection_1.vb b/snippets/visualbasic/System.Web.Services.Description/PortTypeCollection/Add/porttypecollection_1.vb deleted file mode 100644 index 24927c1bad5..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/PortTypeCollection/Add/porttypecollection_1.vb +++ /dev/null @@ -1,64 +0,0 @@ -' System.Web.Services.Description.PortTypeCollection.Item[int] -' System.Web.Services.Description.PortTypeCollection.Remove() -' System.Web.Services.Description.PortTypeCollection.Add() - -' The following sample demonstrates the indexer 'Item[int]', methods -' 'Remove()' and 'Add()' of class 'PortTypeCollection'. It reads the -' contents of a file 'MathService.wsdl'into a 'ServiceDescription' instance. -' It gets the collection of 'PortType' from 'ServiceDescription' and adds -' a new PortType and writes a new web service description file into -' 'MathService_New.wsdl'. - -Imports System.Web.Services.Description -Imports System.Xml - -Class MyPortTypeCollectionClass - - Public Shared Sub Main() - Try -' -' -' - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("MathService_VB.wsdl") - Dim myPortTypeCollection As PortTypeCollection = _ - myServiceDescription.PortTypes - - Dim noOfPortTypes As Integer = myServiceDescription.PortTypes.Count - Console.WriteLine( _ - ControlChars.Newline & "Total number of PortTypes: " & _ - myServiceDescription.PortTypes.Count.ToString()) - - ' Get the first PortType in the collection. - Dim myNewPortType As PortType = myPortTypeCollection(0) - Console.WriteLine( _ - "The PortType at index 0 is: " & myNewPortType.Name) - Console.WriteLine("Removing the PortType " & myNewPortType.Name) - - ' Remove the PortType from the collection. - myPortTypeCollection.Remove(myNewPortType) - - ' Display the number of PortTypes. - Console.WriteLine(ControlChars.Newline & _ - "Total number of PortTypes after removing: " & _ - myServiceDescription.PortTypes.Count.ToString()) - - Console.WriteLine("Adding a PortType " & myNewPortType.Name) - - ' Add a new PortType from the collection. - myPortTypeCollection.Add(myNewPortType) - - ' Display the number of PortTypes after adding a port. - Console.WriteLine( _ - "Total Number of PortTypes after adding a new port: " & _ - myServiceDescription.PortTypes.Count.ToString()) - - myServiceDescription.Write("MathService_New.wsdl") -' -' -' - Catch e As Exception - Console.WriteLine("Exception: " & e.Message.ToString()) - End Try - End Sub -End Class diff --git a/snippets/visualbasic/System.Web.Services.Description/PortTypeCollection/Contains/MathService_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/PortTypeCollection/Contains/MathService_VB.wsdl deleted file mode 100644 index 8ee748337d2..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/PortTypeCollection/Contains/MathService_VB.wsdl +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/PortTypeCollection/Contains/porttypecollection_2.vb b/snippets/visualbasic/System.Web.Services.Description/PortTypeCollection/Contains/porttypecollection_2.vb deleted file mode 100644 index 72375809a8f..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/PortTypeCollection/Contains/porttypecollection_2.vb +++ /dev/null @@ -1,71 +0,0 @@ -' System.Web.Services.Description.PortTypeCollection.Contains() -' System.Web.Services.Description.PortTypeCollection.Insert() -' System.Web.Services.Description.PortTypeCollection.IndexOf() -' System.Web.Services.Description.PortTypeCollection.Item[string] - -' The following sample demonstrates the methods 'IndexOf()','Insert()','Contains' and -' indexer 'Item[string]' of class 'PortTypeCollection'. This sample reads the contents -' of 'MathService.wsdl' into a 'ServiceDescription' instance. It gets the collection of -' 'PortType' instances from 'ServiceDescription'. It removes a 'PortType' with the name -' 'MathServiceSoap' and adds the same later. Then it checks whether the collection contains -' the added 'PortType'. The sample writes a new web service description file 'MathService_New.wsdl'. - -Imports System.Web.Services.Description -Imports System.Xml - -Class MyPortTypeCollectionClass - - Public Shared Sub Main() - Try -' -' -' -' - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("MathService_VB.wsdl") - - Dim myPortTypeCollection As PortTypeCollection = _ - myServiceDescription.PortTypes - Dim noOfPortTypes As Integer = myServiceDescription.PortTypes.Count - Console.WriteLine(ControlChars.Newline & _ - "Total number of PortTypes: " & noOfPortTypes.ToString()) - - Dim myNewPortType As PortType = myPortTypeCollection("MathServiceSoap") -' - ' Get the index in the collection. - Dim index As Integer = myPortTypeCollection.IndexOf(myNewPortType) -' - Console.WriteLine("Removing the PortType named " & _ - myNewPortType.Name) - - ' Remove the PortType from the collection. - myPortTypeCollection.Remove(myNewPortType) - noOfPortTypes = myServiceDescription.PortTypes.Count - Console.WriteLine(ControlChars.Newline & _ - "Total number of PortTypes: " & noOfPortTypes.ToString()) - - ' Check whether the PortType exists in the collection. - Dim bContains As Boolean = myPortTypeCollection.Contains(myNewPortType) - Console.WriteLine("Port Type'" & myNewPortType.Name & _ - "' exists: " & bContains.ToString()) - - Console.WriteLine("Adding the 'PortType'") - ' Insert a new portType at the index location. - myPortTypeCollection.Insert(index, myNewPortType) -' - - ' Display the number of portTypes after adding a port. - Console.WriteLine("Total number of PortTypes after " & _ - "adding a new port: " & _ - myServiceDescription.PortTypes.Count.ToString()) - - bContains = myPortTypeCollection.Contains(myNewPortType) - Console.WriteLine("Port Type'" & myNewPortType.Name & "' exists: " _ - & bContains.ToString()) - myServiceDescription.Write("MathService_New.wsdl") -' - Catch e As Exception - Console.WriteLine("Exception: " + e.Message.ToString()) - End Try - End Sub -End Class diff --git a/snippets/visualbasic/System.Web.Services.Description/PortTypeCollection/CopyTo/MathService.VB.asmx b/snippets/visualbasic/System.Web.Services.Description/PortTypeCollection/CopyTo/MathService.VB.asmx deleted file mode 100644 index 129a85c98ac..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/PortTypeCollection/CopyTo/MathService.VB.asmx +++ /dev/null @@ -1,34 +0,0 @@ -<%@ WebService Language="VB" Class="MathService" %> - -Imports System -Imports System.Web.Services - -Public Class MathService - Inherits WebService - - _ - Public Function Add(a As Single, b As Single) As Single - Return a + b - End Function 'Add - - - _ - Public Function Subtract(a As Single, b As Single) As Single - Return a - b - End Function 'Subtract - - - _ - Public Function Multiply(a As Single, b As Single) As Single - Return a * b - End Function 'Multiply - - - _ - Public Function Divide(a As Single, b As Single) As Single - If b = 0 Then - Return - 1 - End If - Return a / b - End Function 'Divide -End Class 'MathService \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/PortTypeCollection/CopyTo/MathService_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/PortTypeCollection/CopyTo/MathService_VB.wsdl deleted file mode 100644 index 280b52ffd4a..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/PortTypeCollection/CopyTo/MathService_VB.wsdl +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/PortTypeCollection/CopyTo/porttypecollection_copyto.vb b/snippets/visualbasic/System.Web.Services.Description/PortTypeCollection/CopyTo/porttypecollection_copyto.vb deleted file mode 100644 index f3d5304b66d..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/PortTypeCollection/CopyTo/porttypecollection_copyto.vb +++ /dev/null @@ -1,41 +0,0 @@ -' System.Web.Services.Description.PortTypeCollection.CopyTo() - -' The following sample demonstrates the 'CopyTo()' method of the class -' 'PortTypeCollection'. This sample reads the contents of a file 'MathService.wsdl' -' into a 'ServiceDescription' instance. It gets the collection of 'PortType' -' from 'ServiceDescription'. It copies the collection into an array of 'PortType' -' and displays their names. - -Imports System.Web.Services.Description -Imports System.Xml - -Class MyPortTypeCollectionClass - Public Shared Sub Main() - Try -' - Dim myPortTypeCollection As PortTypeCollection - - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("MathService_VB.wsdl") - myPortTypeCollection = myServiceDescription.PortTypes - Dim noOfPortTypes As Integer = myServiceDescription.PortTypes.Count - Console.WriteLine( _ - ControlChars.NewLine + "Total number of PortTypes: " & _ - myServiceDescription.PortTypes.Count.ToString()) - - ' Copy the collection into an array. - Dim myPortTypeArray(noOfPortTypes-1) As PortType - myPortTypeCollection.CopyTo(myPortTypeArray, 0) - - ' Display names of all PortTypes. - Dim i As Integer - For i = 0 To noOfPortTypes - 1 - Console.WriteLine("PortType Name: " + myPortTypeArray(i).Name) - Next i - myServiceDescription.Write("MathService_New.wsdl") -' - Catch e As Exception - Console.WriteLine("Exception: " + e.Message.ToString()) - End Try - End Sub -End Class \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/PortTypeCollection/Overview/MathService.vb.asmx b/snippets/visualbasic/System.Web.Services.Description/PortTypeCollection/Overview/MathService.vb.asmx deleted file mode 100644 index e8769fd6de2..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/PortTypeCollection/Overview/MathService.vb.asmx +++ /dev/null @@ -1,31 +0,0 @@ -<%@ WebService Language="VB" Class="MathService" %> - -Imports System -Imports System.Web.Services - -Public Class MathService - Inherits WebService - - _ - Public Function Add(a As Single, b As Single) As Single - Return a + b - End Function 'Add - - _ - Public Function Subtract(a As Single, b As Single) As Single - Return a - b - End Function 'Subtract - - _ - Public Function Multiply(a As Single, b As Single) As Single - Return a * b - End Function 'Multiply - - _ - Public Function Divide(a As Single, b As Single) As Single - If b = 0 Then - Return - 1 - End If - Return a / b - End Function 'Divide -End Class 'MathService \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/PortTypeCollection/Overview/MathService_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/PortTypeCollection/Overview/MathService_vb.wsdl deleted file mode 100644 index 00716883c67..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/PortTypeCollection/Overview/MathService_vb.wsdl +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/PortTypeCollection/Overview/porttypecollection_class.vb b/snippets/visualbasic/System.Web.Services.Description/PortTypeCollection/Overview/porttypecollection_class.vb deleted file mode 100644 index 17f666ee92a..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/PortTypeCollection/Overview/porttypecollection_class.vb +++ /dev/null @@ -1,70 +0,0 @@ -' System.Web.Services.Description.PortTypeCollection - -' The following sample demonstrates the class 'PortTypeCollection'. It reads the -' contents of WSDL document 'MathService.wsdl'into a 'ServiceDescription' instance. -' It gets the collection of 'PortType'from 'ServiceDescription'. It copies the -' collection into an array of 'PortType' and displays their names. Then it removes a -' 'PortType', checks whether the collection contains the removed 'PortType'. -' It adds the same 'PortType' and writes a new web service description file into -' 'MathService_New.wsdl'. - -' -Imports System.Web.Services.Description -Imports System.Xml -Imports System.Collections - -Class MyPortTypeCollectionClass - Public Shared Sub Main() - Try - ' Read the existing Web service description file. - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("MathService_vb.wsdl") - Dim myPortTypeCollection As PortTypeCollection = _ - myServiceDescription.PortTypes - Dim noOfPortTypes As Integer = _ - myServiceDescription.PortTypes.Count - Console.WriteLine( _ - ControlChars.Newline & "Total number of PortTypes: " & _ - myServiceDescription.PortTypes.Count.ToString()) - - ' Get the first PortType in the collection. - Dim myNewPortType As PortType = _ - myPortTypeCollection("MathServiceSoap") - Dim index As Integer = myPortTypeCollection.IndexOf(myNewPortType) - Console.WriteLine("The PortType with the name " & _ - myNewPortType.Name & " is at index: " & (index + 1).ToString()) - - Console.WriteLine("Removing the PortType: " & myNewPortType.Name) - - ' Remove the PortType from the collection. - myPortTypeCollection.Remove(myNewPortType) - Dim bContains As Boolean = _ - myPortTypeCollection.Contains(myNewPortType) - Console.WriteLine("The PortType with the Name " & _ - myNewPortType.Name & " exists: " & bContains.ToString()) - - Console.WriteLine("Total Number of PortTypes after removing: " & _ - myServiceDescription.PortTypes.Count.ToString()) - - Console.WriteLine("Adding a PortType: " & myNewPortType.Name) - - ' Add a new portType from the collection. - myPortTypeCollection.Add(myNewPortType) - - ' Display the number of portTypes after adding a port. - Console.WriteLine( _ - "Total Number of PortTypes after adding a new port: " & _ - myServiceDescription.PortTypes.Count.ToString()) - - ' List the PortTypes available in the WSDL document. - Dim myPortType As PortType - For Each myPortType In myPortTypeCollection - Console.WriteLine("The PortType name is: " & myPortType.Name) - Next myPortType - myServiceDescription.Write("MathService_New.wsdl") - Catch e As Exception - Console.WriteLine("Exception: " & e.Message) - End Try - End Sub -End Class -' diff --git a/snippets/visualbasic/System.Web.Services.Description/Service/Extensions/MathService_VB.asmx b/snippets/visualbasic/System.Web.Services.Description/Service/Extensions/MathService_VB.asmx deleted file mode 100644 index 41896cab788..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/Service/Extensions/MathService_VB.asmx +++ /dev/null @@ -1,34 +0,0 @@ -<%@ WebService Language="VB" Class="MathService" %> - -Imports System -Imports System.Web.Services - -Public Class MathService - Inherits WebService - - _ - Public Function Add(a As Single, b As Single) As Single - Return a + b - End Function 'Add - - - _ - Public Function Subtract(a As Single, b As Single) As Single - Return a - b - End Function 'Subtract - - - _ - Public Function Multiply(a As Single, b As Single) As Single - Return a * b - End Function 'Multiply - - - _ - Public Function Divide(a As Single, b As Single) As Single - If b = 0 Then - Return - 1 - End If - Return a / b - End Function 'Divide -End Class 'MathService \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/Service/Extensions/MathService_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/Service/Extensions/MathService_VB.wsdl deleted file mode 100644 index 366caa68ac1..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/Service/Extensions/MathService_VB.wsdl +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/Service/Extensions/service_class.vb b/snippets/visualbasic/System.Web.Services.Description/Service/Extensions/service_class.vb deleted file mode 100644 index 019b2da3c58..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/Service/Extensions/service_class.vb +++ /dev/null @@ -1,100 +0,0 @@ -' System.Web.Services.Description.Service.Ports -' System.Web.Services.Description.Service.Extensions -' System.Web.Services.Description.Service.Service() -' System.Web.Services.Description.Service.Name - -' The following sample demonstrates the properties 'Ports','Extensions','Name' and -' constructor 'Service()'. This sample reads the contents of a file 'MathService_VB.wsdl' -' into a 'ServiceDescription' instance. It gets the collection of Service -' instances from 'ServiceDescription'. It then removes a 'Service' from the collection and -' creates a new 'Service' and adds it into collection. It writes a new web service description -' file 'MathService_New.wsdl'. - -' -Imports System.Web.Services.Description -Imports System.Xml - -Class MyServiceClass - - Public Shared Sub Main() - Try -' -' -' - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("MathService_VB.wsdl") - Dim myServiceCollection As ServiceCollection = _ - myServiceDescription.Services - - Dim noOfServices As Integer = myServiceCollection.Count - Console.WriteLine(ControlChars.Newline & _ - "Total number of services: " & noOfServices.ToString()) - - ' Get a reference to the service. - Dim myOldService As Service = myServiceCollection(0) - Console.WriteLine("No.of Ports in the Service" & _ - myServiceCollection(0).Ports.Count.ToString()) - Console.WriteLine("These are the ports in the service:") - Dim i As Integer - For i = 0 To myOldService.Ports.Count - 1 - Console.WriteLine("Port name: " & myOldService.Ports(i).Name) - Next i - Console.WriteLine("Service name: " & myOldService.Name) - - Dim myService As New Service() - myService.Name = "MathService" - - ' Add the ports to the newly created service. - For i = 0 To myOldService.Ports.Count - 1 - Dim PortName As String = myServiceCollection(0).Ports(i).Name - Dim BindingName As String = _ - myServiceCollection(0).Ports(i).Binding.Name - myService.Ports.Add(CreatePort(PortName, BindingName, _ - myServiceDescription.TargetNamespace)) - Next i - - Console.WriteLine("Newly created ports -") - For i = 0 To myService.Ports.Count - 1 - Console.WriteLine("Port Name: " & myOldService.Ports(i).Name) - Next i - - ' Add the extensions to the newly created service. - Dim noOfExtensions As Integer = myOldService.Extensions.Count - Console.WriteLine("No. of extensions: " & noOfExtensions.ToString()) - - If noOfExtensions > 0 Then - For i = 0 To myOldService.Ports.Count - 1 - myService.Extensions.Add(myServiceCollection(0).Extensions(i)) - Next i - End If - - ' Remove the service from the collection. - myServiceCollection.Remove(myOldService) - - ' Add the newly created service. - myServiceCollection.Add(myService) - myServiceDescription.Write("MathService_New.wsdl") -' -' -' - Catch e As Exception - Console.WriteLine("Exception: " & e.Message.ToString()) - End Try - End Sub - - - Public Shared Function CreatePort(PortName As String, _ - BindingName As String, targetNamespace As String) As Port - Dim myPort As New Port() - myPort.Name = PortName - myPort.Binding = New XmlQualifiedName(BindingName, targetNamespace) - - ' Create a SoapAddress extensibility element to add to the port. - Dim mySoapAddressBinding As New SoapAddressBinding() - mySoapAddressBinding.Location = _ - "http://localhost/Service_Class/MathService_VB.asmx" - myPort.Extensions.Add(mySoapAddressBinding) - Return myPort - End Function 'CreatePort -End Class -' diff --git a/snippets/visualbasic/System.Web.Services.Description/Service/Overview/MathService.vb.asmx b/snippets/visualbasic/System.Web.Services.Description/Service/Overview/MathService.vb.asmx deleted file mode 100644 index e8769fd6de2..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/Service/Overview/MathService.vb.asmx +++ /dev/null @@ -1,31 +0,0 @@ -<%@ WebService Language="VB" Class="MathService" %> - -Imports System -Imports System.Web.Services - -Public Class MathService - Inherits WebService - - _ - Public Function Add(a As Single, b As Single) As Single - Return a + b - End Function 'Add - - _ - Public Function Subtract(a As Single, b As Single) As Single - Return a - b - End Function 'Subtract - - _ - Public Function Multiply(a As Single, b As Single) As Single - Return a * b - End Function 'Multiply - - _ - Public Function Divide(a As Single, b As Single) As Single - If b = 0 Then - Return - 1 - End If - Return a / b - End Function 'Divide -End Class 'MathService \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/Service/Overview/MathService_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/Service/Overview/MathService_vb.wsdl deleted file mode 100644 index 0950de8b09f..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/Service/Overview/MathService_vb.wsdl +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/Service/Overview/serviceclass.vb b/snippets/visualbasic/System.Web.Services.Description/Service/Overview/serviceclass.vb deleted file mode 100644 index a2cd9238334..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/Service/Overview/serviceclass.vb +++ /dev/null @@ -1,92 +0,0 @@ -' System.Web.Services.Description.Service - -' The following sample demonstrates the class 'Service'. This sample reads the -' contents of a file 'MathService.wsdl' into a 'ServiceDescription' instance. -' It gets the collection of Service instances from 'ServiceDescription'. It -' then removes a 'Service' from the collection and creates a new 'Service' and -' adds it into collection. It writes a new web service description file 'MathService_New.wsdl'. - -' -Imports System.Web.Services.Description -Imports System.Xml - -Class MyServiceClass - Public Shared Sub Main() - Try - ' Read a WSDL document. - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("MathService_vb.wsdl") - Dim myServiceCollection As ServiceCollection = _ - myServiceDescription.Services - - Dim noOfServices As Integer = myServiceCollection.Count - Console.WriteLine(ControlChars.Newline & _ - "Total Number of Services :" & noOfServices.ToString()) - - ' Gets a reference to the service. - Dim myOldService As Service = myServiceCollection(0) - Console.WriteLine("No. of Ports in the Service" & _ - myServiceCollection(0).Ports.Count.ToString()) - Console.WriteLine("These are the ports in the service:") - Dim i As Integer - For i = 0 To myOldService.Ports.Count - 1 - Console.WriteLine("Port name: " & myOldService.Ports(i).Name) - Next i - Console.WriteLine("Service name: " & myOldService.Name) - - Dim myService As New Service() - myService.Name = "MathService" - - ' Add the Ports to the newly created Service. - Dim j As Integer - For j = 0 To myOldService.Ports.Count - 1 - Dim PortName As String = myServiceCollection(0).Ports(j).Name - Dim BindingName As String = _ - myServiceCollection(0).Ports(j).Binding.Name - myService.Ports.Add(CreatePort(PortName, BindingName, _ - myServiceDescription.TargetNamespace)) - Next j - - Console.WriteLine("Newly created ports -") - Dim k As Integer - For k = 0 To myService.Ports.Count - 1 - Console.WriteLine("Port name: " & myOldService.Ports(k).Name) - Next k - - ' Add the extensions to the newly created Service. - Dim noOfExtensions As Integer = myOldService.Extensions.Count - Console.WriteLine("No. of extensions: " & noOfExtensions.ToString()) - If noOfExtensions > 0 Then - Dim l As Integer - For l = 0 To myOldService.Ports.Count - 1 - myService.Extensions.Add(myServiceCollection(0).Extensions(l)) - Next l - End If - - ' Remove the service from the collection. - myServiceCollection.Remove(myOldService) - - ' Add the newly created service. - myServiceCollection.Add(myService) - - myServiceDescription.Write("MathService_New.wsdl") - Catch e As Exception - Console.WriteLine("Exception:" & e.Message) - End Try - End Sub - - Public Shared Function CreatePort(PortName As String, _ - BindingName As String, targetNamespace As String) As Port - Dim myPort As New Port() - myPort.Name = PortName - myPort.Binding = New XmlQualifiedName(BindingName, targetNamespace) - - ' Create a SoapAddress extensibility element to add to the port. - Dim mySoapAddressBinding As New SoapAddressBinding() - mySoapAddressBinding.Location = _ - "http://localhost/ServiceClass/MathService.vb.asmx" - myPort.Extensions.Add(mySoapAddressBinding) - Return myPort - End Function 'CreatePort -End Class -' diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Add/AddSub.vb.asmx b/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Add/AddSub.vb.asmx deleted file mode 100644 index 69410d4718f..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Add/AddSub.vb.asmx +++ /dev/null @@ -1,17 +0,0 @@ -<%@ WebService Language="VB" Class="MathService" %> - -Imports System -Imports System.Web.Services - -Public Class MathService - Inherits WebService - _ - Public Function Add(a As Single, b As Single) As Single - Return a + b - End Function 'Add - - _ - Public Function Subtract(a As Single, b As Single) As Single - Return a - b - End Function 'Subtract -End Class 'MathService \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Add/Input.vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Add/Input.vb.wsdl deleted file mode 100644 index 7f333f308a2..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Add/Input.vb.wsdl +++ /dev/null @@ -1,182 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Add/servicecollection_item.vb b/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Add/servicecollection_item.vb deleted file mode 100644 index f3689900821..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Add/servicecollection_item.vb +++ /dev/null @@ -1,86 +0,0 @@ -' System.Web.Services.Description.ServiceDescription.Write(FileName) -' System.Web.Services.Description.ServiceCollection.Remove -' System.Web.Services.Description.ServiceCollection.Item(int) -' System.Web.Services.Description.ServiceDescription.Services -' System.Web.Services.Description.ServiceDescription.TargetNamespace -' System.Web.Services.Description.ServiceCollection.Add -' -' The following example demonstrates methods and properties of -' ServiceDescription and ServiceCollection classes. -' A new WSDL is read and the existing service "MathService" in the -' ServiceCollection is removed. The service by default is defined for -' SOAP, HttpGet, HttpPost. A new Service defined for SOAP and HttpGet is -' constructed and added to the ServiceCollection. -' The programs writes a new web service description file. - -Imports System.Web.Services.Description -Imports System.Collections -Imports System.Xml - -Class MyClass1 - - Public Shared Sub Main() -' -' -' -' -' - ' Read a ServiceDescription from existing WSDL. - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("Input.vb.wsdl") - myServiceDescription.TargetNamespace = "http://tempuri.org/" -' - - ' Get the ServiceCollection of the ServiceDescription. - Dim myServiceCollection As ServiceCollection = _ - myServiceDescription.Services - - ' Remove the Service at index 0 of the collection. - myServiceCollection.Remove(myServiceDescription.Services.Item(0)) -' -' -' - -' - ' Build a new Service. - Dim myService As New Service() - myService.Name = "MathService" - Dim myXmlQualifiedName As New XmlQualifiedName("s0:MathServiceSoap") - - ' Build a new Port for SOAP. - Dim mySoapPort As New Port() - - mySoapPort.Name = "MathServiceSoap" - - mySoapPort.Binding = myXmlQualifiedName - - Dim mySoapAddressBinding As New SoapAddressBinding() - mySoapAddressBinding.Location = _ - "http://localhost/ServiceCollection_Item/AddSub.vb.asmx" - mySoapPort.Extensions.Add(mySoapAddressBinding) - - ' Build a new Port for HTTP-GET. - Dim myXmlQualifiedName2 As _ - New XmlQualifiedName("s0:MathServiceHttpGet") - - Dim myHttpGetPort As New Port() - myHttpGetPort.Name = "MathServiceHttpGet" - myHttpGetPort.Binding = myXmlQualifiedName2 - Dim myHttpAddressBinding As New HttpAddressBinding() - myHttpAddressBinding.Location = _ - "http://localhost/ServiceCollection_Item/AddSub.vb.asmx" - myHttpGetPort.Extensions.Add(myHttpAddressBinding) - - ' Add the ports to the service. - myService.Ports.Add(myHttpGetPort) - myService.Ports.Add(mySoapPort) - - ' Add the service to the ServiceCollection. - myServiceCollection.Add(myService) -' - - ' Write to a new WSDL file. - myServiceDescription.Write("output.wsdl") -' - End Sub -End Class diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Contains/AddService.vb.asmx b/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Contains/AddService.vb.asmx deleted file mode 100644 index f85bf359bfd..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Contains/AddService.vb.asmx +++ /dev/null @@ -1,12 +0,0 @@ -<%@ WebService Language="VB" Class="MathService" %> - -Imports System -Imports System.Web.Services - -Public Class MathService - Inherits WebService - _ - Public Function Add(a As Single, b As Single) As Single - Return a + b - End Function 'Add -End Class 'MathService \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Contains/AddService_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Contains/AddService_vb.wsdl deleted file mode 100644 index 0333c937393..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Contains/AddService_vb.wsdl +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Contains/AddSubtractService_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Contains/AddSubtractService_vb.wsdl deleted file mode 100644 index 7fc0ea58c53..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Contains/AddSubtractService_vb.wsdl +++ /dev/null @@ -1,208 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Contains/SubtractService.vb.asmx b/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Contains/SubtractService.vb.asmx deleted file mode 100644 index c5d4eaa6fbf..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Contains/SubtractService.vb.asmx +++ /dev/null @@ -1,12 +0,0 @@ -<%@ WebService Language="VB" Class="MathService1" %> - -Imports System -Imports System.Web.Services - -Public Class MathService1 - Inherits WebService - _ - Public Function Subtract(a As Single, b As Single) As Single - Return a - b - End Function 'Subtract -End Class 'MathService1 \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Contains/SubtractService_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Contains/SubtractService_vb.wsdl deleted file mode 100644 index f8a46eb214e..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Contains/SubtractService_vb.wsdl +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Contains/servicecollection_copyto.vb b/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Contains/servicecollection_copyto.vb deleted file mode 100644 index d396dc82177..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Contains/servicecollection_copyto.vb +++ /dev/null @@ -1,101 +0,0 @@ -' System.Web.Services.Description.ServiceCollection.Contains(Service) -' System.Web.Services.Description.ServiceCollection.IndexOf(service) -' System.Web.Services.Description.ServiceCollection.CopyTo(System[],int) - -' The following program demonstrates the methods of -' ServiceDescription and ServiceCollection class. An existing WSDL document -' is read.An exiting service named "MathService" is removed from the -' collection. A new Service object is constructed and added at index 1 of the -' Collection .A new WSDL file is created as output. - -Imports System.Text -Imports System.Web.Services.Description -Imports System.Collections -Imports System.IO -Imports System.Xml - -Class ServiceDescription_Sample - Public Shared Sub Main() - Try - ' Read the Existing Wsdl. - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("AddSubtractService_vb.wsdl") - ' Remove the service named "MathService". - Dim myServiceDescriptionCollection As ServiceCollection = _ - myServiceDescription.Services - myServiceDescriptionCollection.Remove(myServiceDescription.Services("MathService")) - ' Build a new Service. - Dim myService As New Service() - myService.Name = "MathService" - - Dim myXmlQualifiedName As New XmlQualifiedName("s0:MathServiceSoap") - ' Build a new Port for Soap. - Dim mySoapPort As New Port() - mySoapPort.Name = "MathServiceSoap" - mySoapPort.Binding = myXmlQualifiedName - Dim mySoapAddressBinding As New SoapAddressBinding() - mySoapAddressBinding.Location = _ - "http://localhost/ServiceCollection_CopyTo/AddSubtractService_vb.asmx" - mySoapPort.Extensions.Add(mySoapAddressBinding) - - ' Build a new Port for HttpGet. - Dim myXmlQualifiedName2 As New XmlQualifiedName("s0:MathServiceHttpGet") - Dim myHttpGetPort As New Port() - myHttpGetPort.Name = "MathServiceHttpGet" - myHttpGetPort.Binding = myXmlQualifiedName2 - Dim myHttpAddressBinding As New HttpAddressBinding() - myHttpAddressBinding.Location = _ - "http://localhost/ServiceCollection_CopyTo/AddSubtractService_vb.asmx" - myHttpGetPort.Extensions.Add(myHttpAddressBinding) - ' Build a new Port for HttpPost. - Dim myXmlQualifiedName3 As New XmlQualifiedName("s0:MathServiceHttpPost") - ' Build a new Port for Soap. - Dim myHttpPostPort As New Port() - myHttpPostPort.Name = "MathServiceHttpPost" - myHttpPostPort.Binding = myXmlQualifiedName3 - Dim myHttpAddressBinding1 As New HttpAddressBinding() - myHttpAddressBinding1.Location = _ - "http://localhost/ServiceCollection_CopyTo/AddSubtractService_vb.asmx" - myHttpPostPort.Extensions.Add(myHttpAddressBinding1) - - ' Add the ports to the service. - myService.Ports.Add(mySoapPort) - myService.Ports.Add(myHttpGetPort) - myService.Ports.Add(myHttpPostPort) - ' Add the Service to the ServiceCollection. - myServiceDescription.Services.Insert(1, myService) - - Dim myStreamWriter As New StreamWriter("output.wsdl") - ' Output the Wsdl. - myServiceDescription.Write(myStreamWriter) - myStreamWriter.Close() - -' -' - If myServiceDescription.Services.Contains(myService) Then - Console.WriteLine( _ - "The mentioned service Exists at index {0} in the WSDL.", _ - myServiceDescription.Services.IndexOf(myService)) -' - Dim myServiceArray(myServiceDescription.Services.Count - 1) _ - As Service - - ' Copy the services into an array. - myServiceDescription.Services.CopyTo(myServiceArray, 0) - Dim myEnumerator As IEnumerator = myServiceArray.GetEnumerator() - Console.WriteLine("The names of services in the array are") - While myEnumerator.MoveNext() - Dim myService1 As Service = CType(myEnumerator.Current, Service) - Console.WriteLine(myService1.Name) - End While -' - Else - Console.WriteLine("Service does not exist in the WSDL.") - End If -' -' - Catch e As Exception - Console.WriteLine("Exception Caught! " + e.Message) - End Try - End Sub -End Class diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Insert/AddService_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Insert/AddService_VB.wsdl deleted file mode 100644 index 8d6b79ae82e..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Insert/AddService_VB.wsdl +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Insert/All_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Insert/All_VB.wsdl deleted file mode 100644 index 4260caac551..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Insert/All_VB.wsdl +++ /dev/null @@ -1,208 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Insert/SubtractService_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Insert/SubtractService_VB.wsdl deleted file mode 100644 index cd3d1b7e578..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Insert/SubtractService_VB.wsdl +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Insert/servicedescription_read.vb b/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Insert/servicedescription_read.vb deleted file mode 100644 index bacada1a4c7..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Insert/servicedescription_read.vb +++ /dev/null @@ -1,83 +0,0 @@ -' System.Web.Description.ServiceDescription.Read(XmlReader) -' System.Web.Description.ServiceCollection.Item(string) -' System.Web.Description.ServiceCollection.Insert(int,Service) -' System.Web.Description.ServiceDescription.Write(XmlWriter) - -' The following program demonstrates the properties of ServiceDescription and -' ServiceCollection class.An XmlTextReader with the required url is created. -' An existing WSDL document is read. -' An existing service named "MathService" is removed from the collection and -' A new Service object is constructed and added at index 1 of the Collection of Services. -' A new WSDL file is created as output. - -Imports System.Text -Imports System.Web.Services.Description -Imports System.Collections -Imports System.Xml - -Class MyClass1 - - Public Shared Sub Main() - Try -' -' - ' Create a new XmlTextWriter with specified URL. - Dim myXmlReader As New XmlTextReader("All_VB.wsdl") - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read(myXmlReader) - myServiceDescription.TargetNamespace = "http://tempuri.org/" - - ' Remove the service named MathService. - Dim myServiceDescriptionCollection As ServiceCollection = _ - myServiceDescription.Services - myServiceDescriptionCollection.Remove( _ - myServiceDescription.Services("MathService")) -' -' - -' - Dim myService As New Service() - myService.Name = "MathService" - Dim myXmlQualifiedName As New XmlQualifiedName("s0:MathServiceSoap") - - ' Build a new Port for SOAP. - Dim mySoapPort As New Port() - mySoapPort.Name = "MathServiceSoap" - mySoapPort.Binding = myXmlQualifiedName - Dim mySoapAddressBinding As New SoapAddressBinding() - mySoapAddressBinding.Location = _ - "http://localhost/ServiceDescription_Read/AddService_VB.asmx" - mySoapPort.Extensions.Add(mySoapAddressBinding) - - ' Build a new Port for HTTP-GET. - Dim myXmlQualifiedName2 As New _ - XmlQualifiedName("s0:MathServiceHttpGet") - Dim myHttpGetPort As New Port() - myHttpGetPort.Name = "MathServiceHttpGet" - myHttpGetPort.Binding = myXmlQualifiedName2 - Dim myHttpAddressBinding As New HttpAddressBinding() - myHttpAddressBinding.Location = _ - "http://localhost/ServiceDescription_Read/AddService_VB.asmx" - myHttpGetPort.Extensions.Add(myHttpAddressBinding) - - ' Add the ports to the service. - myService.Ports.Add(myHttpGetPort) - myService.Ports.Add(mySoapPort) - - ' Add the service to the ServiceCollection. - myServiceDescription.Services.Insert(1, myService) -' - -' - ' Create a new XmlTextWriter. - Dim myWriter As New XmlTextWriter("output.wsdl", Encoding.UTF8) - myWriter.Formatting = Formatting.Indented - - ' Write the WSDL. - myServiceDescription.Write(myWriter) -' - Catch e As Exception - Console.WriteLine("Exception: " + e.Message.ToString()) - End Try - End Sub -End Class diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Bindings/MyWsdl_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Bindings/MyWsdl_VB.wsdl deleted file mode 100644 index 2a4bb266c35..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Bindings/MyWsdl_VB.wsdl +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Bindings/Service1_VB.asmx b/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Bindings/Service1_VB.asmx deleted file mode 100644 index 1145993cbfa..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Bindings/Service1_VB.asmx +++ /dev/null @@ -1,16 +0,0 @@ -<%@ WebService Language="VB" Class="Service1" %> - - ' This program creates a WebService to add two numbers. -Imports System -Imports System.Web.Services - -Public Class Service1 - Inherits WebService - - _ - Public Function Add(a As Integer, b As Integer) As Integer - Return a + b - End Function 'Add -End Class 'Service1 - - diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Bindings/servicedescription_bindings.vb b/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Bindings/servicedescription_bindings.vb deleted file mode 100644 index de24aba14c4..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Bindings/servicedescription_bindings.vb +++ /dev/null @@ -1,79 +0,0 @@ -' System.Web.Services.Description.ServiceDescription.Bindings - -' The following example demonstrates the property 'Bindings' of -' 'ServiceDescription' class. The input to the program is a WSDL file -' 'MyWsdl_VB.wsdl'. This program removes one 'Binding' from the existing WSDL. -' A new Binding is defined and added to the ServiceDescription object. -' The program generates a new Web Service Description document. - -Imports System.Web.Services -Imports System.Web.Services.Description -Imports System.Xml - -Namespace ServiceDescription1 - - Class MyService - - Shared Sub Main() - Try -' - ' Obtain the ServiceDescription from existing WSDL. - Dim myDescription As ServiceDescription = _ - ServiceDescription.Read("MyWsdl_VB.wsdl") - ' Remove the Binding from the BindingCollection of - ' the ServiceDescription. - Dim myBindingCollection As BindingCollection = _ - myDescription.Bindings - myBindingCollection.Remove(myBindingCollection(0)) - - ' Form a new Binding. - Dim myBinding As New Binding() - myBinding.Name = "Service1Soap" - Dim myXmlQualifiedName As New XmlQualifiedName("s0:Service1Soap") - myBinding.Type = myXmlQualifiedName - - Dim mySoapBinding As New SoapBinding() - mySoapBinding.Transport = "http://schemas.xmlsoap.org/soap/http" - mySoapBinding.Style = SoapBindingStyle.Document - - Dim addOperationBinding As OperationBinding = _ - CreateOperationBinding("Add", myDescription.TargetNamespace) - myBinding.Operations.Add(addOperationBinding) - myBinding.Extensions.Add(mySoapBinding) - - ' Add the Binding to the ServiceDescription. - myDescription.Bindings.Add(myBinding) - myDescription.Write("MyOutWsdl.wsdl") -' - Catch e As Exception - Console.WriteLine("Exception: " + e.Message.ToString()) - End Try - End Sub - - ' Used to create OperationBinding instances within 'Binding'. - Public Shared Function CreateOperationBinding(operation As String, targetNamespace As String) _ - As OperationBinding - ' Create OperationBinding instance for operation. - Dim myOperationBinding As New OperationBinding() - myOperationBinding.Name = operation - ' Create InputBinding for operation. - Dim myInputBinding As New InputBinding() - Dim mySoapBodyBinding As New SoapBodyBinding() - mySoapBodyBinding.Use = SoapBindingUse.Literal - myInputBinding.Extensions.Add(mySoapBodyBinding) - ' Create OutputBinding for operation. - Dim myOutputBinding As New OutputBinding() - myOutputBinding.Extensions.Add(mySoapBodyBinding) - ' Add 'InputBinding' and 'OutputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInputBinding - myOperationBinding.Output = myOutputBinding - ' Create extensibility element for 'SoapOperationBinding'. - Dim mySoapOperationBinding As New SoapOperationBinding() - mySoapOperationBinding.Style = SoapBindingStyle.Document - mySoapOperationBinding.SoapAction = targetNamespace + operation - ' Add extensibility element 'SoapOperationBinding' to 'OperationBinding'. - myOperationBinding.Extensions.Add(mySoapOperationBinding) - Return myOperationBinding - End Function 'CreateOperationBinding - End Class -End Namespace 'ServiceDescription1 diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/CanRead/MyWsdl_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/CanRead/MyWsdl_VB.wsdl deleted file mode 100644 index 67b78ed8171..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/CanRead/MyWsdl_VB.wsdl +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/CanRead/Service1_VB.asmx b/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/CanRead/Service1_VB.asmx deleted file mode 100644 index b8e352f7065..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/CanRead/Service1_VB.asmx +++ /dev/null @@ -1,16 +0,0 @@ -<%@ WebService Language="VB" Class="Service1" %> - -' This program creates a WebService to add two numbers. -Imports System -Imports System.Web.Services - -Public Class Service1 - Inherits WebService - - _ - Public Function Add(a As Integer, b As Integer) As Integer - Return a + b - End Function 'Add -End Class 'Service1 - - diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/CanRead/servicedescription_porttypes_2.vb b/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/CanRead/servicedescription_porttypes_2.vb deleted file mode 100644 index 17d98fb2f08..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/CanRead/servicedescription_porttypes_2.vb +++ /dev/null @@ -1,72 +0,0 @@ -' System.Web.Services.Description.ServiceDescription.PortTypes -' System.Web.Services.Description.ServiceDescription.CanRead - -' The following example demonstrates the 'PortTypes' property -' and 'CanRead' method of 'ServiceDescription' class. -' The input to the program is a WSDL file 'MyWsdl_VB.wsdl'. -' This program checks the validity of WSDL file.One of the existing -' port types is removed.A new PortType is defined and added to the -' port types collection of the service description. A modified WSDL -' is the output of the program. - -Imports System.Web.Services -Imports System.Web.Services.Description -Imports System.Xml - -Namespace ServiceDescription1 - Class MyService - -' -' - Shared Sub Main() - Dim myWsdlFileName As String = "MyWsdl_VB.wsdl" - Dim myReader As New XmlTextReader(myWsdlFileName) - If ServiceDescription.CanRead(myReader) Then - - Dim myDescription As ServiceDescription = _ - ServiceDescription.Read(myWsdlFileName) - - ' Remove the PortType at index 0 of the collection. - Dim myPortTypeCollection As PortTypeCollection = _ - myDescription.PortTypes - myPortTypeCollection.Remove(myDescription.PortTypes(0)) - - ' Build a new PortType. - Dim myPortType As New PortType() - myPortType.Name = "Service1Soap" - Dim myOperation As Operation = _ - CreateOperation("Add", "s0:AddSoapIn", "s0:AddSoapOut", "") - myPortType.Operations.Add(myOperation) - - ' Add a new PortType to the PortType collection of - ' the ServiceDescription. - myDescription.PortTypes.Add(myPortType) - - myDescription.Write("MyOutWsdl.wsdl") - Console.WriteLine("New WSDL file generated successfully.") - Else - Console.WriteLine("This file is not a WSDL file.") - End If - End Sub - - ' Creates an Operation for a PortType. - Public Shared Function CreateOperation(operationName As String, _ - inputMessage As String, outputMessage As String, _ - targetNamespace As String) As Operation - - Dim myOperation As New Operation() - myOperation.Name = operationName - Dim input As OperationMessage = _ - CType(New OperationInput(), OperationMessage) - input.Message = New XmlQualifiedName(inputMessage, targetNamespace) - Dim output As OperationMessage = _ - CType(New OperationOutput(), OperationMessage) - output.Message = New XmlQualifiedName(outputMessage, targetNamespace) - myOperation.Messages.Add(input) - myOperation.Messages.Add(output) - Return myOperation - End Function 'CreateOperation -' -' - End Class -End Namespace 'ServiceDescription1 diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Extensions/ServiceDescription_Extensions_Input_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Extensions/ServiceDescription_Extensions_Input_vb.wsdl deleted file mode 100644 index 43cab86b269..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Extensions/ServiceDescription_Extensions_Input_vb.wsdl +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Extensions/ServiceDescription_Extensions_VB.asmx b/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Extensions/ServiceDescription_Extensions_VB.asmx deleted file mode 100644 index 7cd44a103c6..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Extensions/ServiceDescription_Extensions_VB.asmx +++ /dev/null @@ -1,14 +0,0 @@ -<%@ WebService Language="VB" Class="ServiceDescriptionService" %> - -' This program creates a WebService to add two numbers. -Imports System -Imports System.Web.Services - -Public Class ServiceDescriptionService - Inherits WebService - - _ - Public Function Add(a As Integer, b As Integer) As Integer - Return a + b - End Function 'Add -End Class 'ServiceDescriptionService \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Extensions/servicedescription_extensions_2.vb b/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Extensions/servicedescription_extensions_2.vb deleted file mode 100644 index a9cd75b9147..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Extensions/servicedescription_extensions_2.vb +++ /dev/null @@ -1,43 +0,0 @@ -' System.Web.Services.Description.ServiceDescription.Extensions -' System.Web.Services.Description.ServiceDescription.RetrievalUrl - -' The following program demonstrates properties 'Extensions', 'RetrievalUrl' of -' 'ServiceDescription' class. The input to the program is a WSDL file -' 'ServiceDescription_Extensions_Input_vb.wsdl'. This program adds one object -' to the extensions collection and displays the count and set the 'RetrievalURL' and displays. - -Imports System.Web.Services -Imports System.Web.Services.Description - -Class MyServiceDescription - - Public Shared Sub Main() -' -' - Dim myServiceDescription As New ServiceDescription() - myServiceDescription = _ - ServiceDescription.Read("ServiceDescription_Extensions_Input_vb.wsdl") - Console.WriteLine( _ - myServiceDescription.Bindings(1).Extensions(0).ToString()) - Dim mySoapBinding As New SoapBinding() - mySoapBinding.Required = True - Dim mySoapBinding1 As New SoapBinding() - mySoapBinding1.Required = False - myServiceDescription.Extensions.Add(mySoapBinding) - myServiceDescription.Extensions.Add(mySoapBinding1) - Dim myServiceDescriptionFormatExtension As _ - ServiceDescriptionFormatExtension - For Each myServiceDescriptionFormatExtension _ - In myServiceDescription.Extensions - Console.WriteLine("Required: " & _ - myServiceDescriptionFormatExtension.Required.ToString()) - Next myServiceDescriptionFormatExtension - myServiceDescription.Write("ServiceDescription_Extensions_Output_vb.wsdl") - myServiceDescription.RetrievalUrl = "http://www.contoso.com/" - Console.WriteLine("Retrieval URL is: " & _ - myServiceDescription.RetrievalUrl) -' -' - End Sub - -End Class diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Imports/ServiceDescription_Imports_Input_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Imports/ServiceDescription_Imports_Input_VB.wsdl deleted file mode 100644 index e55aa8463aa..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Imports/ServiceDescription_Imports_Input_VB.wsdl +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Imports/ServiceDescription_Imports_Service.vb.asmx b/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Imports/ServiceDescription_Imports_Service.vb.asmx deleted file mode 100644 index c4276b37788..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Imports/ServiceDescription_Imports_Service.vb.asmx +++ /dev/null @@ -1,13 +0,0 @@ -<%@ WebService Language="VB" Class="ServiceDescriptionService" %> -Imports System -Imports System.Web -Imports System.Web.Services - -Public Class ServiceDescriptionService - Inherits WebService - - _ - Public Function Add(a As Integer, b As Integer) As Integer - Return a + b - End Function 'Add -End Class 'ServiceDescriptionService \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Imports/servicedescription_imports.vb b/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Imports/servicedescription_imports.vb deleted file mode 100644 index f0bb75d1048..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Imports/servicedescription_imports.vb +++ /dev/null @@ -1,42 +0,0 @@ -' System.Web.Services.Description.ServiceDescription.Imports - -' The following program demonstrates the property 'Imports' of 'ServiceDescription' class. -' The input to the program is a WSDL file 'ServiceDescription_Imports_Input_VB.wsdl' which -' is not having the import element. A new 'Import' is defined and added to the new modified -' 'ServiceDescription_Imports_Output_VB.wsdl' file. - -Imports System.Web.Services -Imports System.Web.Services.Description -Imports System.Xml - -Class MyServiceDescription - - Public Shared Sub Main() -' - Dim myServiceDescription As New ServiceDescription() - myServiceDescription = _ - ServiceDescription.Read("ServiceDescription_Imports_Input_VB.wsdl") - Dim myImportCollection As ImportCollection = myServiceDescription.Imports - - ' Create an Import. - Dim myImport As New Import() - myImport.Namespace = myServiceDescription.TargetNamespace - - ' Set the location for the Import. - myImport.Location = "http://www.contoso.com/" - myImportCollection.Add(myImport) - myServiceDescription.Write("ServiceDescription_Imports_Output_VB.wsdl") - myImportCollection.Clear() - myServiceDescription = _ - ServiceDescription.Read("ServiceDescription_Imports_Output_VB.wsdl") - myImportCollection = myServiceDescription.Imports - Console.WriteLine( _ - "The Import elements added to the ImportCollection are: ") - Dim i As Integer - For i = 0 To myImportCollection.Count - 1 - Console.WriteLine((i + 1).ToString() & ". " & _ - myImportCollection(i).Location) - Next i -' - End Sub -End Class diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Messages/MyWsdl_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Messages/MyWsdl_VB.wsdl deleted file mode 100644 index 866e5ab9550..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Messages/MyWsdl_VB.wsdl +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Messages/Service1_VB.asmx b/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Messages/Service1_VB.asmx deleted file mode 100644 index b8e352f7065..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Messages/Service1_VB.asmx +++ /dev/null @@ -1,16 +0,0 @@ -<%@ WebService Language="VB" Class="Service1" %> - -' This program creates a WebService to add two numbers. -Imports System -Imports System.Web.Services - -Public Class Service1 - Inherits WebService - - _ - Public Function Add(a As Integer, b As Integer) As Integer - Return a + b - End Function 'Add -End Class 'Service1 - - diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Messages/servicedescription_constructor_4.vb b/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Messages/servicedescription_constructor_4.vb deleted file mode 100644 index 9235ed98697..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Messages/servicedescription_constructor_4.vb +++ /dev/null @@ -1,56 +0,0 @@ -' System.Web.Services.Description.ServiceDescription.ServiceDescription() -' System.Web.Services.Description.ServiceDescription.Read(string) -' System.Web.Services.Description.ServiceDescription.Messages -' System.Web.Services.Description.ServiceDescription.Name - -' The following example demonstrates the constructor 'ServiceDescription()', -' 'Messages','Name' properties and 'Read' method of 'ServiceDescription' -' class. The input to the program is a WSDL file 'MyWsdl.wsdl'. -' This program removes one message from the existing WSDL. -' A new Message is defined and added to the ServiceDescription. -' A new wsdl with modified ServiceDescription is written in 'MyOutWsdl.wsdl'. - -Imports System.Web.Services -Imports System.Web.Services.Description -Imports System.Xml - -Namespace ServiceDescription1 - Class MyService - - Shared Sub Main() -' -' -' -' - Dim myDescription As New ServiceDescription() - myDescription = ServiceDescription.Read("MyWsdl_VB.wsdl") - myDescription.Name = "MyServiceDescription" - Console.WriteLine("Name: " & myDescription.Name) - Dim myMessageCollection As MessageCollection = myDescription.Messages - - ' Remove the message at index 0 from the message collection. - myMessageCollection.Remove(myDescription.Messages(0)) - - ' Build a new Message. - Dim myMessage As New Message() - myMessage.Name = "AddSoapIn" - - ' Build a new MessagePart. - Dim myMessagePart As New MessagePart() - myMessagePart.Name = "parameters" - Dim myXmlQualifiedName As New XmlQualifiedName("s0:Add") - myMessagePart.Element = myXmlQualifiedName - - ' Add MessageParts to the message. - myMessage.Parts.Add(myMessagePart) - - ' Add the message to the ServiceDescription. - myDescription.Messages.Add(myMessage) - myDescription.Write("MyOutWsdl.wsdl") -' -' -' -' - End Sub - End Class -End Namespace 'ServiceDescription1 diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Namespace/MyWsdl_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Namespace/MyWsdl_VB.wsdl deleted file mode 100644 index 4ef5536618e..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Namespace/MyWsdl_VB.wsdl +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Namespace/servicedescription_namespace.vb b/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Namespace/servicedescription_namespace.vb deleted file mode 100644 index 311002cfdf0..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Namespace/servicedescription_namespace.vb +++ /dev/null @@ -1,25 +0,0 @@ -' System.Web.Services.Description.ServiceDescription.Namespace - -' The following example demonstrates the 'Namespace' property of 'ServiceDescription' class. The input to the program is a -' WSDL file 'MyWsdl.wsdl'. This program displays the Namespace of 'ServiceDescription' class. - -Imports System.Web.Services -Imports System.Web.Services.Description - -Namespace ServiceDescription1 - - Class MyService - - Shared Sub Main() - Try -' - Dim myDescription As ServiceDescription = _ - ServiceDescription.Read("MyWsdl_VB.wsdl") - Console.WriteLine("Namespace: " & ServiceDescription.Namespace) -' - Catch e As Exception - Console.WriteLine("Exception: " + e.Message) - End Try - End Sub - End Class -End Namespace 'ServiceDescription1 diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Overview/MyWsdl_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Overview/MyWsdl_VB.wsdl deleted file mode 100644 index 50fbd298705..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Overview/MyWsdl_VB.wsdl +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Overview/Service1_VB.asmx b/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Overview/Service1_VB.asmx deleted file mode 100644 index 1145993cbfa..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Overview/Service1_VB.asmx +++ /dev/null @@ -1,16 +0,0 @@ -<%@ WebService Language="VB" Class="Service1" %> - - ' This program creates a WebService to add two numbers. -Imports System -Imports System.Web.Services - -Public Class Service1 - Inherits WebService - - _ - Public Function Add(a As Integer, b As Integer) As Integer - Return a + b - End Function 'Add -End Class 'Service1 - - diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Overview/servicedescription.vb b/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Overview/servicedescription.vb deleted file mode 100644 index 11d900b16ac..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Overview/servicedescription.vb +++ /dev/null @@ -1,75 +0,0 @@ -' System.Web.Services.Description.ServiceDescription - -' The following example demonstrates the 'ServiceDescription' class. -' The input to the program is a WSDL file 'MyWsdl.wsdl'. -' This program removes one 'Binding' from the existing WSDL. -' A new Binding is defined and added to the ServiceDescription object. -' The program generates a new Web Service Description document. -' - -Imports System.Web.Services -Imports System.Web.Services.Description -Imports System.Xml - -Namespace ServiceDescription1 - Class MyService - Shared Sub Main() - Try -' - ' Obtain the ServiceDescription of existing Wsdl. - Dim myDescription As ServiceDescription = ServiceDescription.Read("MyWsdl_VB.wsdl") - ' Remove the Binding from the Binding Collection of ServiceDescription. - Dim myBindingCollection As BindingCollection = myDescription.Bindings - myBindingCollection.Remove(myBindingCollection(0)) - - ' Form a new Binding. - Dim myBinding As New Binding() - myBinding.Name = "Service1Soap" - Dim myXmlQualifiedName As New XmlQualifiedName("s0:Service1Soap") - myBinding.Type = myXmlQualifiedName - - Dim mySoapBinding As New SoapBinding() - mySoapBinding.Transport = "http://schemas.xmlsoap.org/soap/http" - mySoapBinding.Style = SoapBindingStyle.Document - - Dim addOperationBinding As OperationBinding = CreateOperationBinding("Add", _ - myDescription.TargetNamespace) - myBinding.Operations.Add(addOperationBinding) - myBinding.Extensions.Add(mySoapBinding) - - ' Add the Binding to the ServiceDescription. - myDescription.Bindings.Add(myBinding) - myDescription.Write("MyOutWsdl.wsdl") -' - Catch e As Exception - Console.WriteLine("Exception :" + e.Message.ToString()) - End Try - End Sub - - ' Used to create OperationBinding instances within 'Binding'. - Public Shared Function CreateOperationBinding(operation As String, targetNamespace As String) _ - As OperationBinding - ' Create OperationBinding instance for operation. - Dim myOperationBinding As New OperationBinding() - myOperationBinding.Name = operation - ' Create InputBinding for operation. - Dim myInputBinding As New InputBinding() - Dim mySoapBodyBinding As New SoapBodyBinding() - mySoapBodyBinding.Use = SoapBindingUse.Literal - myInputBinding.Extensions.Add(mySoapBodyBinding) - ' Create OutputBinding for operation. - Dim myOutputBinding As New OutputBinding() - myOutputBinding.Extensions.Add(mySoapBodyBinding) - ' Add 'InputBinding' and 'OutputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInputBinding - myOperationBinding.Output = myOutputBinding - ' Create extensibility element for 'SoapOperationBinding'. - Dim mySoapOperationBinding As New SoapOperationBinding() - mySoapOperationBinding.Style = SoapBindingStyle.Document - mySoapOperationBinding.SoapAction = targetNamespace + operation - ' Add extensibility element 'SoapOperationBinding' to 'OperationBinding'. - myOperationBinding.Extensions.Add(mySoapOperationBinding) - Return myOperationBinding - End Function 'CreateOperationBinding - End Class -End Namespace 'ServiceDescription1 \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Read/servicedescription_read1.vb b/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Read/servicedescription_read1.vb deleted file mode 100644 index d1ba9b99428..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Read/servicedescription_read1.vb +++ /dev/null @@ -1,34 +0,0 @@ -' System.Web.Services.Description.Read(TextReader) - -' The following example demonstrates the 'Read(TextReader)' method of -' 'ServiceDescription' class.A ServiceDescription instance is -' obtained from existing Wsdl.Name property of Bindings in the -' ServiceDescription is displayed to console. - -Imports System.Web.Services -Imports System.Web.Services.Description -Imports System.Xml -Imports System.IO - -Class MyService - Shared Sub Main() - Try -' - Dim myDescription As New ServiceDescription() - - ' Create a StreamReader to read a WSDL file. - Dim myTextReader = New StreamReader("MyWsdl.wsdl") - myDescription = ServiceDescription.Read(myTextReader) - Console.WriteLine("Bindings are: ") - - ' Display the Bindings present in the WSDL file. - Dim myBinding As Binding - For Each myBinding In myDescription.Bindings - Console.WriteLine(myBinding.Name) - Next myBinding -' - Catch e As Exception - Console.WriteLine("Exception: " + e.Message) - End Try - End Sub -End Class diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Read/servicedescription_read2.vb b/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Read/servicedescription_read2.vb deleted file mode 100644 index 4d83e080e02..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Read/servicedescription_read2.vb +++ /dev/null @@ -1,33 +0,0 @@ -' System.Web.Services.Description.Read(StreamReader) - -' The following example demonstrates the 'Read(StreamReader)' method of -' 'ServiceDescription' class.A ServiceDescription instance is -' obtained from existing Wsdl.Name property of Bindings in the -' ServiceDescription is displayed to console. - -Imports System.Web.Services -Imports System.Web.Services.Description -Imports System.Xml -Imports System.IO - -Class MyService - Shared Sub Main() - Try -' - ' Create a StreamReader to read a WSDL file. - Dim myStreamReader As New StreamReader("MyWsdl.wsdl") - Dim myDescription As ServiceDescription = _ - ServiceDescription.Read(myStreamReader) - Console.WriteLine("Bindings are :") - - ' Display the Bindings present in the WSDL file. - Dim myBinding As Binding - For Each myBinding In myDescription.Bindings - Console.WriteLine(myBinding.Name) - Next myBinding -' - Catch e As Exception - Console.WriteLine("Exception : " & e.Message) - End Try - End Sub -End Class diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Types/Input_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Types/Input_VB.wsdl deleted file mode 100644 index 72341a18f5e..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Types/Input_VB.wsdl +++ /dev/null @@ -1,182 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Types/servicedescription_types.vb b/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Types/servicedescription_types.vb deleted file mode 100644 index a25427b01ac..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Types/servicedescription_types.vb +++ /dev/null @@ -1,113 +0,0 @@ -' System.Web.Services.Description.ServiceDescription.Types -' System.Web.Services.Description.ServiceDescription.Write(Stream) - -' The following program demonstrates the 'Write' method and 'Types' property -' of ServiceDescription class.An existing WSDL document is read. -' Types of the SericeDescription are removed.New Types are constructed. -' Types are then added to ServiceDescription . A new WSDL file is created as output. - -Imports System.Text -Imports System.Web.Services.Description -Imports System.Collections -Imports System.IO -Imports System.Xml -Imports System.Xml.Schema - -Class ServiceDescription_Types - - Public Shared Sub Main() - Try - ' Read the existing WSDL. - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("Input_VB.wsdl") -' - myServiceDescription.Types.Schemas.Remove( _ - myServiceDescription.Types.Schemas(0)) - Dim myXmlSchema As New XmlSchema() - myXmlSchema.AttributeFormDefault = XmlSchemaForm.Qualified - myXmlSchema.ElementFormDefault = XmlSchemaForm.Qualified - myXmlSchema.TargetNamespace = myServiceDescription.TargetNamespace - - Dim myXmlElement1 As New XmlSchemaElement() - myXmlElement1.Name = "Add" - - Dim myXmlSchemaComplexType As New XmlSchemaComplexType() - Dim myXmlSchemaSequence As New XmlSchemaSequence() - myXmlSchemaSequence.Items.Add(CreateComplexTypeXmlElement( _ - "1", "1", "a", New XmlQualifiedName("s:float"))) - - myXmlSchemaSequence.Items.Add(CreateComplexTypeXmlElement( _ - "1", "1", "b", New XmlQualifiedName("s:float"))) - - myXmlSchemaComplexType.Particle = myXmlSchemaSequence - myXmlElement1.SchemaType = myXmlSchemaComplexType - myXmlSchema.Items.Add(myXmlElement1) - - Dim myXmlElement2 As New XmlSchemaElement() - myXmlElement2.Name = "AddResponse" - myXmlSchemaComplexType = New XmlSchemaComplexType() - myXmlSchemaSequence = New XmlSchemaSequence() - myXmlSchemaSequence.Items.Add(CreateComplexTypeXmlElement( _ - "1", "1", "AddResult", New XmlQualifiedName("s:float"))) - - myXmlSchemaComplexType.Particle = myXmlSchemaSequence - myXmlElement2.SchemaType = myXmlSchemaComplexType - myXmlSchema.Items.Add(myXmlElement2) - - Dim myXmlElement3 As New XmlSchemaElement() - myXmlElement3.Name = "Subtract" - myXmlSchemaComplexType = New XmlSchemaComplexType() - myXmlSchemaSequence = New XmlSchemaSequence() - myXmlSchemaSequence.Items.Add(CreateComplexTypeXmlElement( _ - "1", "1", "a", New XmlQualifiedName("s:float"))) - - myXmlSchemaSequence.Items.Add(CreateComplexTypeXmlElement( _ - "1", "1", "b", New XmlQualifiedName("s:float"))) - - myXmlSchemaComplexType.Particle = myXmlSchemaSequence - myXmlElement3.SchemaType = myXmlSchemaComplexType - myXmlSchema.Items.Add(myXmlElement3) - - Dim myXmlElement4 As New XmlSchemaElement() - myXmlElement4.Name = "SubtractResponse" - myXmlSchemaComplexType = New XmlSchemaComplexType() - myXmlSchemaSequence = New XmlSchemaSequence() - myXmlSchemaSequence.Items.Add(CreateComplexTypeXmlElement( _ - "1", "1", "SubtractResult", New XmlQualifiedName("s:int"))) - - myXmlSchemaComplexType.Particle = myXmlSchemaSequence - myXmlElement4.SchemaType = myXmlSchemaComplexType - myXmlSchema.Items.Add(myXmlElement4) - - ' Add the schemas to the Types property of the ServiceDescription. - myServiceDescription.Types.Schemas.Add(myXmlSchema) -' - -' - Dim myFileStream As New FileStream("output.wsdl", _ - FileMode.OpenOrCreate, FileAccess.Write) - Dim myStreamWriter As New StreamWriter(myFileStream) - - ' Write the WSDL. - Console.WriteLine("Writing a new WSDL file.") - myServiceDescription.Write(myStreamWriter) - myStreamWriter.Close() - myFileStream.Close() -' - Catch e As Exception - Console.WriteLine("Exception Caught! " + e.Message) - End Try - End Sub - - ' This function creates a XmlComplex Element. - Public Shared Function CreateComplexTypeXmlElement( _ - minoccurs As String, maxoccurs As String, name As String, _ - schemaTypeName As XmlQualifiedName) As XmlSchemaElement - Dim myXmlSchemaElement As New XmlSchemaElement() - myXmlSchemaElement.MinOccursString = minoccurs - myXmlSchemaElement.MaxOccursString = maxoccurs - myXmlSchemaElement.Name = name - myXmlSchemaElement.SchemaTypeName = schemaTypeName - Return myXmlSchemaElement - End Function 'CreateComplexTypeXmlElement -End Class diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionBaseCollection/Overview/Input_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionBaseCollection/Overview/Input_VB.wsdl deleted file mode 100644 index 73091bea4e8..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionBaseCollection/Overview/Input_VB.wsdl +++ /dev/null @@ -1,182 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionBaseCollection/Overview/servicedescriptionbasecollection.vb b/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionBaseCollection/Overview/servicedescriptionbasecollection.vb deleted file mode 100644 index 8959b84b7ef..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionBaseCollection/Overview/servicedescriptionbasecollection.vb +++ /dev/null @@ -1,189 +0,0 @@ -' System.Web.Services.Description.ServiceDescriptionBaseCollection. - -' The following example demonstrates 'ServiceDescriptionBaseCollection' class. -' A 'ServiceDescription' instance is obtained from the existing Wsdl. -' 'MyMethod' takes an instance of 'ServiceDescriptionBaseCollection' as a parameter. -' Instance of different types of collections that were actually derived from -' 'ServiceDescriptionBaseCollection' are passed to my method and modifications of -' corresponding instances in done. - -Imports System.Web.Services.Description -Imports System.Collections -Imports System.Xml - -Class ServiceDescription_Sample - Public Shared myServiceDescription As ServiceDescription - - Public Shared Sub Main() - ' Read a ServiceDescription of existing WSDL. - myServiceDescription = ServiceDescription.Read("Input_VB.wsdl") - ' Get the ServiceCollection of the ServiceDescription. - Dim myServiceCollection As ServiceCollection = myServiceDescription.Services - MyMethod(myServiceCollection) - Dim myBindingCollection As BindingCollection = myServiceDescription.Bindings - MyMethod(myBindingCollection) - Dim myPortTypeCollection As PortTypeCollection = myServiceDescription.PortTypes - MyMethod(myPortTypeCollection) - myServiceDescription.Write("Output.Wsdl") - End Sub - -' - Public Shared Sub MyMethod(myServiceCollection As _ - ServiceDescriptionBaseCollection) - Dim myType As Type = myServiceCollection.GetType() - If myType.Equals( _ - GetType(System.Web.Services.Description.ServiceCollection)) Then - - ' Remove the services at index 0 of the collection. - CType(myServiceCollection, ServiceCollection).Remove( _ - myServiceDescription.Services(0)) - - ' Build a new Service. - Dim myService As New Service() - myService.Name = "MathService" - Dim myXmlQualifiedName As _ - New XmlQualifiedName("s0:MathServiceSoap") - - ' Build a new Port for SOAP. - Dim mySoapPort As New Port() - mySoapPort.Name = "MathServiceSoap" - mySoapPort.Binding = myXmlQualifiedName - Dim mySoapAddressBinding As New SoapAddressBinding() - mySoapAddressBinding.Location = "http://localhost/" & _ - "ServiceDescriptionBaseCollection_VB/AddSubtractService.VB.asmx" - mySoapPort.Extensions.Add(mySoapAddressBinding) - - ' Build a new Port for HTTP-GET. - Dim myXmlQualifiedName2 As _ - New XmlQualifiedName("s0:MathServiceHttpGet") - Dim myHttpGetPort As New Port() - myHttpGetPort.Name = "MathServiceHttpGet" - myHttpGetPort.Binding = myXmlQualifiedName2 - Dim myHttpAddressBinding As New HttpAddressBinding() - myHttpAddressBinding.Location = "http://localhost/" & _ - "ServiceDescriptionBaseCollection_VB/AddSubtractService.VB.asmx" - myHttpGetPort.Extensions.Add(myHttpAddressBinding) - - ' Add the ports to the Service. - myService.Ports.Add(myHttpGetPort) - myService.Ports.Add(mySoapPort) - - ' Add the Service to the ServiceCollection. - myServiceDescription.Services.Add(myService) - Else - If myType.Equals( _ - GetType(System.Web.Services.Description.BindingCollection)) Then - - ' Remove the Binding in the BindingCollection at index 0. - CType(myServiceCollection, BindingCollection).Remove( _ - myServiceDescription.Bindings(0)) - - ' Build a new Binding. - Dim myBinding As New Binding() - myBinding.Name = "MathServiceSoap" - Dim myXmlQualifiedName As _ - New XmlQualifiedName("s0:MathServiceSoap") - myBinding.Type = myXmlQualifiedName - Dim mySoapBinding As New SoapBinding() - mySoapBinding.Transport = "http://schemas.xmlsoap.org/soap/http" - mySoapBinding.Style = SoapBindingStyle.Document - - ' Create the operations for the binding. - Dim addOperationBinding As OperationBinding = _ - CreateOperationBinding("Add", _ - myServiceDescription.TargetNamespace) - Dim subtractOperationBinding As OperationBinding = _ - CreateOperationBinding("Subtract", _ - myServiceDescription.TargetNamespace) - - ' Add the operations to the Binding. - myBinding.Operations.Add(subtractOperationBinding) - myBinding.Operations.Add(addOperationBinding) - myBinding.Extensions.Add(mySoapBinding) - - ' Add the Binding to the Bindings collection. - myServiceDescription.Bindings.Add(myBinding) - Else - If myType.Equals( _ - GetType(System.Web.Services.Description.PortTypeCollection)) Then - - ' Remove the PortType at index 0. - CType(myServiceCollection, PortTypeCollection).Remove( _ - myServiceDescription.PortTypes(0)) - - ' Build a new PortType. - Dim myPortType As New PortType() - myPortType.Name = "MathServiceSoap" - - ' Build an AddOperation for the PortType. - Dim myAddOperation As New Operation() - myAddOperation.Name = "Add" - - ' Build the Input and Output messages for the Operations. - Dim myOperationInputMessage1 As New OperationInput() - Dim myXmlQualifiedName1 As New XmlQualifiedName("s0:AddSoapIn") - myOperationInputMessage1.Message = myXmlQualifiedName1 - - Dim myOperationOutputMessage1 As New OperationOutput() - Dim myXmlQualifiedName2 As New XmlQualifiedName("s0:AddSoapOut") - myOperationOutputMessage1.Message = myXmlQualifiedName2 - - ' Add the messages to the operations. - myAddOperation.Messages.Add(myOperationInputMessage1) - myAddOperation.Messages.Add(myOperationOutputMessage1) - - ' Build an Add Operation for the PortType. - Dim mySubtractOperation As New Operation() - mySubtractOperation.Name = "Subtract" - - ' Build the Input and Output messages for the operations. - Dim myOperationInputMessage2 As New OperationInput() - Dim myXmlQualifiedName3 As _ - New XmlQualifiedName("s0:SubtractSoapIn") - myOperationInputMessage2.Message = myXmlQualifiedName3 - Dim myOperationOutputMessage2 As New OperationOutput() - Dim myXmlQualifiedName4 As _ - New XmlQualifiedName("s0:SubtractSoapOut") - myOperationOutputMessage2.Message = myXmlQualifiedName4 - - ' Add the messages to the operations. - mySubtractOperation.Messages.Add(myOperationInputMessage2) - mySubtractOperation.Messages.Add(myOperationOutputMessage2) - - ' Add the operations to the PortType. - myPortType.Operations.Add(myAddOperation) - myPortType.Operations.Add(mySubtractOperation) - - ' Add the PortType to the collection. - myServiceDescription.PortTypes.Add(myPortType) - End If - End If - End If - End Sub -' - - Public Shared Function CreateOperationBinding(operation As String, _ - targetNamespace As String) As OperationBinding - ' Create OperationBinding instance for operation. - Dim myOperationBinding As New OperationBinding() - myOperationBinding.Name = operation - ' Create InputBinding for operation. - Dim myInputBinding As New InputBinding() - Dim mySoapBodyBinding As New SoapBodyBinding() - mySoapBodyBinding.Use = SoapBindingUse.Literal - myInputBinding.Extensions.Add(mySoapBodyBinding) - ' Create OutputBinding for operation. - Dim myOutputBinding As New OutputBinding() - myOutputBinding.Extensions.Add(mySoapBodyBinding) - ' Add 'InputBinding' and 'OutputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInputBinding - myOperationBinding.Output = myOutputBinding - ' Create extensibility element for 'SoapOperationBinding'. - Dim mySoapOperationBinding As New SoapOperationBinding() - mySoapOperationBinding.Style = SoapBindingStyle.Document - mySoapOperationBinding.SoapAction = targetNamespace + operation - ' Add extensibility element 'SoapOperationBinding' to 'OperationBinding'. - myOperationBinding.Extensions.Add(mySoapOperationBinding) - Return myOperationBinding - End Function 'CreateOperationBinding -End Class diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/.ctor/DataTypes_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/.ctor/DataTypes_VB.wsdl deleted file mode 100644 index d3073f61fd7..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/.ctor/DataTypes_VB.wsdl +++ /dev/null @@ -1,919 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/.ctor/MathService_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/.ctor/MathService_VB.wsdl deleted file mode 100644 index ebf12847cfc..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/.ctor/MathService_VB.wsdl +++ /dev/null @@ -1,659 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/.ctor/servicedescriptioncollection_constructor_add_item.vb b/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/.ctor/servicedescriptioncollection_constructor_add_item.vb deleted file mode 100644 index ee676217b03..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/.ctor/servicedescriptioncollection_constructor_add_item.vb +++ /dev/null @@ -1,44 +0,0 @@ -' System.Web.Services.Description.ServiceDescriptionCollection.ServiceDescriptionCollection() -' System.Web.Services.Description.ServiceDescriptionCollection.Add() -' System.Web.Services.Description.ServiceDescriptionCollection.Item(Int32) - -' The following program demonstrates 'Constructor', 'Add' method and -' 'Item' property of 'ServiceDescriptionCollection' class. It creates an -' instance of 'ServiceDescriptionCollection' and adds -' 'ServiceDescription' objects to the collection. The Item property is used to -' display the TargetNamespace of elements in the collection. -' -' Note: This program requires 'DataTypes_VB.wsdl' and 'MathService_VB.wsdl' -' files to be placed in same directory as that of .exe for running. - -Imports System.Web.Services.Description - -Class MyServiceDescriptionCollection - - Public Shared Sub Main() - Try - Dim myServiceDescription1 As ServiceDescription = _ - ServiceDescription.Read("DataTypes_VB.wsdl") - Dim myServiceDescription2 As ServiceDescription = _ - ServiceDescription.Read("MathService_VB.wsdl") -' -' - ' Create the object of 'ServiceDescriptionCollection' class. - Dim myCollection As New ServiceDescriptionCollection() - ' Add 'ServiceDescription' objects. - myCollection.Add(myServiceDescription1) - myCollection.Add(myServiceDescription2) -' -' -' - ' Display element properties in collection using 'Item' property. - Dim i As Integer - For i = 0 To myCollection.Count - 1 - Console.WriteLine(myCollection(i).TargetNamespace) - Next i -' - Catch e As Exception - Console.WriteLine("The following exception was raised: {0}", e.Message.ToString()) - End Try - End Sub -End Class \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/Contains/DataTypes_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/Contains/DataTypes_VB.wsdl deleted file mode 100644 index d3073f61fd7..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/Contains/DataTypes_VB.wsdl +++ /dev/null @@ -1,919 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/Contains/MathService_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/Contains/MathService_VB.wsdl deleted file mode 100644 index ebf12847cfc..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/Contains/MathService_VB.wsdl +++ /dev/null @@ -1,659 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/Contains/servicedescriptioncollection_contains_indexof_remove.vb b/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/Contains/servicedescriptioncollection_contains_indexof_remove.vb deleted file mode 100644 index 0cd0443b9c2..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/Contains/servicedescriptioncollection_contains_indexof_remove.vb +++ /dev/null @@ -1,53 +0,0 @@ -' System.Web.Services.Description.ServiceDescriptionCollection.Contains() -' System.Web.Services.Description.ServiceDescriptionCollection.IndexOf() -' System.Web.Services.Description.ServiceDescriptionCollection.Remove() - -' The following program demonstrates 'Contains', 'IndexOf' and -' 'Remove' methods of 'ServiceDescriptionCollection' class. It creates an -' instance of 'ServiceDescriptionCollection' and adds 'ServiceDescription' -' objects to the collection. It checks for an object of 'ServiceDescription', -' retrieves the index of the object and removes it from the collection. -' -' Note: This program requires 'DataTypes_VB.wsdl' and 'MathService_VB.wsdl' -' files to be placed in the same directory as that of .exe for -' running. - - -Imports System.Web.Services.Description - - -Class MyServiceDescriptionCollection - - Public Shared Sub Main() - Try - Dim myServiceDescription1 As ServiceDescription = _ - ServiceDescription.Read("DataTypes_VB.wsdl") - Dim myServiceDescription2 As ServiceDescription = _ - ServiceDescription.Read("MathService_VB.wsdl") - Dim myCollection As New ServiceDescriptionCollection() - - ' Add 'ServiceDescription' objects. - myCollection.Add(myServiceDescription1) - myCollection.Add(myServiceDescription2) - -' - ' Check for 'ServiceDescription' object in the collection. - If myCollection.Contains(myServiceDescription2) Then -' -' - ' Get the index of 'ServiceDescription' object. - Dim myIndex As Integer = myCollection.IndexOf(myServiceDescription2) - ' Remove 'ServiceDescription' object from the collection. - myCollection.Remove(myServiceDescription2) - Console.WriteLine("Element at index {0} is removed ", myIndex.ToString()) -' -' - Else - Console.WriteLine("Element not found.") - End If -' - Catch e As Exception - Console.WriteLine("The following exception was raised: {0}", e.Message.ToString()) - End Try - End Sub -End Class \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/CopyTo/DataTypes_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/CopyTo/DataTypes_VB.wsdl deleted file mode 100644 index d3073f61fd7..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/CopyTo/DataTypes_VB.wsdl +++ /dev/null @@ -1,919 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/CopyTo/MathService_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/CopyTo/MathService_VB.wsdl deleted file mode 100644 index ebf12847cfc..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/CopyTo/MathService_VB.wsdl +++ /dev/null @@ -1,659 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/CopyTo/servicedescriptioncollection_insert_item_copyto.vb b/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/CopyTo/servicedescriptioncollection_insert_item_copyto.vb deleted file mode 100644 index 607b9d07c7a..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/CopyTo/servicedescriptioncollection_insert_item_copyto.vb +++ /dev/null @@ -1,55 +0,0 @@ -' System.Web.Services.Description.ServiceDescriptionCollection.Insert() -' System.Web.Services.Description.ServiceDescriptionCollection.Item(String) -' System.Web.Services.Description.ServiceDescriptionCollection.CopyTo() - -' The following program demonstrates 'Item' property, 'Insert' and 'CopyTo' -' methods of the 'ServiceDescriptionCollection' class. It creates an instance of -' 'ServiceDescriptionCollection' and adds 'ServiceDescription' objects to the -' collection. The elements of the collection are copied to a 'ServiceDescription' -' array. -' -' Note: This program requires 'DataTypes_VB.wsdl' and 'MathService_VB.wsdl' -' files to be placed in the same directory as that of .exe for running. - - -Imports System.Web.Services.Description - -Class MyServiceDescriptionCollection - - Public Shared Sub Main() - Try - Dim myServiceDescription1 As ServiceDescription = _ - ServiceDescription.Read("DataTypes_VB.wsdl") - myServiceDescription1.Name = "DataTypes" - Dim myServiceDescription2 As ServiceDescription = _ - ServiceDescription.Read("MathService_VB.wsdl") - myServiceDescription2.Name = "MathService" - - ' Create the object of 'ServiceDescriptionCollection' class. - Dim myCollection As New ServiceDescriptionCollection() - ' Add 'ServiceDescription' objects. - myCollection.Add(myServiceDescription1) -' - ' Insert a 'ServiceDescription' object into the collection. - myCollection.Insert(1, myServiceDescription2) -' -' - ' Get a 'ServiceDescription' object in collection using 'Item'. - Dim myServiceDescription As ServiceDescription = myCollection("http://tempuri1.org/") -' - Console.WriteLine("Name of the object retrieved using 'Item' property: " + _ - myServiceDescription.Name) -' - Dim myArray(myCollection.Count -1 ) As ServiceDescription - ' Copy the collection to a 'ServiceDescription' array. - myCollection.CopyTo(myArray, 0) - Dim i As Integer - For i = 0 To myArray.Length - 1 - Console.WriteLine("Name of element in array: " + myArray(i).Name) - Next i -' - Catch e As Exception - Console.WriteLine("The following exception was raised: {0}", e.Message.ToString()) - End Try - End Sub -End Class \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetBinding/DataTypes_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetBinding/DataTypes_VB.wsdl deleted file mode 100644 index d3073f61fd7..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetBinding/DataTypes_VB.wsdl +++ /dev/null @@ -1,919 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetBinding/MathService_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetBinding/MathService_VB.wsdl deleted file mode 100644 index ebf12847cfc..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetBinding/MathService_VB.wsdl +++ /dev/null @@ -1,659 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetBinding/servicedescriptioncollection_getbinding.vb b/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetBinding/servicedescriptioncollection_getbinding.vb deleted file mode 100644 index d475338d9f2..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetBinding/servicedescriptioncollection_getbinding.vb +++ /dev/null @@ -1,44 +0,0 @@ -' System.Web.Services.Description.ServiceDescriptionCollection.GetBinding() - -' The following program demonstrates the 'GetBinding' method -' of 'ServiceDescriptionCollection' class. It searches for a -' 'Binding' in the collection and returns the Binding instance. -' On success, a message is displayed on the console. -' -' Note: This program requires 'DataTypes_VB.wsdl' and 'MathService_VB.wsdl' -' files to be placed in same directory as that of .exe for running. - -Imports System.Xml -Imports System.Web.Services.Description - - -Class MyServiceDescriptionCollection - - Public Shared Sub Main() - Try - Dim myServiceDescription1 As ServiceDescription = _ - ServiceDescription.Read("DataTypes_VB.wsdl") - Dim myServiceDescription2 As ServiceDescription = _ - ServiceDescription.Read("MathService_VB.wsdl") - - ' Create the object of 'ServiceDescriptionCollection' class. - Dim myCollection As New ServiceDescriptionCollection() - ' Add ServiceDescription objects. - myCollection.Add(myServiceDescription1) - myCollection.Add(myServiceDescription2) -' - ' Construct an XML qualified name. - Dim myXmlQualifiedName As _ - New XmlQualifiedName("MathServiceSoap", "http://tempuri2.org/") - - ' Get the Binding from the collection. - Dim myBinding As Binding = _ - myCollection.GetBinding(myXmlQualifiedName) -' - Console.WriteLine("Specified Binding is a member of ServiceDescription" + _ - " instances within the collection") - Catch e As Exception - Console.WriteLine("The following exception was raised: {0}", e.Message.ToString()) - End Try - End Sub -End Class diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetMessage/DataTypes_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetMessage/DataTypes_VB.wsdl deleted file mode 100644 index d3073f61fd7..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetMessage/DataTypes_VB.wsdl +++ /dev/null @@ -1,919 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetMessage/MathService_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetMessage/MathService_VB.wsdl deleted file mode 100644 index ebf12847cfc..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetMessage/MathService_VB.wsdl +++ /dev/null @@ -1,659 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetMessage/servicedescriptioncollection_getmessage.vb b/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetMessage/servicedescriptioncollection_getmessage.vb deleted file mode 100644 index 70f5f87a68c..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetMessage/servicedescriptioncollection_getmessage.vb +++ /dev/null @@ -1,43 +0,0 @@ -' System.Web.Services.Description.ServiceDescriptionCollection.GetMessage() - -' The following program demonstrates the 'GetMessage' method -' of 'ServiceDescriptionCollection' class. It searches for a -' 'Message' in the collection and returns the Message instance. On success, -' a message is displayed on the console. -' -' Note: This program requires 'DataTypes_VB.wsdl' and 'MathService_VB.wsdl' -' files to be placed in same directory as that of .exe for running. - -Imports System.Xml -Imports System.Web.Services.Description - -Class MyServiceDescriptionCollection - - Public Shared Sub Main() - Try - Dim myServiceDescription1 As ServiceDescription = _ - ServiceDescription.Read("DataTypes_VB.wsdl") - Dim myServiceDescription2 As ServiceDescription = _ - ServiceDescription.Read("MathService_VB.wsdl") - - ' Create the object of 'ServiceDescriptionCollection' class. - Dim myCollection As New ServiceDescriptionCollection() - - ' Add 'ServiceDescription' objects. - myCollection.Add(myServiceDescription1) - myCollection.Add(myServiceDescription2) -' - ' Construct an XML qualified name. - Dim myXmlQualifiedName As _ - New XmlQualifiedName("AddSoapIn", "http://tempuri2.org/") - - ' Get the Message from the collection. - Dim myMessage As Message = myCollection.GetMessage(myXmlQualifiedName) -' - Console.WriteLine("Specified Message is a member of ServiceDescription " + _ - "instances within the collection.") - Catch e As Exception - Console.WriteLine("The following exception was raised: {0}", e.Message.ToString()) - End Try - End Sub -End Class \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetPortType/DataTypes_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetPortType/DataTypes_VB.wsdl deleted file mode 100644 index d3073f61fd7..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetPortType/DataTypes_VB.wsdl +++ /dev/null @@ -1,919 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetPortType/MathService_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetPortType/MathService_VB.wsdl deleted file mode 100644 index ebf12847cfc..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetPortType/MathService_VB.wsdl +++ /dev/null @@ -1,659 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetPortType/servicedescriptioncollection_getporttype.vb b/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetPortType/servicedescriptioncollection_getporttype.vb deleted file mode 100644 index 7ecd6c9ad29..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetPortType/servicedescriptioncollection_getporttype.vb +++ /dev/null @@ -1,42 +0,0 @@ -' System.Web.Services.Description.ServiceDescriptionCollection.GetPortType() - -' The following program demonstrates the 'GetPortType' method -' of 'ServiceDescriptionCollection' class. It searches for a -' 'PortType' with XmlQualifiedName in the collection and returns a -' PortType instance. On success, a message is displayed on the -' console. -' -' Note: This program requires 'DataTypes_VB.wsdl' and 'MathService_VB.wsdl' -' files to be placed in same directory as that of .exe for running. - -Imports System.Xml -Imports System.Web.Services.Description - -Class MyServiceDescriptionCollection - - Public Shared Sub Main() - Try - Dim myServiceDescription1 As ServiceDescription = _ - ServiceDescription.Read("DataTypes_VB.wsdl") - Dim myServiceDescription2 As ServiceDescription = _ - ServiceDescription.Read("MathService_VB.wsdl") - - ' Create the object of 'ServiceDescriptionCollection' class. - Dim myCollection As New ServiceDescriptionCollection() - ' Add 'ServiceDescription' objects. - myCollection.Add(myServiceDescription1) - myCollection.Add(myServiceDescription2) -' - ' Construct an XML qualified name. - Dim myXmlQualifiedName As _ - New XmlQualifiedName("MathServiceSoap", "http://tempuri2.org/") - ' Get the PortType from the collection. - Dim myPort As PortType = myCollection.GetPortType(myXmlQualifiedName) -' - Console.WriteLine("Specified PortType is a member of ServiceDescription " + _ - "instances within the collection.") - Catch e As Exception - Console.WriteLine("The following exception was raised: {0}", e.Message.ToString()) - End Try - End Sub -End Class diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetService/DataTypes_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetService/DataTypes_VB.wsdl deleted file mode 100644 index d3073f61fd7..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetService/DataTypes_VB.wsdl +++ /dev/null @@ -1,919 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetService/MathService_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetService/MathService_VB.wsdl deleted file mode 100644 index ebf12847cfc..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetService/MathService_VB.wsdl +++ /dev/null @@ -1,659 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetService/servicedescriptioncollection_getservice.vb b/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetService/servicedescriptioncollection_getservice.vb deleted file mode 100644 index 5423d05e59f..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/GetService/servicedescriptioncollection_getservice.vb +++ /dev/null @@ -1,44 +0,0 @@ -' System.Web.Services.Description.ServiceDescriptionCollection.GetService() - -' The following program demonstrates the 'GetService' method -' of 'ServiceDescriptionCollection' class. It searches for a -' 'Service' with XmlQualifiedName in the collection and returns -' the Service instance. On success, a message is displayed on the -' console. -' -' Note: This program requires 'DataTypes_VB.wsdl' and 'MathService_VB.wsdl' -' files to be placed in same directory as that of .exe for running. - - -Imports System.Xml -Imports System.Web.Services.Description - -Class MyServiceDescriptionCollection - - Public Shared Sub Main() - Try - Dim myServiceDescription1 As ServiceDescription = _ - ServiceDescription.Read("DataTypes_VB.wsdl") - Dim myServiceDescription2 As ServiceDescription = _ - ServiceDescription.Read("MathService_VB.wsdl") - - ' Create the object of 'ServiceDescriptionCollection' class. - Dim myCollection As New ServiceDescriptionCollection() - ' Add 'ServiceDescription' objects. - myCollection.Add(myServiceDescription1) - myCollection.Add(myServiceDescription2) -' - ' Construct an XML qualified name. - Dim myXmlQualifiedName As _ - New XmlQualifiedName("MathService", "http://tempuri2.org/") - - ' Get the Service from the collection. - Dim myService As Service = myCollection.GetService(myXmlQualifiedName) -' - Console.WriteLine("Specified Service is a member of ServiceDescription " + _ - "instances within the collection") - Catch e As Exception - Console.WriteLine("The following exception was raised: {0}", e.Message.ToString()) - End Try - End Sub -End Class \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/Overview/DataTypes_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/Overview/DataTypes_VB.wsdl deleted file mode 100644 index d3073f61fd7..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/Overview/DataTypes_VB.wsdl +++ /dev/null @@ -1,919 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/Overview/MathService_VB.wsdl b/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/Overview/MathService_VB.wsdl deleted file mode 100644 index ebf12847cfc..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/Overview/MathService_VB.wsdl +++ /dev/null @@ -1,659 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/Overview/servicedescriptioncollection.vb b/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/Overview/servicedescriptioncollection.vb deleted file mode 100644 index 0660890a7bc..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/Overview/servicedescriptioncollection.vb +++ /dev/null @@ -1,61 +0,0 @@ -' System.Web.Services.Description.ServiceDescriptionCollection - -' The following program demonstrates the 'ServiceDescriptionCollection' class. -' It creates two 'ServiceDescription' objects and add them to -' 'ServiceDescriptionCollection' object. It displays the name of 'ServiceDescription' -' objects using 'Item' property. 'GetBinding' method is used to display binding instance of the -' 'ServiceDescription' object. -' -' Note: This program requires 'DataTypes_VB.wsdl' and 'MathService_VB.wsdl' files to -' be placed in same directory as that of .exe for running. - -' -Imports System.Xml -Imports System.Web.Services.Description - -Class MyServiceDescriptionCollection - - Public Shared Sub Main() - Try - ' Get ServiceDescription objects. - Dim myServiceDescription1 As ServiceDescription = _ - ServiceDescription.Read("DataTypes_VB.wsdl") - Dim myServiceDescription2 As ServiceDescription = _ - ServiceDescription.Read("MathService_VB.wsdl") - - ' Set the names of the ServiceDescriptions. - myServiceDescription1.Name = "DataTypes" - myServiceDescription2.Name = "MathService" - - ' Create a ServiceDescriptionCollection. - Dim myServiceDescriptionCollection As _ - New ServiceDescriptionCollection() - - ' Add the ServiceDescriptions to the collection. - myServiceDescriptionCollection.Add(myServiceDescription1) - myServiceDescriptionCollection.Add(myServiceDescription2) - - ' Display the elements of the collection using the Item property. - Console.WriteLine("Elements in the collection: ") - Dim i As Integer - For i = 0 To myServiceDescriptionCollection.Count - 1 - Console.WriteLine(myServiceDescriptionCollection(i).Name) - Next i - - ' Construct an XML qualified name. - Dim myXmlQualifiedName As New XmlQualifiedName( _ - "MathServiceSoap", "http://tempuri2.org/") - - ' Get the Binding from the collection. - Dim myBinding As Binding = _ - myServiceDescriptionCollection.GetBinding(myXmlQualifiedName) - - Console.WriteLine("Binding found in collection with name: " & _ - myBinding.ServiceDescription.Name) - Catch e As Exception - Console.WriteLine("The following exception was raised: {0}", _ - e.Message.ToString()) - End Try - End Sub -End Class -' diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionFormatExtensionCollection/Overview/Sample_VB.WSDL b/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionFormatExtensionCollection/Overview/Sample_VB.WSDL deleted file mode 100644 index 641f3817356..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionFormatExtensionCollection/Overview/Sample_VB.WSDL +++ /dev/null @@ -1,255 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionFormatExtensionCollection/Overview/servicedescriptionformatextension_13.vb b/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionFormatExtensionCollection/Overview/servicedescriptionformatextension_13.vb deleted file mode 100644 index 054158ccaf1..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionFormatExtensionCollection/Overview/servicedescriptionformatextension_13.vb +++ /dev/null @@ -1,138 +0,0 @@ -' System.Web.Services.Description.ServiceDescriptionFormatExtensionCollection -' System.Web.Services.Description.ServiceDescriptionFormatExtensionCollection.ctor -' System.Web.Services.Description.ServiceDescriptionFormatExtensionCollection.Add() -' System.Web.Services.Description.ServiceDescriptionFormatExtensionCollection.Item -' System.Web.Services.Description.ServiceDescriptionFormatExtensionCollection.Find(System.Type type) -' System.Web.Services.Description.ServiceDescriptionFormatExtensionCollection.FindAll(System.Type type) -' System.Web.Services.Description.ServiceDescriptionFormatExtensionCollection.IsHandled() -' System.Web.Services.Description.ServiceDescriptionFormatExtensionCollection.IsRequired() -' System.Web.Services.Description.ServiceDescriptionFormatExtensionCollection.CopyTo() -' System.Web.Services.Description.ServiceDescriptionFormatExtensionCollection.Contains() -' System.Web.Services.Description.ServiceDescriptionFormatExtensionCollection.IndexOf() -' System.Web.Services.Description.ServiceDescriptionFormatExtensionCollection.Remove() -' System.Web.Services.Description.ServiceDescriptionFormatExtensionCollection.Insert() - -' The following program demonstrates the class, properties and methods of -' 'ServiceDescriptionFormatExtensionCollection' -' class. It creates a ServiceDescription object, uses it to create -' 'ServiceDescriptionFormatExtensionCollection' object. Collection -' object is used for demonstration of class properties and methods. - -' Note: This program requires 'Sample_VB.wsdl' file to be placed in -' the same directory as that of .exe for running. - -' -Imports System.Web.Services.Description -Imports System.Collections - - -Class MyFormatExtension - Inherits ServiceDescriptionFormatExtension - - Public Sub New() - ' Set the properties. - Me.Handled = True - Me.Required = True - End Sub -End Class - -Class myCollectionSample - - Shared Sub Main() - Try -' - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("Sample_VB.wsdl") - Dim myCollection As New ServiceDescriptionFormatExtensionCollection(myServiceDescription) -' -' - Dim mySoapBinding1 As New SoapBinding() - Dim mySoapBinding2 As New SoapBinding() - Dim mySoapAddressBinding As New SoapAddressBinding() - Dim myFormatExtensionObject As New MyFormatExtension() - ' Add elements to collection. - myCollection.Add(mySoapBinding1) - myCollection.Add(mySoapAddressBinding) - myCollection.Add(mySoapBinding2) - myCollection.Add(myFormatExtensionObject) -' -' - Console.WriteLine("Collection contains following types of elements: ") - ' Display the 'Type' of the elements in collection. - Dim i As Integer - For i = 0 To myCollection.Count - 1 - Console.WriteLine(myCollection(i).GetType().ToString()) - Next i -' -' - ' Check element of type 'SoapAddressBinding' in collection. - Dim myObj As Object = myCollection.Find(mySoapAddressBinding.GetType()) - If myObj Is Nothing Then - Console.WriteLine("Element of type '{0}' not found in collection.", _ - mySoapAddressBinding.GetType().ToString()) - Else - Console.WriteLine("Element of type '{0}' found in collection.", _ - mySoapAddressBinding.GetType().ToString()) - End If -' -' - ' Check all elements of type 'SoapBinding' in collection. - Dim myObjectArray1(myCollection.Count -1 ) As Object - myObjectArray1 = myCollection.FindAll(mySoapBinding1.GetType()) - Dim myNumberOfElements As Integer = 0 - Dim myIEnumerator As IEnumerator = myObjectArray1.GetEnumerator() - - ' Calculate number of elements of type 'SoapBinding'. - While myIEnumerator.MoveNext() - If mySoapBinding1.GetType() Is myIEnumerator.Current.GetType() Then - myNumberOfElements += 1 - End If - End While - Console.WriteLine("Collection contains {0} objects of type '{1}'.", _ - myNumberOfElements.ToString(), mySoapBinding1.GetType().ToString()) -' -' - ' Check 'IsHandled' status for 'myFormatExtensionObject' object in collection. - Console.WriteLine("'IsHandled' status for {0} object is {1}.", _ - myFormatExtensionObject.ToString(), _ - myCollection.IsHandled(myFormatExtensionObject).ToString()) -' -' - ' Check 'IsRequired' status for 'myFormatExtensionObject' object in collection. - Console.WriteLine("'IsRequired' status for {0} object is {1}.", _ - myFormatExtensionObject.ToString(), _ - myCollection.IsRequired(myFormatExtensionObject).ToString()) -' -' - ' Copy elements of collection to an Object array. - Dim myObjectArray2(myCollection.Count -1 ) As Object - myCollection.CopyTo(myObjectArray2, 0) - Console.WriteLine("Collection elements are copied to an object array.") -' -' - ' Check for 'myFormatExtension' object in collection. - If myCollection.Contains(myFormatExtensionObject) Then -' - ' Get index of a 'myFormatExtension' object in collection. - Console.WriteLine("Index of 'myFormatExtensionObject' is " + _ - "{0} in collection.", myCollection.IndexOf(myFormatExtensionObject).ToString()) -' -' - ' Remove 'myFormatExtensionObject' element from collection. - myCollection.Remove(myFormatExtensionObject) - Console.WriteLine("'myFormatExtensionObject' is removed" + _ - " from collection.") -' - End If -' -' - ' Insert 'MyFormatExtension' object. - myCollection.Insert(0, myFormatExtensionObject) - Console.WriteLine("'myFormatExtensionObject' is inserted to collection.") -' - Catch e As Exception - Console.WriteLine("The following exception was raised: {0}", e.Message.ToString()) - End Try - End Sub -End Class -' \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionImportStyle/Overview/Sample_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionImportStyle/Overview/Sample_vb.wsdl deleted file mode 100644 index 1f7ce73c99a..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionImportStyle/Overview/Sample_vb.wsdl +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/SoapAddressBinding/Overview/AddNumbersInput_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/SoapAddressBinding/Overview/AddNumbersInput_vb.wsdl deleted file mode 100644 index a3ca0ae32e5..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/SoapAddressBinding/Overview/AddNumbersInput_vb.wsdl +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/SoapAddressBinding/Overview/soapoperationbinding.vb b/snippets/visualbasic/System.Web.Services.Description/SoapAddressBinding/Overview/soapoperationbinding.vb deleted file mode 100644 index 9ec76c1a8b5..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/SoapAddressBinding/Overview/soapoperationbinding.vb +++ /dev/null @@ -1,98 +0,0 @@ -' System.Web.Services.Description.SoapBinding -' System.Web.Services.Description.SoapOperationBinding -' System.Web.Services.Description.SoapBodyBinding -' System.Web.Services.Description.SoapAddressBinding -' System.Web.Services.Description.SoapBinding.HttpTransport; - -' The following example demonstrates the 'SoapBinding', 'SoapOperationBinding' , -' 'SoapBodyBinding' , SoapAddressBinding' classes and 'HttpTransport' field of -' 'SoapBinding' class. - -' It takes a wsdl file which supports two protocols 'HttpGet' and 'HttpPost' as -' input. By using the 'Read' method of 'ServiceDescription' class it gets the -' 'ServiceDescription' object. It uses the SOAP protocol related classes and -' creates 'Binding','Port' and 'PortType' elements of 'SOAP' protocol. It adds -' all the elements to the 'ServiceDescription' object. The 'ServiceDescription' -' object creates another wsdl file which supports 'SOAP' also. This wsdl file -' is used to generate a proxy which is used by the .aspx file. - -' -' -' -' -Imports System.Web.Services.Description -Imports System.Collections -Imports System.Xml - -Class MySoapClass - Public Shared Sub Main() - Dim myDescription As ServiceDescription = _ - ServiceDescription.Read("AddNumbersInput_vb.wsdl") - ' Create a 'Binding' object for the 'SOAP' protocol. - Dim myBinding As New Binding() - myBinding.Name = "Service1Soap" - Dim qualifiedName As New XmlQualifiedName("s0:Service1Soap") - myBinding.Type = qualifiedName - -' - Dim mySoapBinding As New SoapBinding() - mySoapBinding.Transport = SoapBinding.HttpTransport - mySoapBinding.Style = SoapBindingStyle.Document -' - - ' Add the 'SoapBinding' object to the 'Binding' object. - myBinding.Extensions.Add(mySoapBinding) - - ' Create the 'OperationBinding' object for the 'SOAP' protocol. - Dim myOperationBinding As New OperationBinding() - myOperationBinding.Name = "AddNumbers" - - ' Create the 'SoapOperationBinding' object for the 'SOAP' protocol. - Dim mySoapOperationBinding As New SoapOperationBinding() - mySoapOperationBinding.SoapAction = "http://tempuri.org/AddNumbers" - mySoapOperationBinding.Style = SoapBindingStyle.Document - ' Add the 'SoapOperationBinding' object to 'OperationBinding' object. - myOperationBinding.Extensions.Add(mySoapOperationBinding) - - ' Create the 'InputBinding' object for the 'SOAP' protocol. - Dim myInput As New InputBinding() - Dim mySoapBinding1 As New SoapBodyBinding() - mySoapBinding1.Use = SoapBindingUse.Literal - myInput.Extensions.Add(mySoapBinding1) - ' Assign the 'InputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInput - ' Create the 'OutputBinding' object' for the 'SOAP' protocol. - Dim myOutput As New OutputBinding() - myOutput.Extensions.Add(mySoapBinding1) - ' Assign the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding.Output = myOutput - - ' Add the 'OperationBinding' to 'Binding'. - myBinding.Operations.Add(myOperationBinding) - - ' Add the 'Binding' to 'BindingCollection' of 'ServiceDescription'. - myDescription.Bindings.Add(myBinding) - - Dim soapPort As New Port() - soapPort.Name = "Service1Soap" - soapPort.Binding = New XmlQualifiedName("s0:Service1Soap") - - ' Create a 'SoapAddressBinding' object for the 'SOAP' protocol. - Dim mySoapAddressBinding As New SoapAddressBinding() - mySoapAddressBinding.Location = "http://localhost/AddNumbers.vb.asmx" - - ' Add the 'SoapAddressBinding' to the 'Port'. - soapPort.Extensions.Add(mySoapAddressBinding) - - ' Add the 'Port' to 'PortCollection' of 'ServiceDescription'. - myDescription.Services(0).Ports.Add(soapPort) - - ' Write the 'ServiceDescription' as a WSDL file. - myDescription.Write("AddNumbersOut_vb.wsdl") - Console.WriteLine(" 'AddNumbersOut_vb.Wsdl' file was generated") - End Sub -End Class -' -' -' -' \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/SoapBinding/Namespace/AddNumbersInput_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/SoapBinding/Namespace/AddNumbersInput_vb.wsdl deleted file mode 100644 index c4f352b0ed6..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/SoapBinding/Namespace/AddNumbersInput_vb.wsdl +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/SoapBinding/Namespace/Service1_vb.asmx b/snippets/visualbasic/System.Web.Services.Description/SoapBinding/Namespace/Service1_vb.asmx deleted file mode 100644 index 41135426dca..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/SoapBinding/Namespace/Service1_vb.asmx +++ /dev/null @@ -1,18 +0,0 @@ -<%@ WebService Language="VB" Class="Service1" %> - -Imports System -Imports System.Collections -Imports System.ComponentModel -Imports System.Data -Imports System.Diagnostics -Imports System.Web -Imports System.Web.Services - -Public Class Service1 - Inherits WebService - _ - Public Function AddNumbers(firstNumber As Integer, secondNumber As Integer) As Integer - Return firstNumber + secondNumber - End Function 'AddNumbers -End Class 'Service1 - diff --git a/snippets/visualbasic/System.Web.Services.Description/SoapBinding/Namespace/soapbodybinding_parts.vb b/snippets/visualbasic/System.Web.Services.Description/SoapBinding/Namespace/soapbodybinding_parts.vb deleted file mode 100644 index 90d3217ae6e..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/SoapBinding/Namespace/soapbodybinding_parts.vb +++ /dev/null @@ -1,79 +0,0 @@ -' System.Web.Services.Description.SoapBinding.Namespace -' System.Web.Services.Description.SoapBodyBinding.Parts - -' The following example demonstrates the 'Namespace' field of 'SoapBinding' class -' and 'parts' property of 'SoapBodyBinding' class. -' It takes a wsdl file which supports two protocols 'HttpGet' and 'HttpPost' as input. By -' using the 'Read' method of 'ServiceDescription' class it gets the 'ServiceDescription' -' object. It uses the SOAP protocol related classes to create 'Binding' elements of -' 'SOAP' protocol. It adds all the elements to the 'ServiceDescription' object. The -' 'ServiceDescription' object creates another wsdl file which supports 'SOAP' protocol -' also. This wsdl file is used to generate a proxy which is used by the .aspx file. - -Imports System.Web.Services.Description -Imports System.Collections -Imports System.Xml - -Class MySoapClass - - Public Shared Sub Main() - Dim myDescription As ServiceDescription = ServiceDescription.Read("AddNumbersInput_vb.wsdl") - ' Create a 'Binding' object for the 'SOAP' protocol. - Dim myBinding As New Binding() - myBinding.Name = "Service1Soap" - Dim qualifiedName As New XmlQualifiedName("s0:Service1Soap") - - myBinding.Type = qualifiedName -' - Dim mySoapBinding As New SoapBinding() - mySoapBinding.Transport = "http://schemas.xmlsoap.org/soap/http" - mySoapBinding.Style = SoapBindingStyle.Document - ' Get the URI for XML namespace of the SoapBinding class. - Dim myNameSpace As String = SoapBinding.Namespace - Console.WriteLine("The URI of the XML Namespace is :" + myNameSpace) -' - ' Add the 'SoapBinding' object to the 'Binding' object. - myBinding.Extensions.Add(mySoapBinding) - - ' Create the 'OperationBinding' object for the 'SOAP' protocol. - Dim myOperationBinding As New OperationBinding() - myOperationBinding.Name = "AddNumbers" - - ' Create the 'SoapOperationBinding' object for the 'SOAP' protocol. - Dim mySoapOperationBinding As New SoapOperationBinding() - mySoapOperationBinding.SoapAction = "http://tempuri.org/AddNumbers" - mySoapOperationBinding.Style = SoapBindingStyle.Document - ' Add the 'SoapOperationBinding' object to 'OperationBinding' object. - myOperationBinding.Extensions.Add(mySoapOperationBinding) - -' - ' Create the 'InputBinding' object for the 'SOAP' protocol. - Dim myInput As New InputBinding() - Dim mySoapBinding1 As New SoapBodyBinding() - mySoapBinding1.Use = SoapBindingUse.Literal - - Dim myParts(0) As String - myParts(0) = "parameters" - ' Set the names of the message parts to appear in the SOAP body. - mySoapBinding1.Parts = myParts - myInput.Extensions.Add(mySoapBinding1) - ' Add the 'InputBinding' object to 'OperationBinding' object. - myOperationBinding.Input = myInput - ' Create the 'OutputBinding' object'. - Dim myOutput As New OutputBinding() - myOutput.Extensions.Add(mySoapBinding1) - - ' Add the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding.Output = myOutput -' - ' Add the 'OperationBinding' to 'Binding'. - myBinding.Operations.Add(myOperationBinding) - - ' Add the 'Binding' to 'BindingCollection' of 'ServiceDescription'. - myDescription.Bindings.Add(myBinding) - - ' Write the 'ServiceDescription' as a WSDL file. - myDescription.Write("AddNumbersOut_vb.wsdl") - Console.WriteLine(" 'AddNumbersOut_vb.Wsdl' file was generated") - End Sub -End Class \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/SoapBinding/Style/AddNumbersInput_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/SoapBinding/Style/AddNumbersInput_vb.wsdl deleted file mode 100644 index 2c93e30884e..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/SoapBinding/Style/AddNumbersInput_vb.wsdl +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/SoapBinding/Style/Service1_vb.asmx b/snippets/visualbasic/System.Web.Services.Description/SoapBinding/Style/Service1_vb.asmx deleted file mode 100644 index 40d6454911e..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/SoapBinding/Style/Service1_vb.asmx +++ /dev/null @@ -1,16 +0,0 @@ -<%@ WebService Language="VB" Class="Service1" %> -Imports System -Imports System.Collections -Imports System.ComponentModel -Imports System.Data -Imports System.Diagnostics -Imports System.Web -Imports System.Web.Services - -Public Class Service1 - Inherits WebService - _ - Public Function AddNumbers(firstNumber As Integer, secondNumber As Integer) As Integer - Return firstNumber + secondNumber - End Function 'AddNumbers -End Class 'Service1 diff --git a/snippets/visualbasic/System.Web.Services.Description/SoapBinding/Style/soapprotocol.vb b/snippets/visualbasic/System.Web.Services.Description/SoapBinding/Style/soapprotocol.vb deleted file mode 100644 index 3011a7cef7f..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/SoapBinding/Style/soapprotocol.vb +++ /dev/null @@ -1,166 +0,0 @@ -' System.Web.Services.Description.SoapBinding.ctor -' System.Web.Services.Description.SoapBinding.Transport -' System.Web.Services.Description.SoapBinding.Style -' System.Web.Services.Description.SoapBindingStyle.Document -' System.Web.Services.Description.SoapOperationBinding.ctor -' System.Web.Services.Description.SoapOperationBinding.SoapAction -' System.Web.Services.Description.SoapOperationBinding.Style -' System.Web.Services.Description.SoapBodyBinding.ctor -' System.Web.Services.Description.SoapBodyBinding.Use -' System.Web.Services.Description.SoapBindingUse.Literal -' System.Web.Services.Description.SoapAddressBinding.ctor -' System.Web.Services.Description.SoapAddressBinding.Location - -' The following example demonstrates the 'SoapBinding' constructor,'Transport','Style' -' properties of 'SoapBinding' class,'Document' member of 'SoapBindingStyle' enum, -' 'SoapOperationBinding' constructor,'SoapAction','Style' properties of 'SoapOperationBinding' -' class, 'SoapBodyBinding' contructor,'Use' property of 'SoapBodyBinding' class, -' 'Literal' member of 'SoapBindingUse' enum and 'SoapAddressBinding' constructor, 'Location' -' property of class 'SoapAddressBinding'. - -' It takes as input a wsdl file which supports two protocols 'HttpGet' and 'HttpPost' . -' By using the 'Read' method of 'ServiceDescription' class it gets a 'ServiceDescription' -' object. It uses the SOAP protocol related classes and creates 'Binding','Port', -' 'PortType' and 'Message' elements of 'SOAP' protocol. It adds all these elements to -' the 'ServiceDescription' object. The 'ServiceDescription' object creates another -' wsdl file which supports 'SOAP' also. This wsdl file is used to generate a proxy -' which is used by the .aspx file. -' Note: To run the example run the make file provided and open the '.aspx' file in browser. - -Imports System.Web.Services.Description -Imports System.Collections -Imports System.Xml - -Class MySoapClass - - Public Shared Sub Main() - Dim myDescription As ServiceDescription = _ - ServiceDescription.Read("AddNumbersInput_vb.wsdl") - ' Create a 'Binding' object for the 'SOAP' protocol. - Dim myBinding As New Binding() - myBinding.Name = "Service1Soap" - Dim qualifiedName As New XmlQualifiedName("s0:Service1Soap") - myBinding.Type = qualifiedName - -' -' -' -' - Dim mySoapBinding As New SoapBinding() - mySoapBinding.Transport = "http://schemas.xmlsoap.org/soap/http" - mySoapBinding.Style = SoapBindingStyle.Document - ' Add the 'SoapBinding' object to the 'Binding' object. - myBinding.Extensions.Add(mySoapBinding) -' -' -' -' - - ' Create the 'OperationBinding' object for the 'SOAP' protocol. - Dim myOperationBinding As New OperationBinding() - myOperationBinding.Name = "AddNumbers" - -' -' -' - ' Create the 'SoapOperationBinding' object for the 'SOAP' protocol. - Dim mySoapOperationBinding As New SoapOperationBinding() - mySoapOperationBinding.SoapAction = "http://tempuri.org/AddNumbers" - mySoapOperationBinding.Style = SoapBindingStyle.Document - ' Add the 'SoapOperationBinding' object to 'OperationBinding' object. - myOperationBinding.Extensions.Add(mySoapOperationBinding) -' -' -' - -' -' -' - ' Create the 'InputBinding' object for the 'SOAP' protocol. - Dim myInput As New InputBinding() - Dim mySoapBinding1 As New SoapBodyBinding() - mySoapBinding1.Use = SoapBindingUse.Literal - myInput.Extensions.Add(mySoapBinding1) - ' Add the 'InputBinding' object to 'OperationBinding' object. - myOperationBinding.Input = myInput - ' Create the 'OutputBinding' object'. - Dim myOutput As New OutputBinding() - myOutput.Extensions.Add(mySoapBinding1) - ' Add the 'OutputBinding' object to 'OperationBinding' object. - myOperationBinding.Output = myOutput - ' Add the 'OperationBinding' object to 'Binding' object. - myBinding.Operations.Add(myOperationBinding) - ' Add the 'Binding' object to the ServiceDescription instance. - myDescription.Bindings.Add(myBinding) -' -' -' - -' -' - Dim soapPort As New Port() - soapPort.Name = "Service1Soap" - soapPort.Binding = New XmlQualifiedName("s0:Service1Soap") - ' Create a 'SoapAddressBinding' object for the 'SOAP' protocol. - Dim mySoapAddressBinding As New SoapAddressBinding() - mySoapAddressBinding.Location = "http://localhost/Service1_vb.asmx" - ' Add the 'SoapAddressBinding' object to the 'Port'. - soapPort.Extensions.Add(mySoapAddressBinding) - ' Add the 'Port' object to the ServiceDescription instance. - myDescription.Services(0).Ports.Add(soapPort) -' -' - - ' Create a 'PortType' object. for SOAP protocol. - Dim soapPortType As New PortType() - soapPortType.Name = "Service1Soap" - Dim soapOperation As New Operation() - soapOperation.Name = "AddNumbers" - - Dim soapInput As OperationMessage = _ - CType(New OperationInput(), OperationMessage) - soapInput.Message = New XmlQualifiedName("s0:AddNumbersSoapIn") - Dim soapOutput As OperationMessage = _ - CType(New OperationOutput(), OperationMessage) - soapOutput.Message = New XmlQualifiedName("s0:AddNumbersSoapOut") - - soapOperation.Messages.Add(soapInput) - soapOperation.Messages.Add(soapOutput) - - ' Add the 'Operation' object to 'PortType' object. - soapPortType.Operations.Add(soapOperation) - - ' Add the 'PortType' object first to 'PortTypeCollection' object - ' and then to 'ServiceDescription' object. - myDescription.PortTypes.Add(soapPortType) - - ' Create the 'Message' object. - Dim soapMessage1 As New Message() - soapMessage1.Name = "AddNumbersSoapIn" - ' Create the 'MessageParts' object. - Dim soapMessagePart1 As New MessagePart() - soapMessagePart1.Name = "parameters" - soapMessagePart1.Element = New XmlQualifiedName("s0:AddNumbers") - - ' Add the 'MessagePart' object to 'Messages' object. - soapMessage1.Parts.Add(soapMessagePart1) - - ' Create another 'Message' object. - Dim soapMessage2 As New Message() - soapMessage2.Name = "AddNumbersSoapOut" - - Dim soapMessagePart2 As New MessagePart() - soapMessagePart2.Name = "parameters" - soapMessagePart2.Element = New XmlQualifiedName("s0:AddNumbersResponse") - ' Add the 'MessagePart' object to second 'Message' object. - soapMessage2.Parts.Add(soapMessagePart2) - - ' Add the 'Message' objects to 'ServiceDescription'. - myDescription.Messages.Add(soapMessage1) - myDescription.Messages.Add(soapMessage2) - - ' Write the 'ServiceDescription' object as a WSDL file. - myDescription.Write("AddNumbersOut_vb.wsdl") - Console.WriteLine(" 'AddNumbersOut.Wsdl' file was generated") - End Sub -End Class \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/SoapBodyBinding/Encoding/SoapBindingStyleInput_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/SoapBodyBinding/Encoding/SoapBindingStyleInput_vb.wsdl deleted file mode 100644 index c6c686f671b..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/SoapBodyBinding/Encoding/SoapBindingStyleInput_vb.wsdl +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/SoapBodyBinding/Encoding/soapbindingstyle_rpc.vb b/snippets/visualbasic/System.Web.Services.Description/SoapBodyBinding/Encoding/soapbindingstyle_rpc.vb deleted file mode 100644 index de22a5ca592..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/SoapBodyBinding/Encoding/soapbindingstyle_rpc.vb +++ /dev/null @@ -1,101 +0,0 @@ -' System.Web.Services.Description.SoapBindingStyle.Rpc -' System.Web.Services.Description.SoapBindingUse.Encoded -' System.Web.Services.Description.SoapBodyBinding.Encoding -' System.Web.Services.Description.SoapBodyBinding.Namespace -' System.Web.Services.Description.SoapHeaderBinding.Encoding -' System.Web.Services.Description.SoapHeaderBinding.Namespace - -' The following example demonstrates the 'Rpc' member of 'SoapBindingStyle' -' enumeration ,'Encoded' member of 'SoapBindingUse' enumeration ,'Encoding' -' and 'Namespace' properties of 'SoapBodyBinding' class and 'Encoding' -' and 'Namespace' properties of 'SoapHeaderBinding' class. -' It takes as input a wsdl file which does not contain a binding for SOAP. -' By using the 'Read' method of 'ServiceDescription' class it gets a 'ServiceDescription' object. -' It uses the SOAP protocol related classes and creates 'Binding' element -' of 'SOAP' protocol which are then added to the 'ServiceDescription' object. -' An output wsdl file is generated from 'ServiceDescription' object which -' could be used for generating a proxy. - -Imports System.Web.Services.Description -Imports System.Collections -Imports System.Xml - -Public Class MySoapBindingClass - - Public Shared Sub Main() - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("SoapBindingStyleInput_vb.wsdl") - Dim myBinding As New Binding() - myBinding.Name = "SOAPSvrMgr_SOAPBinding" - myBinding.Type = New XmlQualifiedName("tns:SOAPSvrMgr_portType") - -' - Dim mySoapBinding As New SoapBinding() - mySoapBinding.Transport = "http://schemas.xmlsoap.org/soap/http" - ' Message to be transmitted contains parameters to call a procedure. - mySoapBinding.Style = SoapBindingStyle.Rpc - myBinding.Extensions.Add(mySoapBinding) -' - - Dim myOperationBinding As New OperationBinding() - myOperationBinding.Name = "GetServerStats" - - Dim mySoapOperationBinding As New SoapOperationBinding() - mySoapOperationBinding.SoapAction = "http://tempuri.org/soapsvcmgr/GetServerStats" - myOperationBinding.Extensions.Add(mySoapOperationBinding) - - ' Create InputBinding for operation for the 'SOAP' protocol. - Dim myInputBinding As New InputBinding() -' -' -' - Dim mySoapBodyBinding As New SoapBodyBinding() - ' Encode SOAP body using rules specified by the 'Encoding' property. - mySoapBodyBinding.Use = SoapBindingUse.Encoded - ' Set URI representing the encoding style for encoding the body. - mySoapBodyBinding.Encoding = "http://schemas.xmlsoap.org/soap/encoding/" - ' Set the Uri representing the location of the specification - ' for encoding of content not defined by 'Encoding' property'. - mySoapBodyBinding.Namespace = "http://tempuri.org/soapsvcmgr/" - myInputBinding.Extensions.Add(mySoapBodyBinding) -' -' -' - -' -' - Dim mySoapHeaderBinding As New SoapHeaderBinding() - mySoapHeaderBinding.Message = New XmlQualifiedName("tns:Soapsvcmgr_Headers_Request") - mySoapHeaderBinding.Part = "AuthCS" - ' Encode SOAP header using rules specified by the 'Encoding' property. - mySoapHeaderBinding.Use = SoapBindingUse.Encoded - ' Set URI representing the encoding style for encoding the header. - mySoapHeaderBinding.Encoding = "http://schemas.xmlsoap.org/soap/encoding/" - ' Set the Uri representing the location of the specification - ' for encoding of content not defined by 'Encoding' property'. - mySoapHeaderBinding.Namespace = "http://tempuri.org/SOAPSvr/soapsvcmgr/headers.xsd" - ' Add mySoapHeaderBinding to the 'myInputBinding' object. - myInputBinding.Extensions.Add(mySoapHeaderBinding) -' -' - - ' Create OutputBinding for operation. - Dim myOutputBinding As New OutputBinding() - myOutputBinding.Extensions.Add(mySoapBodyBinding) - mySoapHeaderBinding.Part = "AuthSC" - mySoapHeaderBinding.Message = _ - New XmlQualifiedName("tns:Soapsvcmgr_Headers_Response") - myOutputBinding.Extensions.Add(mySoapHeaderBinding) - - ' Add 'InputBinding' and 'OutputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInputBinding - myOperationBinding.Output = myOutputBinding - myBinding.Operations.Add(myOperationBinding) - - myServiceDescription.Bindings.Add(myBinding) - myServiceDescription.Write("SoapBindingStyleOutput_vb.wsdl") - Console.WriteLine("'SoapBindingStyleOutput_vb.wsdl' file is generated.") - Console.WriteLine("Proxy could be created using command" + _ - " 'wsdl /language:VB SoapBindingStyleOutput_vb.wsdl'") - End Sub -End Class \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/SoapBodyBinding/PartsString/SoapFaultInput_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/SoapBodyBinding/PartsString/SoapFaultInput_vb.wsdl deleted file mode 100644 index 03b34dee9a3..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/SoapBodyBinding/PartsString/SoapFaultInput_vb.wsdl +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/SoapBodyBinding/PartsString/soapfaultbinding_ctor.vb b/snippets/visualbasic/System.Web.Services.Description/SoapBodyBinding/PartsString/soapfaultbinding_ctor.vb deleted file mode 100644 index 194a399fe1e..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/SoapBodyBinding/PartsString/soapfaultbinding_ctor.vb +++ /dev/null @@ -1,89 +0,0 @@ -' System.Web.Services.Description.SoapBodyBinding.PartsString -' System.Web.Services.Description.SoapFaultBinding.ctor -' System.Web.Services.Description.SoapFaultBinding.Use -' System.Web.Services.Description.SoapFaultBinding.Encoding -' System.Web.Services.Description.SoapFaultBinding.NameSpace - -' The following example demonstrates the 'PartsString' property of 'SoapBodyBinding' class. -' and constructor, 'Encoding', 'NameSpace' and 'Use'properties of 'SoapFaultBinding' class and - -' It creates an instance of 'ServiceDescription' class by reading an existing -' wsdl file. Then it creates an instance of 'SoapFaultBinding' and adds it to -' the collection object of 'Binding' class. It generates a new wsdl file where -' the properties of 'SoapFaultBinding' objects are reflected and which could be -' used for generating a proxy. - -Imports System.Web.Services.Description - -Public Class MySoapFaultBindingSample - Public Shared Sub Main() - Try - ' Input wsdl file. - Dim myInputWsdlFile As String = "SoapFaultInput_vb.wsdl" - ' Output wsdl file. - Dim myOutputWsdlFile As String = "SoapFaultOutput_vb.wsdl" - ' Initialize an instance of a 'ServiceDescription' object. - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read(myInputWsdlFile) - ' Get a SOAP binding object with binding name "MyService1Soap". - Dim myBinding As Binding = myServiceDescription.Bindings("MyService1Soap") - ' Create the 'OperationBinding' object for the 'SOAP' protocol. - Dim myOperationBinding As New OperationBinding() - myOperationBinding.Name = "Add" - - ' Create the 'SoapOperationBinding' object for the 'SOAP' protocol. - Dim mySoapOperationBinding As New SoapOperationBinding() - mySoapOperationBinding.SoapAction = "http://tempuri.org/Add" - mySoapOperationBinding.Style = SoapBindingStyle.Document - ' Add the 'SoapOperationBinding' object to 'OperationBinding' object. - myOperationBinding.Extensions.Add(mySoapOperationBinding) -' - ' Create the 'InputBinding' object for the 'SOAP' protocol. - Dim myInput As New InputBinding() - Dim mySoapBinding1 As New SoapBodyBinding() - mySoapBinding1.PartsString = "parameters" - mySoapBinding1.Use = SoapBindingUse.Literal - myInput.Extensions.Add(mySoapBinding1) - ' Assign the 'InputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInput - ' Create the 'OutputBinding' object' for the 'SOAP' protocol.. - Dim myOutput As New OutputBinding() - myOutput.Extensions.Add(mySoapBinding1) - ' Assign the 'OutPutBinding' to 'OperationBinding'. - myOperationBinding.Output = myOutput -' - -' -' -' -' - ' Create a new instance of 'SoapFaultBinding' class. - Dim mySoapFaultBinding As New SoapFaultBinding() - ' Encode fault message using rules specified by 'Encoding' property. - mySoapFaultBinding.Use = SoapBindingUse.Encoded - ' Set the URI representing the encoding style. - mySoapFaultBinding.Encoding = "http://tempuri.org/stockquote" - ' Set the URI representing the location of the specification - ' for encoding of content not defined by 'Encoding' property'. - mySoapFaultBinding.Namespace = "http://tempuri.org/stockquote" - ' Create a new instance of 'FaultBinding'. - Dim myFaultBinding As New FaultBinding() - myFaultBinding.Name = "AddFaultbinding" - myFaultBinding.Extensions.Add(mySoapFaultBinding) - ' Get existing 'OperationBinding' object. - myOperationBinding.Faults.Add(myFaultBinding) - myBinding.Operations.Add(myOperationBinding) -' -' -' -' - ' Create a new wsdl file. - myServiceDescription.Write(myOutputWsdlFile) - Console.WriteLine("The new wsdl file created is :" + myOutputWsdlFile) - Console.WriteLine("Proxy could be created using command : wsdl /language:VB " + _ - myOutputWsdlFile) - Catch e As Exception - Console.WriteLine("Error occurred : " + e.Message) - End Try - End Sub -End Class diff --git a/snippets/visualbasic/System.Web.Services.Description/SoapFaultBinding/Overview/SoapFaultBindingInput_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/SoapFaultBinding/Overview/SoapFaultBindingInput_vb.wsdl deleted file mode 100644 index de9a64d0e51..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/SoapFaultBinding/Overview/SoapFaultBindingInput_vb.wsdl +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/SoapFaultBinding/Overview/soapfaultbinding.vb b/snippets/visualbasic/System.Web.Services.Description/SoapFaultBinding/Overview/soapfaultbinding.vb deleted file mode 100644 index 4e5804d53d1..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/SoapFaultBinding/Overview/soapfaultbinding.vb +++ /dev/null @@ -1,50 +0,0 @@ -' System.Web.Services.Description.SoapFaultBinding - -' The following example demonstrates 'SoapFaultBinding' class. -' It creates an instance of 'ServiceDescription' class by reading an existing -' wsdl file. Then it creates an instance of 'SoapFaultBinding' and adds it to -' the collection object of 'Binding' class. It generates a new wsdl file where -' the properties of 'SoapFaultBinding' objects are reflected and which could be -' used for generating a proxy. - -' -Imports System.Web.Services.Description - -Public Class MySoapFaultBindingSample - - Public Shared Sub Main() - Try - ' Input wsdl file. - Dim myInputWsdlFile As String = "SoapFaultBindingInput_vb.wsdl" - ' Output wsdl file. - Dim myOutputWsdlFile As String = "SoapFaultBindingOutput_vb.wsdl" - ' Initialize an instance of a 'ServiceDescription' object. - Dim myServiceDescription As ServiceDescription = ServiceDescription.Read(myInputWsdlFile) - ' Get a SOAP binding object with binding name "MyService1Soap". - Dim myBinding As Binding = myServiceDescription.Bindings("MyService1Soap") - ' Create a new instance of 'SoapFaultBinding' class. - Dim mySoapFaultBinding As New SoapFaultBinding() - ' Encode fault message using rules specified by 'Encoding' property. - mySoapFaultBinding.Use = SoapBindingUse.Encoded - ' Set the URI representing the encoding style. - mySoapFaultBinding.Encoding = "http://tempuri.org/stockquote" - ' Set the URI representing the location of the specification - ' for encoding of content not defined by 'Encoding' property'. - mySoapFaultBinding.Namespace = "http://tempuri.org/stockquote" - ' Create a new instance of 'FaultBinding'. - Dim myFaultBinding As New FaultBinding() - myFaultBinding.Name = "AddFaultbinding" - myFaultBinding.Extensions.Add(mySoapFaultBinding) - ' Get existing 'OperationBinding' object. - Dim myOperationBinding As OperationBinding = myBinding.Operations(0) - myOperationBinding.Faults.Add(myFaultBinding) - ' Create a new wsdl file. - myServiceDescription.Write(myOutputWsdlFile) - Console.WriteLine("The new wsdl file created is :" + myOutputWsdlFile) - Console.WriteLine("Proxy could be created using command : wsdl /language:VB " + myOutputWsdlFile) - Catch e As Exception - Console.WriteLine("Error occurred : " + e.Message.ToString()) - End Try - End Sub -End Class -' diff --git a/snippets/visualbasic/System.Web.Services.Description/SoapHeaderBinding/MapToProperty/MapToProperty_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/SoapHeaderBinding/MapToProperty/MapToProperty_vb.wsdl deleted file mode 100644 index 72f8aa485d7..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/SoapHeaderBinding/MapToProperty/MapToProperty_vb.wsdl +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This Web Service method requires a client to send the MyHeader SOAP header. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/SoapHeaderBinding/MapToProperty/soapheaderbinding_maptoproperty.vb b/snippets/visualbasic/System.Web.Services.Description/SoapHeaderBinding/MapToProperty/soapheaderbinding_maptoproperty.vb deleted file mode 100644 index e5ca6c53112..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/SoapHeaderBinding/MapToProperty/soapheaderbinding_maptoproperty.vb +++ /dev/null @@ -1,36 +0,0 @@ -' System.Web.Services.Description.SoapHeaderBinding.MapToProperty -' -' The following example demonstrates the 'MapToProperty' property of class 'SoapHeaderBinding'. -' It reads an existing wsdl file and gets 'SoapHeaderBinding' instance from it. -' 'MapToProperty' property of this instance is checked to see whether this instance -' is mapped to a specific property in proxy class or not. -' -Option Explicit On -Option Strict On -Imports System.Web.Services.Description - -Public Class MapToPropertySample - - Public Shared Sub Main() -' - ' Read from an existing wsdl file. - Dim myServiceDescription As ServiceDescription = ServiceDescription.Read( _ - "MapToProperty_vb.wsdl") - ' Get the existing binding - Dim myBinding As Binding = myServiceDescription.Bindings("MyWebServiceSoap") - Dim myOperationBinding As OperationBinding = CType(myBinding.Operations(0), _ - OperationBinding) - Dim myInputBinding As InputBinding = myOperationBinding.Input - ' Get the 'SoapHeaderBinding' instance from 'myInputBinding'. - Dim mySoapHeaderBinding As SoapHeaderBinding = CType(myInputBinding.Extensions(1), _ - SoapHeaderBinding) - If mySoapHeaderBinding.MapToProperty Then - Console.WriteLine("'SoapHeaderBinding' instance is mapped to a " & _ - "specific property in proxy generated class") - Else - Console.WriteLine("'SoapHeaderBinding' instance is not mapped to " & _ - "a specific property in proxy generated class") - End If -' - End Sub -End Class diff --git a/snippets/visualbasic/System.Web.Services.Description/SoapHeaderBinding/Message/SoapHeaderBindingInput_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/SoapHeaderBinding/Message/SoapHeaderBindingInput_vb.wsdl deleted file mode 100644 index 94df6f76cf5..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/SoapHeaderBinding/Message/SoapHeaderBindingInput_vb.wsdl +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This Web Service method requires a client to send the MyHeader SOAP header. - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/SoapHeaderBinding/Message/soapheaderbinding_use.vb b/snippets/visualbasic/System.Web.Services.Description/SoapHeaderBinding/Message/soapheaderbinding_use.vb deleted file mode 100644 index 1e8835fc46d..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/SoapHeaderBinding/Message/soapheaderbinding_use.vb +++ /dev/null @@ -1,77 +0,0 @@ -' System.Web.Services.Description.SoapHeaderBinding.SoapHeaderBinding -' System.Web.Services.Description.SoapHeaderBinding.Message -' System.Web.Services.Description.SoapHeaderBinding.Part -' System.Web.Services.Description.SoapHeaderBinding.Use - -' The following example demonstrates the constructor, 'Message' , 'Part' -' and 'Use' properties of the class 'SoapHeaderBinding'. -' It takes as input a wsdl file. The binding element corresponding to -' SOAP protocol is removed from the input file. By using the 'Read' method -' of 'ServiceDescription' class it gets a 'ServiceDescription' object. -' It uses the SOAP protocol related classes and creates 'Binding' element -' of 'SOAP' protocol which are then added to the 'ServiceDescription' object. -' An output wsdl file is generated from 'ServiceDescription' object which -' could be used for generating a proxy. - -Imports System.Web.Services.Description -Imports System.Collections -Imports System.Xml - -Public Class MySampleClass - Public Shared Sub Main() - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("SoapHeaderBindingInput_vb.wsdl") - Dim myBinding As New Binding() - myBinding.Name = "MyWebServiceSoap" - myBinding.Type = New XmlQualifiedName("s0:MyWebServiceSoap") - - Dim mySoapBinding As New SoapBinding() - mySoapBinding.Transport = "http://schemas.xmlsoap.org/soap/http" - mySoapBinding.Style = SoapBindingStyle.Document - myBinding.Extensions.Add(mySoapBinding) - - Dim myOperationBinding As New OperationBinding() - myOperationBinding.Name = "Hello" - - Dim mySoapOperationBinding As New SoapOperationBinding() - mySoapOperationBinding.SoapAction = "http://tempuri.org/Hello" - mySoapOperationBinding.Style = SoapBindingStyle.Document - myOperationBinding.Extensions.Add(mySoapOperationBinding) - - ' Create InputBinding for operation for the 'SOAP' protocol. - Dim myInputBinding As New InputBinding() - Dim mySoapBodyBinding As New SoapBodyBinding() - mySoapBodyBinding.Use = SoapBindingUse.Literal - myInputBinding.Extensions.Add(mySoapBodyBinding) -' -' -' -' - Dim mySoapHeaderBinding As New SoapHeaderBinding() - ' Set the Message within the XML Web service to which the - ' 'SoapHeaderBinding' applies. - mySoapHeaderBinding.Message = New XmlQualifiedName("s0:HelloMyHeader") - mySoapHeaderBinding.Part = "MyHeader" - mySoapHeaderBinding.Use = SoapBindingUse.Literal - ' Add mySoapHeaderBinding to the 'myInputBinding' object. - myInputBinding.Extensions.Add(mySoapHeaderBinding) -' -' -' -' - ' Create OutputBinding for operation for the 'SOAP' protocol. - Dim myOutputBinding As New OutputBinding() - myOutputBinding.Extensions.Add(mySoapBodyBinding) - - ' Add 'InputBinding' and 'OutputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInputBinding - myOperationBinding.Output = myOutputBinding - myBinding.Operations.Add(myOperationBinding) - - myServiceDescription.Bindings.Add(myBinding) - myServiceDescription.Write("SoapHeaderBindingOut_vb.wsdl") - Console.WriteLine("'SoapHeaderBindingOut_vb.wsdl' file is generated.") - Console.WriteLine("Proxy could be created using " + _ - "'wsdl /language:VB SoapHeaderBindingOut_vb.wsdl'.") - End Sub -End Class \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/SoapHeaderBinding/Overview/SoapHeaderBindingInput_vb.wsdl b/snippets/visualbasic/System.Web.Services.Description/SoapHeaderBinding/Overview/SoapHeaderBindingInput_vb.wsdl deleted file mode 100644 index 94df6f76cf5..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/SoapHeaderBinding/Overview/SoapHeaderBindingInput_vb.wsdl +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This Web Service method requires a client to send the MyHeader SOAP header. - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Web.Services.Description/SoapHeaderBinding/Overview/soapheaderbinding.vb b/snippets/visualbasic/System.Web.Services.Description/SoapHeaderBinding/Overview/soapheaderbinding.vb deleted file mode 100644 index 89114350be3..00000000000 --- a/snippets/visualbasic/System.Web.Services.Description/SoapHeaderBinding/Overview/soapheaderbinding.vb +++ /dev/null @@ -1,64 +0,0 @@ -' System.Web.Services.Description.SoapHeaderBinding - -' The following example demonstrates the class 'SoapHeaderBinding'. -' It takes as input a wsdl file. By using the 'Read' method -' of 'ServiceDescription' class it gets a 'ServiceDescription' object. -' It uses the SOAP protocol related classes and creates 'Binding' element -' of 'SOAP' protocol which are then added to the 'ServiceDescription' object. -' An output wsdl file is generated from 'ServiceDescription' object which -' could be used for generating a proxy. - -' -Imports System.Web.Services.Description -Imports System.Collections -Imports System.Xml - -Public Class MySampleClass - Public Shared Sub Main() - Dim myServiceDescription As ServiceDescription = _ - ServiceDescription.Read("SoapHeaderBindingInput_vb.wsdl") - Dim myBinding As New Binding() - myBinding.Name = "MyWebServiceSoap" - myBinding.Type = New XmlQualifiedName("s0:MyWebServiceSoap") - - Dim mySoapBinding As New SoapBinding() - mySoapBinding.Transport = "http://schemas.xmlsoap.org/soap/http" - mySoapBinding.Style = SoapBindingStyle.Document - myBinding.Extensions.Add(mySoapBinding) - - Dim myOperationBinding As New OperationBinding() - myOperationBinding.Name = "Hello" - - Dim mySoapOperationBinding As New SoapOperationBinding() - mySoapOperationBinding.SoapAction = "http://tempuri.org/Hello" - mySoapOperationBinding.Style = SoapBindingStyle.Document - myOperationBinding.Extensions.Add(mySoapOperationBinding) - - ' Create InputBinding for operation for the 'SOAP' protocol. - Dim myInputBinding As New InputBinding() - Dim mySoapBodyBinding As New SoapBodyBinding() - mySoapBodyBinding.Use = SoapBindingUse.Literal - myInputBinding.Extensions.Add(mySoapBodyBinding) - Dim mySoapHeaderBinding As New SoapHeaderBinding() - mySoapHeaderBinding.Message = New XmlQualifiedName("s0:HelloMyHeader") - mySoapHeaderBinding.Part = "MyHeader" - mySoapHeaderBinding.Use = SoapBindingUse.Literal - ' Add mySoapHeaderBinding to 'myInputBinding' object. - myInputBinding.Extensions.Add(mySoapHeaderBinding) - ' Create OutputBinding for operation for the 'SOAP' protocol. - Dim myOutputBinding As New OutputBinding() - myOutputBinding.Extensions.Add(mySoapBodyBinding) - - ' Add 'InputBinding' and 'OutputBinding' to 'OperationBinding'. - myOperationBinding.Input = myInputBinding - myOperationBinding.Output = myOutputBinding - myBinding.Operations.Add(myOperationBinding) - - myServiceDescription.Bindings.Add(myBinding) - myServiceDescription.Write("SoapHeaderBindingOut_vb.wsdl") - Console.WriteLine("'SoapHeaderBindingOut_vb.wsdl' file is generated.") - Console.WriteLine("Proxy could be created using " + _ - "'wsdl /language:VB SoapHeaderBindingOut_vb.wsdl'.") - End Sub -End Class -' \ No newline at end of file diff --git a/xml/System.Web.Services.Configuration/XmlFormatExtensionAttribute.xml b/xml/System.Web.Services.Configuration/XmlFormatExtensionAttribute.xml index f17517c23d1..56bc153bfe8 100644 --- a/xml/System.Web.Services.Configuration/XmlFormatExtensionAttribute.xml +++ b/xml/System.Web.Services.Configuration/XmlFormatExtensionAttribute.xml @@ -57,10 +57,6 @@ -## Examples - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Configuration/XmlFormatExtensionAttribute/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Configuration/XmlFormatExtensionAttribute/Overview/source.vb" id="Snippet1"::: - ]]> @@ -141,10 +137,6 @@ @@ -332,10 +324,6 @@ @@ -396,10 +384,6 @@ -## Examples - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Configuration/XmlFormatExtensionAttribute/Overview/source.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Configuration/XmlFormatExtensionAttribute/Overview/source.vb" id="Snippet2"::: - ]]> @@ -435,10 +419,6 @@ diff --git a/xml/System.Web.Services.Configuration/XmlFormatExtensionPointAttribute.xml b/xml/System.Web.Services.Configuration/XmlFormatExtensionPointAttribute.xml index 603296c5ae4..2eb1228b978 100644 --- a/xml/System.Web.Services.Configuration/XmlFormatExtensionPointAttribute.xml +++ b/xml/System.Web.Services.Configuration/XmlFormatExtensionPointAttribute.xml @@ -57,10 +57,6 @@ -## Examples - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Configuration/XmlFormatExtensionAttribute/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Configuration/XmlFormatExtensionAttribute/Overview/source.vb" id="Snippet1"::: - ]]> diff --git a/xml/System.Web.Services.Configuration/XmlFormatExtensionPrefixAttribute.xml b/xml/System.Web.Services.Configuration/XmlFormatExtensionPrefixAttribute.xml index 4c9492a3a92..b53d89b5dbf 100644 --- a/xml/System.Web.Services.Configuration/XmlFormatExtensionPrefixAttribute.xml +++ b/xml/System.Web.Services.Configuration/XmlFormatExtensionPrefixAttribute.xml @@ -57,10 +57,6 @@ -## Examples - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Configuration/XmlFormatExtensionAttribute/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Configuration/XmlFormatExtensionAttribute/Overview/source.vb" id="Snippet1"::: - ]]> @@ -137,10 +133,6 @@ @@ -176,10 +168,6 @@ @@ -215,10 +203,6 @@ diff --git a/xml/System.Web.Services.Description/Binding.xml b/xml/System.Web.Services.Description/Binding.xml index 3ea332be2df..9e591199425 100644 --- a/xml/System.Web.Services.Description/Binding.xml +++ b/xml/System.Web.Services.Description/Binding.xml @@ -42,16 +42,7 @@ ## Remarks The `Binding` class corresponds to the Web Services Description Language (WSDL) `` element enclosed by the root `` element. For more information about WSDL, see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - - -## Examples - The following example demonstrates a typical use of the `Binding` class. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/BindingCollectionsample1/CPP/bindingcollectionsample1.cpp" id="Snippet3"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/Binding/Overview/bindingcollectionsample1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/Binding/Overview/bindingcollectionsample1.vb" id="Snippet3"::: - + ]]> @@ -119,14 +110,7 @@ A object that contains the collection of extensibility elements used in the XML Web service. @@ -167,17 +151,7 @@ An object that contains the collection of specifications for data formats and message protocols used in the action supported by the XML Web service. @@ -252,16 +226,7 @@ ## Remarks The default value is an empty string (""). - - - -## Examples - The following example demonstrates the use of the `Type` property. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/BindingCollectionSample2/CPP/bindingcollectionsample2.cpp" id="Snippet3"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/Binding/Extensions/bindingcollectionsample2.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/Binding/Extensions/bindingcollectionsample2.vb" id="Snippet3"::: - + ]]> diff --git a/xml/System.Web.Services.Description/BindingCollection.xml b/xml/System.Web.Services.Description/BindingCollection.xml index 83cbcff2036..def4ecf0148 100644 --- a/xml/System.Web.Services.Description/BindingCollection.xml +++ b/xml/System.Web.Services.Description/BindingCollection.xml @@ -76,11 +76,6 @@ @@ -121,11 +116,6 @@ @@ -166,11 +156,6 @@ @@ -245,11 +230,6 @@ @@ -297,13 +277,6 @@ The elements after the insertion point move down to accommodate the new element. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/BindingCollectionSample2/CPP/bindingcollectionsample2.cpp" id="Snippet6"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/Binding/Extensions/bindingcollectionsample2.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/Binding/Extensions/bindingcollectionsample2.vb" id="Snippet6"::: - ]]> @@ -353,11 +326,6 @@ The parameter is less than zero. @@ -402,13 +370,6 @@ named "MathServiceHttpGet". - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/BindingCollectionsample1/CPP/bindingcollectionsample1.cpp" id="Snippet3"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/Binding/Overview/bindingcollectionsample1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/Binding/Overview/bindingcollectionsample1.vb" id="Snippet3"::: - ]]> @@ -452,13 +413,6 @@ The elements that follow the removed `Binding` move up to occupy the vacated spot. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/BindingCollectionsample3/CPP/bindingcollectionsample3.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/BindingCollection/Add/bindingcollectionsample3.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/BindingCollection/Add/bindingcollectionsample3.vb" id="Snippet1"::: - ]]> diff --git a/xml/System.Web.Services.Description/DocumentableItem.xml b/xml/System.Web.Services.Description/DocumentableItem.xml index b2873cfd218..cfb999249fe 100644 --- a/xml/System.Web.Services.Description/DocumentableItem.xml +++ b/xml/System.Web.Services.Description/DocumentableItem.xml @@ -134,15 +134,6 @@ ## Remarks In a derived class, this property represents the text comments added to an element of the XML Web service. The default implementation is an empty string (""). - - -## Examples - The following code example demonstrates a typical usage of the property. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/DocumentableItemsample/CPP/documentableitemsample.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/DocumentableItem/Documentation/documentableitemsample.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/DocumentableItem/Documentation/documentableitemsample.vb" id="Snippet1"::: - ]]> diff --git a/xml/System.Web.Services.Description/FaultBinding.xml b/xml/System.Web.Services.Description/FaultBinding.xml index 9498196124c..8e19c187373 100644 --- a/xml/System.Web.Services.Description/FaultBinding.xml +++ b/xml/System.Web.Services.Description/FaultBinding.xml @@ -42,16 +42,7 @@ ## Remarks The `FaultBinding` class corresponds to the Web Services Description Language (WSDL) `` element enclosed by the `` element, which in turn corresponds to the class. For more information about WSDL, see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - - -## Examples - The following example demonstrates a typical use of the `FaultBinding` class. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/FaultBindingCollection_Add/CPP/faultbindingcollection_add.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/FaultBinding/Overview/faultbindingcollection_add.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/FaultBinding/Overview/faultbindingcollection_add.vb" id="Snippet1"::: - + ]]> @@ -119,12 +110,7 @@ A . The default value is a collection with a of zero. diff --git a/xml/System.Web.Services.Description/FaultBindingCollection.xml b/xml/System.Web.Services.Description/FaultBindingCollection.xml index b8ce7d6a808..0d97165efc6 100644 --- a/xml/System.Web.Services.Description/FaultBindingCollection.xml +++ b/xml/System.Web.Services.Description/FaultBindingCollection.xml @@ -34,11 +34,6 @@ @@ -79,11 +74,6 @@ @@ -124,13 +114,6 @@ @@ -171,13 +154,6 @@ @@ -252,13 +228,6 @@ @@ -306,15 +275,6 @@ The elements after the insertion point move down to accommodate the new element. - - -## Examples - The following example demonstrates a typical use of the `Insert` method. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/FaultBindingCollection_Remove/CPP/faultbindingcollection_remove.cpp" id="Snippet3"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/FaultBindingCollection/Contains/faultbindingcollection_remove.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/FaultBindingCollection/Contains/faultbindingcollection_remove.vb" id="Snippet3"::: - ]]> @@ -364,13 +324,6 @@ class. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/FaultBindingCollection_Add/CPP/faultbindingcollection_add.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/FaultBinding/Overview/faultbindingcollection_add.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/FaultBinding/Overview/faultbindingcollection_add.vb" id="Snippet1"::: - ]]> The parameter is less than zero. @@ -415,13 +368,6 @@ @@ -465,15 +411,6 @@ The elements that follow the removed move up to occupy the vacated spot. - - -## Examples - The following example demonstrates a typical use of the `Remove` method. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/FaultBindingCollection_Remove/CPP/faultbindingcollection_remove.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/FaultBindingCollection/Contains/faultbindingcollection_remove.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/FaultBindingCollection/Contains/faultbindingcollection_remove.vb" id="Snippet1"::: - ]]> diff --git a/xml/System.Web.Services.Description/HttpAddressBinding.xml b/xml/System.Web.Services.Description/HttpAddressBinding.xml index 5a3e62125d9..3a04c68f90a 100644 --- a/xml/System.Web.Services.Description/HttpAddressBinding.xml +++ b/xml/System.Web.Services.Description/HttpAddressBinding.xml @@ -43,13 +43,6 @@ ## Remarks This class, through its property, specifies the base URI for the XML Web service. For more information about XML Web services, see [XML Web Services Using ASP.NET](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ba0z6a33(v=vs.100)). For more information about Web Services Description Language (WSDL), see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/WebServices_HttpBinding/CPP/httpbinding.cpp" id="Snippet3"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/HttpAddressBinding/Overview/httpbinding.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/HttpAddressBinding/Overview/httpbinding.vb" id="Snippet3"::: - ]]> @@ -118,9 +111,6 @@ diff --git a/xml/System.Web.Services.Description/HttpBinding.xml b/xml/System.Web.Services.Description/HttpBinding.xml index 370438f5a5d..5eabf50eaeb 100644 --- a/xml/System.Web.Services.Description/HttpBinding.xml +++ b/xml/System.Web.Services.Description/HttpBinding.xml @@ -46,16 +46,7 @@ ## Remarks The use of this class as an extensibility element specifies that information is to be passed by HTTP. For more information about specification of protocols for XML Web services, see [XML Web Services Using ASP.NET](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ba0z6a33(v=vs.100)). For more information about Web Services Description Language (WSDL), see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - - -## Examples - The following example shows a typical usage of the `HttpBinding` class. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/WebServices_HttpBinding/CPP/httpbinding.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/HttpAddressBinding/Overview/httpbinding.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/HttpAddressBinding/Overview/httpbinding.vb" id="Snippet1"::: - + ]]> @@ -119,16 +110,7 @@ ## Remarks The field value is "". - - - -## Examples - The following example demonstrates a typical use of the `Namespace` field. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/HttpBinding_HttpBinding/CPP/httpbinding_ctor.cpp" id="Snippet2"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/HttpBinding/Namespace/httpbinding_ctor.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/HttpBinding/Namespace/httpbinding_ctor.vb" id="Snippet2"::: - + ]]> diff --git a/xml/System.Web.Services.Description/Import.xml b/xml/System.Web.Services.Description/Import.xml index f57ff134e65..5df877ba1dd 100644 --- a/xml/System.Web.Services.Description/Import.xml +++ b/xml/System.Web.Services.Description/Import.xml @@ -43,15 +43,6 @@ ## Remarks The Web Services Description Language (WSDL) `import` element that is enclosed by the `definitions` element allows the separation of different parts of the XML Web service into different documents, which can then be imported as required. Each document's URL is associated with a unique XML tag prefix that represents the XML namespace for that document's elements. For more information about WSDL, see the [WSDL](https://www.w3.org/TR/wsdl/) specification. For more information about XML namespaces, see the property. - - -## Examples - The following example shows a user-defined method that creates a new instance of the class. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/Importsample/CPP/importsample.cpp" id="Snippet7"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/FaultBindingCollection/Overview/importsample.cs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/FaultBindingCollection/Overview/importsample.vb" id="Snippet7"::: - ]]> @@ -157,11 +148,6 @@ @@ -203,11 +189,6 @@ @@ -243,11 +224,6 @@ property. - - Importsample#6 - ]]> diff --git a/xml/System.Web.Services.Description/ImportCollection.xml b/xml/System.Web.Services.Description/ImportCollection.xml index 1b7bc902c3a..c9adf99a7d3 100644 --- a/xml/System.Web.Services.Description/ImportCollection.xml +++ b/xml/System.Web.Services.Description/ImportCollection.xml @@ -37,15 +37,6 @@ ## Remarks The class corresponds to the Web Services Description Language (WSDL) `` element that is enclosed by the root `` element. For more information about WSDL, see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - -## Examples - The following example demonstrates a typical use of the `ImportCollection` class. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/ImportCollection_6/CPP/importcollection_6.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/ImportCollection/Overview/importcollection_6.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/ImportCollection/Overview/importcollection_6.vb" id="Snippet1"::: - ]]> @@ -86,13 +77,6 @@ class. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/Importsample/CPP/importsample.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/FaultBindingCollection/Overview/importsample.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/FaultBindingCollection/Overview/importsample.vb" id="Snippet1"::: - ]]> @@ -133,13 +117,6 @@ @@ -180,13 +157,6 @@ @@ -226,13 +196,6 @@ @@ -280,15 +243,6 @@ The elements after the insertion point move down to accommodate the new element. - - -## Examples - The following example demonstrates the use of the `Insert` method. To view the source for the user-defined `CreateImport` method, see the example included with the class. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/Importsample/CPP/importsample.cpp" id="Snippet2"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/FaultBindingCollection/Overview/importsample.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/FaultBindingCollection/Overview/importsample.vb" id="Snippet2"::: - ]]> The parameter is less than zero. @@ -333,13 +287,6 @@ @@ -383,15 +330,6 @@ The elements that follow the removed move up to occupy the vacated spot. - - -## Examples - The following example demonstrates the use of the `Remove` method. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/ImportCollection_6/CPP/importcollection_6.cpp" id="Snippet6"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/ImportCollection/Overview/importcollection_6.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/ImportCollection/Overview/importcollection_6.vb" id="Snippet6"::: - ]]> diff --git a/xml/System.Web.Services.Description/InputBinding.xml b/xml/System.Web.Services.Description/InputBinding.xml index 735cb6c2b6f..7a95c19c7f2 100644 --- a/xml/System.Web.Services.Description/InputBinding.xml +++ b/xml/System.Web.Services.Description/InputBinding.xml @@ -42,16 +42,7 @@ ## Remarks The `InputBinding` class corresponds to the Web Services Description Language (WSDL) `` element enclosed by the `` element, which in turn corresponds to the class. For more information about WSDL, see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - - -## Examples - The following example demonstrates a typical use of the `InputBinding` class. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/DescriptionNamespaceSample1/CPP/descriptionnamespacesample1.cpp" id="Snippet3"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/InputBinding/Overview/descriptionnamespacesample1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/InputBinding/Overview/descriptionnamespacesample1.vb" id="Snippet3"::: - + ]]> @@ -119,10 +110,7 @@ A . diff --git a/xml/System.Web.Services.Description/Message.xml b/xml/System.Web.Services.Description/Message.xml index 4f093767e8d..c8bb35eb927 100644 --- a/xml/System.Web.Services.Description/Message.xml +++ b/xml/System.Web.Services.Description/Message.xml @@ -45,13 +45,6 @@ The class corresponds to a Web Services Description Language (WSDL) `message` element enclosed by the `definitions` root element. For more information about WSDL, see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/DescriptionNamespaceSample1/CPP/descriptionnamespacesample1.cpp" id="Snippet13"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/InputBinding/Overview/descriptionnamespacesample1.cs" id="Snippet13"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/InputBinding/Overview/descriptionnamespacesample1.vb" id="Snippet13"::: - ]]> @@ -155,13 +148,6 @@ No with the specified name exists within the collection. @@ -202,13 +188,6 @@ No instances with the specified names exist within the collection. @@ -251,13 +230,6 @@ property. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/DescriptionNamespaceSample1/CPP/descriptionnamespacesample1.cpp" id="Snippet13"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/InputBinding/Overview/descriptionnamespacesample1.cs" id="Snippet13"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/InputBinding/Overview/descriptionnamespacesample1.vb" id="Snippet13"::: - ]]> @@ -293,11 +265,6 @@ property. - - Message_Samples3#2 - ]]> diff --git a/xml/System.Web.Services.Description/MessageBinding.xml b/xml/System.Web.Services.Description/MessageBinding.xml index 3ba0b10148b..922cb663969 100644 --- a/xml/System.Web.Services.Description/MessageBinding.xml +++ b/xml/System.Web.Services.Description/MessageBinding.xml @@ -42,16 +42,7 @@ - - - - - -## Examples - The following example demonstrates a typical use of the `MessageBinding` class. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/MessageBinding_sample/CPP/messagebinding_sample.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/MessageBinding/Overview/messagebinding_sample.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/MessageBinding/Overview/messagebinding_sample.vb" id="Snippet1"::: - + ]]> diff --git a/xml/System.Web.Services.Description/MessageCollection.xml b/xml/System.Web.Services.Description/MessageCollection.xml index 72d00a0b621..4106fd2da51 100644 --- a/xml/System.Web.Services.Description/MessageCollection.xml +++ b/xml/System.Web.Services.Description/MessageCollection.xml @@ -34,11 +34,6 @@ @@ -78,11 +73,6 @@ @@ -123,13 +113,6 @@ @@ -170,13 +153,6 @@ @@ -251,13 +227,6 @@ @@ -305,13 +274,6 @@ The elements after the insertion point move down to accommodate the new element. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/DescriptionNamespaceSample1/CPP/descriptionnamespacesample1.cpp" id="Snippet8"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/InputBinding/Overview/descriptionnamespacesample1.cs" id="Snippet8"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/InputBinding/Overview/descriptionnamespacesample1.vb" id="Snippet8"::: - ]]> The parameter is less than zero. @@ -366,13 +328,6 @@ @@ -412,13 +367,6 @@ @@ -462,15 +410,6 @@ The elements that follow the removed move up to occupy the vacated spot. - - -## Examples - The following example demonstrates the use of the `Remove` method. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/MessageCollection/CPP/messagecollection.cpp" id="Snippet6"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/MessageCollection/Contains/messagecollection.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/MessageCollection/Contains/messagecollection.vb" id="Snippet6"::: - ]]> diff --git a/xml/System.Web.Services.Description/MessagePart.xml b/xml/System.Web.Services.Description/MessagePart.xml index 14a1882de8d..1458faec700 100644 --- a/xml/System.Web.Services.Description/MessagePart.xml +++ b/xml/System.Web.Services.Description/MessagePart.xml @@ -43,15 +43,6 @@ ## Remarks The class corresponds to a Web Services Description Language (WSDL) `part` element enclosed by the `message` element, which is in turn enclosed by the `definitions` root element. For more information about WSDL, see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - -## Examples - The following example demonstrates a typical use of the class. The `element` and `targetNamespace` parameters are user-defined strings passed into this method call. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/DescriptionNamespaceSample1/CPP/descriptionnamespacesample1.cpp" id="Snippet10"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/InputBinding/Overview/descriptionnamespacesample1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/InputBinding/Overview/descriptionnamespacesample1.vb" id="Snippet10"::: - ]]> @@ -124,13 +115,6 @@ ## Remarks This property corresponds to the `element` attribute of the `part` element for which the class serves as a wrapper. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/DescriptionNamespaceSample1/CPP/descriptionnamespacesample1.cpp" id="Snippet11"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/InputBinding/Overview/descriptionnamespacesample1.cs" id="Snippet11"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/InputBinding/Overview/descriptionnamespacesample1.vb" id="Snippet11"::: - ]]> @@ -203,13 +187,6 @@ property. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/MessagePartCollection/CPP/messagepartcollection.cpp" id="Snippet2"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/MessagePart/Message/messagepartcollection.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/MessagePart/Message/messagepartcollection.vb" id="Snippet2"::: - ]]> @@ -254,13 +231,6 @@ ## Remarks This property corresponds to the `type` attribute of the `part` element for which the class serves as a wrapper. In general, it refers to a data type defined in the XSD schema, but it can also be extended, as long as the XML namespace used is different from that of Web Services Description Language (WSDL). - - -## Examples - The following example demonstrates a use of the property. - - MessagePart_Type#1 - ]]> diff --git a/xml/System.Web.Services.Description/MessagePartCollection.xml b/xml/System.Web.Services.Description/MessagePartCollection.xml index b7aef6e7c6f..aeb32f05280 100644 --- a/xml/System.Web.Services.Description/MessagePartCollection.xml +++ b/xml/System.Web.Services.Description/MessagePartCollection.xml @@ -37,15 +37,6 @@ ## Remarks The class corresponds to a Web Services Description Language (WSDL) `` element enclosed by the `` element, which is in turn enclosed by the `` root element. For more information about WSDL, see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - -## Examples - The following example demonstrates the use of the methods and properties exposed by the `MessagePartCollection` class. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/MessagePartCollection/CPP/messagepartcollection.cpp" id="Snippet8"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/MessagePart/Message/messagepartcollection.cs" id="Snippet8"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/MessagePart/Message/messagepartcollection.vb" id="Snippet8"::: - ]]> @@ -86,11 +77,6 @@ @@ -131,13 +117,6 @@ @@ -178,13 +157,6 @@ @@ -259,13 +231,6 @@ @@ -313,13 +278,6 @@ The elements after the insertion point move down to accommodate the new element. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/DescriptionNamespaceSample1/CPP/descriptionnamespacesample1.cpp" id="Snippet15"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/InputBinding/Overview/descriptionnamespacesample1.cs" id="Snippet15"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/InputBinding/Overview/descriptionnamespacesample1.vb" id="Snippet15"::: - ]]> @@ -369,13 +327,6 @@ @@ -415,11 +366,6 @@ @@ -463,15 +409,6 @@ The elements that follow the removed move up to occupy the vacated spot. - - -## Examples - The following example demonstrates the use of the `Remove` method. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/MessagePartCollection/CPP/messagepartcollection.cpp" id="Snippet7"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/MessagePart/Message/messagepartcollection.cs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/MessagePart/Message/messagepartcollection.vb" id="Snippet7"::: - ]]> diff --git a/xml/System.Web.Services.Description/MimeContentBinding.xml b/xml/System.Web.Services.Description/MimeContentBinding.xml index 4d29998e865..0904a174c5f 100644 --- a/xml/System.Web.Services.Description/MimeContentBinding.xml +++ b/xml/System.Web.Services.Description/MimeContentBinding.xml @@ -46,16 +46,7 @@ ## Remarks For more information about specifying protocols for XML Web services, see [XML Web Services Using ASP.NET](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ba0z6a33(v=vs.100)). For more information about Web Services Description Language (WSDL), see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - - -## Examples - The following example demonstrates the use of the properties and methods exposed by the `MimeContentBinding` class. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/MimeContentBinding_Part_4/CPP/mimecontentbinding_part_4.cpp" id="Snippet4"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/MimeContentBinding/Overview/mimecontentbinding_part_4.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/MimeContentBinding/Overview/mimecontentbinding_part_4.vb" id="Snippet4"::: - + ]]> @@ -116,12 +107,7 @@ Specifies the URI for the XML namespace of the class. This field is constant. @@ -162,12 +148,7 @@ A string representing the name of the with which the current is associated. The default value is an empty string (""). @@ -213,12 +194,7 @@ The Web Services Description Language (WSDL) specification defines bindings for several MIME types, including text/xml, multipart/related, and application/x-www-form-urlencoded, although any MIME type can be used. The wildcard character (*) can also be used. For example, the string "text/\*" would represent all text types. If the value of this property is not set, the `MimeContentBinding` specifies all MIME types. For more information about WSDL, see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - - -## Examples - MimeContentBinding_Part_4#1 - + ]]> diff --git a/xml/System.Web.Services.Description/MimeMultipartRelatedBinding.xml b/xml/System.Web.Services.Description/MimeMultipartRelatedBinding.xml index 89284c6f1b7..c973ac0c728 100644 --- a/xml/System.Web.Services.Description/MimeMultipartRelatedBinding.xml +++ b/xml/System.Web.Services.Description/MimeMultipartRelatedBinding.xml @@ -42,16 +42,7 @@ ## Remarks For more information about specifying protocols for XML Web services, see [XML Web Services Using ASP.NET](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ba0z6a33(v=vs.100)). For more information about Web Services Description Language (WSDL), see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - - -## Examples - The following example demonstrates the use of the properties and methods exposed by the `MimeMultipartRelatedBinding` class. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/MimeMultiPartRelatedBinding_Parts_2/CPP/mimemultipartrelatedbinding_parts_2.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/MimeMultipartRelatedBinding/Overview/mimemultipartrelatedbinding_parts_2.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/MimeMultipartRelatedBinding/Overview/mimemultipartrelatedbinding_parts_2.vb" id="Snippet1"::: - + ]]> @@ -119,10 +110,7 @@ A representing extensibility elements added to the . diff --git a/xml/System.Web.Services.Description/MimePart.xml b/xml/System.Web.Services.Description/MimePart.xml index 5673e79f7b5..cf7d1516d24 100644 --- a/xml/System.Web.Services.Description/MimePart.xml +++ b/xml/System.Web.Services.Description/MimePart.xml @@ -42,16 +42,7 @@ ## Remarks For more information about specifying protocols for XML Web services, see [XML Web Services Using ASP.NET](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ba0z6a33(v=vs.100)). For more information about Web Services Description Language (WSDL), see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - - -## Examples - The following example demonstrates the use of the methods and properties exposed by the `MimePart` class. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/MimePart_3/CPP/mimepart_3.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/MimePart/Overview/mimepart_3.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/MimePart/Overview/mimepart_3.vb" id="Snippet1"::: - + ]]> @@ -130,12 +121,7 @@ - Each of these classes exposes a `Part` property specifying the with which the `MimePart` is associated. If this collection has no members, the XML Web service will fail to generate a Web Services Description Language (WSDL) file when it is requested. For more information about how MIME extends WSDL, see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - - -## Examples - MimePart_3#3 - + ]]> diff --git a/xml/System.Web.Services.Description/MimePartCollection.xml b/xml/System.Web.Services.Description/MimePartCollection.xml index 4c008657597..6b22bf61fab 100644 --- a/xml/System.Web.Services.Description/MimePartCollection.xml +++ b/xml/System.Web.Services.Description/MimePartCollection.xml @@ -39,15 +39,6 @@ For more information about specifying protocols for XML Web services, see [XML Web Services Using ASP.NET](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ba0z6a33(v=vs.100)). For more information about Web Services Description Language (WSDL), see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - -## Examples - The following example demonstrates the use of the properties and methods exposed by the `MimePartCollection` class. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/MimePartCollection_1/CPP/mimepartcollection_1.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/MimePartCollection/Overview/mimepartcollection_1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/MimePartCollection/Overview/mimepartcollection_1.vb" id="Snippet1"::: - ]]> @@ -114,13 +105,6 @@ @@ -161,13 +145,6 @@ @@ -208,13 +185,6 @@ @@ -254,13 +224,6 @@ @@ -308,15 +271,6 @@ The elements after the insertion point move down to accommodate the new element. - - -## Examples - The following example demonstrates a typical use of the `Insert` method. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/MimePartCollection_8/CPP/mimepartcollection_8.cpp" id="Snippet3"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/MimePartCollection/Add/mimepartcollection_8.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/MimePartCollection/Add/mimepartcollection_8.vb" id="Snippet3"::: - ]]> The parameter is less than zero. @@ -361,13 +315,6 @@ @@ -411,13 +358,6 @@ The elements that follow the removed `MimePart` move up to occupy the vacated spot. - - -## Examples - The following example demonstrates a typical use of the `Remove` method. - - MimePartCollection_8#8 - ]]> diff --git a/xml/System.Web.Services.Description/MimeTextBinding.xml b/xml/System.Web.Services.Description/MimeTextBinding.xml index 2dab7147fd3..fbec4dd24bd 100644 --- a/xml/System.Web.Services.Description/MimeTextBinding.xml +++ b/xml/System.Web.Services.Description/MimeTextBinding.xml @@ -46,14 +46,7 @@ ## Remarks For more information about specifying protocols for XML Web services, see [XML Web Services Using ASP.NET](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ba0z6a33(v=vs.100)). For more information about Web Services Description Language (WSDL), see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/MimeText_Binding_Match_8/CPP/mimetext_binding_match_8.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/MimeTextBinding/Overview/mimetext_binding_match_8.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/MimeTextBinding/Overview/mimetext_binding_match_8.vb" id="Snippet1"::: - + ]]> @@ -124,16 +117,7 @@ ## Remarks For more information about specifying protocols for XML Web services, see [XML Web Services Using ASP.NET](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ba0z6a33(v=vs.100)). For more information about Web Services Description Language (WSDL), see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - - -## Examples - The following example demonstrates the use of the `Matches` property. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/MimeText_Binding_Match_8/CPP/mimetext_binding_match_8.cpp" id="Snippet8"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/MimeTextBinding/Overview/mimetext_binding_match_8.cs" id="Snippet8"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/MimeTextBinding/Overview/mimetext_binding_match_8.vb" id="Snippet8"::: - + ]]> @@ -167,10 +151,7 @@ Specifies the URI for the XML namespace of the class. This field is constant. diff --git a/xml/System.Web.Services.Description/MimeTextMatch.xml b/xml/System.Web.Services.Description/MimeTextMatch.xml index 695cb903e5e..665ee8d0b5b 100644 --- a/xml/System.Web.Services.Description/MimeTextMatch.xml +++ b/xml/System.Web.Services.Description/MimeTextMatch.xml @@ -37,15 +37,6 @@ ## Remarks For more information about specifying protocols for XML Web services, see [XML Web Services Using ASP.NET](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ba0z6a33(v=vs.100)). For more information about Web Services Description Language (WSDL), see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - -## Examples - The following example demonstrates the use of the properties and methods exposed by the `MimeTextMatch` class. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/MimeText_Binding_Match_8/CPP/mimetext_binding_match_8.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/MimeTextBinding/Overview/mimetext_binding_match_8.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/MimeTextBinding/Overview/mimetext_binding_match_8.vb" id="Snippet1"::: - ]]> @@ -121,13 +112,6 @@ ## Remarks For more information, see the and properties. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/MimeTextMatch_5/CPP/mimetextmatch_5.cpp" id="Snippet2"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/MimeTextMatch/Capture/mimetextmatch_5.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/MimeTextMatch/Capture/mimetextmatch_5.vb" id="Snippet2"::: - ]]> The property value is negative. @@ -177,13 +161,6 @@ ## Remarks The value of this property must be less than or equal to the value of the property, or the XML Web service will not compile correctly. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/MimeTextMatch_5/CPP/mimetextmatch_5.cpp" id="Snippet3"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/MimeTextMatch/Capture/mimetextmatch_5.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/MimeTextMatch/Capture/mimetextmatch_5.vb" id="Snippet3"::: - ]]> The property value is negative. @@ -227,11 +204,6 @@ @@ -273,11 +245,6 @@ @@ -319,11 +286,6 @@ @@ -368,13 +330,6 @@ ## Remarks The value of this property can contain wildcard characters. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/MimeText_Binding_Match_8/CPP/mimetext_binding_match_8.cpp" id="Snippet6"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/MimeTextBinding/Overview/mimetext_binding_match_8.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/MimeTextBinding/Overview/mimetext_binding_match_8.vb" id="Snippet6"::: - ]]> @@ -421,13 +376,6 @@ This property returns the same information as the property, but as a 32-bit signed integer rather than as a string. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/MimeTextMatch_5/CPP/mimetextmatch_5.cpp" id="Snippet4"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/MimeTextMatch/Capture/mimetextmatch_5.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/MimeTextMatch/Capture/mimetextmatch_5.vb" id="Snippet4"::: - ]]> The property value is negative. @@ -477,13 +425,6 @@ ## Remarks This property returns the same information as the property, but as a string rather than as a 32-bit signed integer. A value of "*" corresponds to . - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/MimeTextMatch_5/CPP/mimetextmatch_5.cpp" id="Snippet5"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/MimeTextMatch/Capture/mimetextmatch_5.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/MimeTextMatch/Capture/mimetextmatch_5.vb" id="Snippet5"::: - ]]> @@ -528,11 +469,6 @@ ## Remarks This property returns an empty string ("") if its value has not been set. - - -## Examples - MimeText_Binding_Match_8#5 - ]]> diff --git a/xml/System.Web.Services.Description/MimeTextMatchCollection.xml b/xml/System.Web.Services.Description/MimeTextMatchCollection.xml index 4973a1500b5..6d106943567 100644 --- a/xml/System.Web.Services.Description/MimeTextMatchCollection.xml +++ b/xml/System.Web.Services.Description/MimeTextMatchCollection.xml @@ -37,15 +37,6 @@ ## Remarks A represents a MIME text pattern for which an HTTP transmission will be searched. For more information about specifying protocols for XML Web services, see [XML Web Services Using ASP.NET](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ba0z6a33(v=vs.100)). For more information about Web Services Description Language (WSDL), see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - -## Examples - The following example demonstrates the use of the properties and methods exposed by the `MimeTextMatchCollection` class. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/MimeText_Match_MatchColl_9/CPP/mimetext_match_matchcoll_9.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/MimeTextMatchCollection/Overview/mimetext_match_matchcoll_9.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/MimeTextMatchCollection/Overview/mimetext_match_matchcoll_9.vb" id="Snippet1"::: - ]]> @@ -112,13 +103,6 @@ @@ -159,13 +143,6 @@ @@ -206,13 +183,6 @@ @@ -252,13 +222,6 @@ @@ -306,15 +269,6 @@ The elements after the insertion point move down to accommodate the new element. - - -## Examples - The following example demonstrates the use of the `Insert` method. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/MimeText_Match_MatchColl_9/CPP/mimetext_match_matchcoll_9.cpp" id="Snippet9"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/MimeTextMatchCollection/Overview/mimetext_match_matchcoll_9.cs" id="Snippet9"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/MimeTextMatchCollection/Overview/mimetext_match_matchcoll_9.vb" id="Snippet9"::: - ]]> The parameter is less than zero. @@ -359,13 +313,6 @@ @@ -409,13 +356,6 @@ The elements that follow the removed `MimeTextMatch` move up to occupy the vacated spot. - - -## Examples - The following example demonstrates the use of the `Remove` method. - - MimeText_Match_MatchColl_9#6 - ]]> diff --git a/xml/System.Web.Services.Description/MimeXmlBinding.xml b/xml/System.Web.Services.Description/MimeXmlBinding.xml index 86b2bd7a6ae..a3da8989e38 100644 --- a/xml/System.Web.Services.Description/MimeXmlBinding.xml +++ b/xml/System.Web.Services.Description/MimeXmlBinding.xml @@ -42,16 +42,7 @@ ## Remarks For more information about specifying protocols for XML Web services, see [XML Web Services Using ASP.NET](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ba0z6a33(v=vs.100)). For more information about Web Services Description Language (WSDL), see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - - -## Examples - The following example demonstrates a typical use of the `MimeXmlBinding` class. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/MimeXmlBinding_Part_3/CPP/mimexmlbinding_part_3.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/MimeXmlBinding/Overview/mimexmlbinding_part_3.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/MimeXmlBinding/Overview/mimexmlbinding_part_3.vb" id="Snippet1"::: - + ]]> @@ -119,10 +110,7 @@ The name of the corresponding . The default value is an empty string (""). diff --git a/xml/System.Web.Services.Description/Operation.xml b/xml/System.Web.Services.Description/Operation.xml index 975fb76ab17..b112d014251 100644 --- a/xml/System.Web.Services.Description/Operation.xml +++ b/xml/System.Web.Services.Description/Operation.xml @@ -43,15 +43,6 @@ ## Remarks The class corresponds to the Web Services Description Language (WSDL) `operation` element enclosed by the `portType` element. For more information about WSDL, see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - -## Examples - The following example demonstrates a typical use of the class. The example takes a that does not have a that supports the HTTP POST protocol. It adds a instance that supports POST, and writes out a new WSDL contract. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/Operation_5/CPP/operation_5.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/Operation/Overview/operation_5.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/Operation/Overview/operation_5.vb" id="Snippet1"::: - ]]> @@ -158,11 +149,6 @@ @@ -203,13 +189,6 @@ method. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/Operation_IsBoundBy/CPP/operation_isboundby.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/Operation/IsBoundBy/operation_isboundby.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/Operation/IsBoundBy/operation_isboundby.vb" id="Snippet1"::: - ]]> @@ -258,13 +237,6 @@ ## Remarks Because an is associated with exactly one and exactly one , only one instance of each can be a member of this collection, and thus the collection can have a maximum of two members. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/Operation_5/CPP/operation_5.cpp" id="Snippet3"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/Operation/Overview/operation_5.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/Operation/Overview/operation_5.vb" id="Snippet3"::: - ]]> @@ -309,13 +281,6 @@ ## Remarks The elements of this array are identical to those of the property, but housed in an array rather than a space-delimited string. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/Operation_2/CPP/operation_2.cpp" id="Snippet2"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/Operation/ParameterOrder/operation_2.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/Operation/ParameterOrder/operation_2.vb" id="Snippet2"::: - ]]> @@ -376,13 +341,6 @@ Note that this parameter list is not required, even if the is to be used with an RPC-style . Do not call directly. This method is only used internally for XML serialization. To return the parameter list use . - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/Operation_2/CPP/operation_2.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/Operation/ParameterOrder/operation_2.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/Operation/ParameterOrder/operation_2.vb" id="Snippet1"::: - ]]> @@ -418,9 +376,6 @@ diff --git a/xml/System.Web.Services.Description/OperationBinding.xml b/xml/System.Web.Services.Description/OperationBinding.xml index ed80d91e702..ff23971d684 100644 --- a/xml/System.Web.Services.Description/OperationBinding.xml +++ b/xml/System.Web.Services.Description/OperationBinding.xml @@ -43,15 +43,6 @@ ## Remarks The `OperationBinding` class corresponds to the Web Services Description Language (WSDL) `` element enclosed by the `` element, which in turn corresponds to the class. For more information about WSDL, see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - -## Examples - The following example demonstrates the use of the properties and methods exposed by the `OperationBinding` class. It takes an existing and adds support for the SOAP protocol. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/OperationBinding_OperationBinding/CPP/operationbinding_operationbinding.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/OperationBinding/Overview/operationbinding_operationbinding.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/OperationBinding/Overview/operationbinding_operationbinding.vb" id="Snippet1"::: - ]]> @@ -117,13 +108,6 @@ ## Remarks The current is a member of the collection. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/OperationBinding_OperationBinding/CPP/operationbinding_operationbinding.cpp" id="Snippet5"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/OperationBinding/Overview/operationbinding_operationbinding.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/OperationBinding/Overview/operationbinding_operationbinding.vb" id="Snippet5"::: - ]]> @@ -169,13 +153,6 @@ ## Remarks For more information about Web Services Description Language (WSDL), see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/OperationBinding_OperationBinding/CPP/operationbinding_operationbinding.cpp" id="Snippet6"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/OperationBinding/Overview/operationbinding_operationbinding.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/OperationBinding/Overview/operationbinding_operationbinding.vb" id="Snippet6"::: - ]]> @@ -217,11 +194,6 @@ @@ -266,13 +238,6 @@ ## Remarks An `OperationBinding` will be associated with exactly one `InputBinding`. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/OperationBinding_OperationBinding/CPP/operationbinding_operationbinding.cpp" id="Snippet4"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/OperationBinding/Overview/operationbinding_operationbinding.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/OperationBinding/Overview/operationbinding_operationbinding.vb" id="Snippet4"::: - ]]> @@ -317,11 +282,6 @@ ## Remarks An `OperationBinding` will be associated with exactly one `OutputBinding`. - - -## Examples - OperationBinding_OperationBinding#5 - ]]> diff --git a/xml/System.Web.Services.Description/OperationBindingCollection.xml b/xml/System.Web.Services.Description/OperationBindingCollection.xml index 8405f9ff18e..ccda400c8e8 100644 --- a/xml/System.Web.Services.Description/OperationBindingCollection.xml +++ b/xml/System.Web.Services.Description/OperationBindingCollection.xml @@ -37,13 +37,6 @@ ## Remarks The class corresponds to the Web Services Description Language (WSDL) `` element enclosed by the `` element, which in turn corresponds to the class. For more information about WSDL, see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/OperationBindingCollection_OperationBindingCollection/CPP/operationbindingcollection_operationbindingcollection.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/OperationBindingCollection/Overview/operationbindingcollection_operationbindingcollection.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/OperationBindingCollection/Overview/operationbindingcollection_operationbindingcollection.vb" id="Snippet1"::: - ]]> @@ -83,13 +76,6 @@ @@ -130,13 +116,6 @@ @@ -177,13 +156,6 @@ @@ -223,13 +195,6 @@ @@ -277,15 +242,6 @@ The elements after the insertion point move down to accommodate the new element. - - -## Examples - The following example demonstrates the use of the `Insert` method. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/OperationBindingCollection_OperationBindingCollection/CPP/operationbindingcollection_operationbindingcollection.cpp" id="Snippet6"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/OperationBindingCollection/Overview/operationbindingcollection_operationbindingcollection.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/OperationBindingCollection/Overview/operationbindingcollection_operationbindingcollection.vb" id="Snippet6"::: - ]]> @@ -325,13 +281,6 @@ @@ -375,15 +324,6 @@ The elements that follow the removed move up to occupy the vacated spot. - - -## Examples - The following example demonstrates the use of the `Remove` method. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/OperationBindingCollection_OperationBindingCollection/CPP/operationbindingcollection_operationbindingcollection.cpp" id="Snippet5"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/OperationBindingCollection/Overview/operationbindingcollection_operationbindingcollection.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/OperationBindingCollection/Overview/operationbindingcollection_operationbindingcollection.vb" id="Snippet5"::: - ]]> diff --git a/xml/System.Web.Services.Description/OperationCollection.xml b/xml/System.Web.Services.Description/OperationCollection.xml index 6fb8b0e8779..cbc4af64e1c 100644 --- a/xml/System.Web.Services.Description/OperationCollection.xml +++ b/xml/System.Web.Services.Description/OperationCollection.xml @@ -37,15 +37,6 @@ ## Remarks The class corresponds to the Web Services Description Language (WSDL) `` element enclosed by the `` element. For more information about WSDL, see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - -## Examples - The following example demonstrates the use of the properties and methods exposed by the `OperationCollection` class. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/OperationCollection_Methods/CPP/operationcollection_methods.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/OperationCollection/Overview/operationcollection_methods.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/OperationCollection/Overview/operationcollection_methods.vb" id="Snippet1"::: - ]]> @@ -85,13 +76,6 @@ @@ -132,13 +116,6 @@ @@ -179,13 +156,6 @@ @@ -225,13 +195,6 @@ @@ -279,15 +242,6 @@ The elements after the insertion point move down to accommodate the new element. - - -## Examples - The following example demonstrates the use of the `Insert` method. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/OperationCollection_Methods/CPP/operationcollection_methods.cpp" id="Snippet6"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/OperationCollection/Overview/operationcollection_methods.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/OperationCollection/Overview/operationcollection_methods.vb" id="Snippet6"::: - ]]> @@ -327,13 +281,6 @@ @@ -377,15 +324,6 @@ The elements that follow the removed move up to occupy the vacated spot. - - -## Examples - The following example demonstrates the use of the `Remove` method. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/OperationCollection_Methods/CPP/operationcollection_methods.cpp" id="Snippet5"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/OperationCollection/Overview/operationcollection_methods.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/OperationCollection/Overview/operationcollection_methods.vb" id="Snippet5"::: - ]]> diff --git a/xml/System.Web.Services.Description/OperationFault.xml b/xml/System.Web.Services.Description/OperationFault.xml index 2382e4a9805..9d683ac911c 100644 --- a/xml/System.Web.Services.Description/OperationFault.xml +++ b/xml/System.Web.Services.Description/OperationFault.xml @@ -45,15 +45,6 @@ The class corresponds to the Web Services Description Language (WSDL) `fault` element enclosed by the `operation` element that is in turn enclosed by the `portType` element. For more information about WSDL, see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - -## Examples - The following example demonstrates the use of the properties and methods exposed by the class. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/OperationFault_OperationFault/CPP/operationfault_operationfault.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/OperationFault/Overview/operationfault_operationfault.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/OperationFault/Overview/operationfault_operationfault.vb" id="Snippet1"::: - ]]> diff --git a/xml/System.Web.Services.Description/OperationFaultCollection.xml b/xml/System.Web.Services.Description/OperationFaultCollection.xml index 961c95beb6d..5868694b8a9 100644 --- a/xml/System.Web.Services.Description/OperationFaultCollection.xml +++ b/xml/System.Web.Services.Description/OperationFaultCollection.xml @@ -37,13 +37,6 @@ ## Remarks The class corresponds to the Web Services Description Language (WSDL) `` element enclosed by the `` element that is in turn enclosed by the `` element. For more information about WSDL, see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/OperationFaultCollection_7/CPP/operationfaultcollection_7.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/OperationFaultCollection/Overview/operationfaultcollection_7.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/OperationFaultCollection/Overview/operationfaultcollection_7.vb" id="Snippet1"::: - ]]> @@ -83,11 +76,6 @@ @@ -128,11 +116,6 @@ @@ -173,11 +156,6 @@ @@ -252,11 +230,6 @@ @@ -304,13 +277,6 @@ The elements after the insertion point move down to accommodate the new element. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/OperationFaultCollection_7/CPP/operationfaultcollection_7.cpp" id="Snippet5"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/OperationFaultCollection/Overview/operationfaultcollection_7.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/OperationFaultCollection/Overview/operationfaultcollection_7.vb" id="Snippet5"::: - ]]> @@ -360,11 +326,6 @@ @@ -404,11 +365,6 @@ @@ -452,13 +408,6 @@ The elements that follow the removed move up to occupy the vacated spot. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/OperationFaultCollection_7/CPP/operationfaultcollection_7.cpp" id="Snippet7"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/OperationFaultCollection/Overview/operationfaultcollection_7.cs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/OperationFaultCollection/Overview/operationfaultcollection_7.vb" id="Snippet7"::: - ]]> diff --git a/xml/System.Web.Services.Description/OperationFlow.xml b/xml/System.Web.Services.Description/OperationFlow.xml index 40a44edfaef..2e1c1244a28 100644 --- a/xml/System.Web.Services.Description/OperationFlow.xml +++ b/xml/System.Web.Services.Description/OperationFlow.xml @@ -35,16 +35,7 @@ ## Remarks Although request-response or solicit-response operations are logically correlated in the Web Services Description Language (WSDL) document, the concrete correlation information will be specified by a binding. For example, the request and response messages can be exchanged as part of one or two actual HTTP transmissions. - - - -## Examples - The following sample demonstrates the use of the `OperationFlow` enumeration. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/OperationFlow_Enum/CPP/operationflow_enum.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/OperationFlow/Overview/operationflow_enum.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/OperationFlow/Overview/operationflow_enum.vb" id="Snippet1"::: - + ]]> diff --git a/xml/System.Web.Services.Description/OperationInput.xml b/xml/System.Web.Services.Description/OperationInput.xml index 6f57b39dab6..1e4b862e23e 100644 --- a/xml/System.Web.Services.Description/OperationInput.xml +++ b/xml/System.Web.Services.Description/OperationInput.xml @@ -45,13 +45,6 @@ The class corresponds to the Web Services Description Language (WSDL) `input` element enclosed by the `operation` element that is in turn enclosed by the `portType` element. For more information about WSDL, see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/OperationInput_OperationInput/CPP/operationinput_operationinput.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/OperationInput/Overview/operationinput_operationinput.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/OperationInput/Overview/operationinput_operationinput.vb" id="Snippet1"::: - ]]> diff --git a/xml/System.Web.Services.Description/OperationMessage.xml b/xml/System.Web.Services.Description/OperationMessage.xml index 5a10be83ad7..7b2344cbe9e 100644 --- a/xml/System.Web.Services.Description/OperationMessage.xml +++ b/xml/System.Web.Services.Description/OperationMessage.xml @@ -42,14 +42,7 @@ - - - - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/OperationMessage_Properties/CPP/operationmessage_properties.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/OperationMessage/Overview/operationmessage_properties.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/OperationMessage/Overview/operationmessage_properties.vb" id="Snippet1"::: - + ]]> @@ -117,12 +110,7 @@ An XML qualified name. @@ -157,10 +145,7 @@ The operation of which the is a member. diff --git a/xml/System.Web.Services.Description/OperationMessageCollection.xml b/xml/System.Web.Services.Description/OperationMessageCollection.xml index a8136ac85c9..fcf4e9fc885 100644 --- a/xml/System.Web.Services.Description/OperationMessageCollection.xml +++ b/xml/System.Web.Services.Description/OperationMessageCollection.xml @@ -37,13 +37,6 @@ ## Remarks An instance of this class will be returned by the property of the parent . As such, it can have exactly two members, one an and the other an . - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/OperationMessageCollection_Sample/CPP/operationmessagecollection_sample.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/OperationMessageCollection/Overview/operationmessagecollection_sample.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/OperationMessageCollection/Overview/operationmessagecollection_sample.vb" id="Snippet1"::: - ]]> @@ -83,11 +76,6 @@ @@ -128,11 +116,6 @@ @@ -173,11 +156,6 @@ @@ -213,11 +191,6 @@ @@ -257,11 +230,6 @@ @@ -297,11 +265,6 @@ @@ -349,13 +312,6 @@ The elements after the insertion point move down to accommodate the new element. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/OperationMessageCollection_Sample/CPP/operationmessagecollection_sample.cpp" id="Snippet8"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/OperationMessageCollection/Overview/operationmessagecollection_sample.cs" id="Snippet8"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/OperationMessageCollection/Overview/operationmessagecollection_sample.vb" id="Snippet8"::: - ]]> @@ -395,11 +351,6 @@ @@ -543,11 +494,6 @@ @@ -591,13 +537,6 @@ The elements that follow the removed move up to occupy the vacated spot. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/OperationMessageCollection_Sample/CPP/operationmessagecollection_sample.cpp" id="Snippet7"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/OperationMessageCollection/Overview/operationmessagecollection_sample.cs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/OperationMessageCollection/Overview/operationmessagecollection_sample.vb" id="Snippet7"::: - ]]> diff --git a/xml/System.Web.Services.Description/OperationOutput.xml b/xml/System.Web.Services.Description/OperationOutput.xml index a7ecf4b7616..2f7f78fc629 100644 --- a/xml/System.Web.Services.Description/OperationOutput.xml +++ b/xml/System.Web.Services.Description/OperationOutput.xml @@ -45,13 +45,6 @@ The class corresponds to the Web Services Description Language (WSDL) `output` element enclosed by the `operation` element that is in turn enclosed by the `portType` element. For more information about WSDL, see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/OperationOutput_OperationOutput/CPP/operationoutput_operationoutput.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/OperationOutput/Overview/operationoutput_operationoutput.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/OperationOutput/Overview/operationoutput_operationoutput.vb" id="Snippet1"::: - ]]> diff --git a/xml/System.Web.Services.Description/OutputBinding.xml b/xml/System.Web.Services.Description/OutputBinding.xml index ab23d228f12..b8de6d8667b 100644 --- a/xml/System.Web.Services.Description/OutputBinding.xml +++ b/xml/System.Web.Services.Description/OutputBinding.xml @@ -42,16 +42,7 @@ ## Remarks The `OutputBinding` class corresponds to the Web Services Description Language (WSDL) `` element enclosed by the `` element, which in turn corresponds to the class. For more information about WSDL, see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - - -## Examples - The following example demonstrates a typical use of the `OutputBinding` class. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/DescriptionNamespaceSample1/CPP/descriptionnamespacesample1.cpp" id="Snippet3"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/InputBinding/Overview/descriptionnamespacesample1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/InputBinding/Overview/descriptionnamespacesample1.vb" id="Snippet3"::: - + ]]> @@ -119,10 +110,7 @@ A collection of service description format extension. diff --git a/xml/System.Web.Services.Description/Port.xml b/xml/System.Web.Services.Description/Port.xml index ba02070c52b..b064bc2e89e 100644 --- a/xml/System.Web.Services.Description/Port.xml +++ b/xml/System.Web.Services.Description/Port.xml @@ -45,15 +45,6 @@ This class corresponds to the Web Services Description Language (WSDL) `` element, which is enclosed by the `` element. For more information about WSDL, see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - -## Examples - The following examples creates a and adds it to the collection of an existing named `myDescription`. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/PortClass/CPP/portclass.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/Port/Overview/portclass.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/Port/Overview/portclass.vb" id="Snippet1"::: - ]]> @@ -126,13 +117,6 @@ ## Remarks A binding defines message format and protocol details for operations and messages for a . This property gets or sets those values for a specific `Port`. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/PortClass/CPP/portclass.cpp" id="Snippet2"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/Port/Overview/portclass.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/Port/Overview/portclass.vb" id="Snippet2"::: - ]]> @@ -174,11 +158,6 @@ @@ -214,9 +193,6 @@ diff --git a/xml/System.Web.Services.Description/PortCollection.xml b/xml/System.Web.Services.Description/PortCollection.xml index eb9e4662d44..25582c9d455 100644 --- a/xml/System.Web.Services.Description/PortCollection.xml +++ b/xml/System.Web.Services.Description/PortCollection.xml @@ -34,11 +34,6 @@ @@ -78,11 +73,6 @@ @@ -123,11 +113,6 @@ @@ -168,11 +153,6 @@ @@ -247,11 +227,6 @@ @@ -299,13 +274,6 @@ The elements after the insertion point move down to accommodate the new element. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/PortCollection_CopyTo/CPP/portcollection_copyto.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/PortCollection/CopyTo/portcollection_copyto.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/PortCollection/CopyTo/portcollection_copyto.vb" id="Snippet1"::: - ]]> The parameter is less than zero. @@ -360,11 +328,6 @@ @@ -404,11 +367,6 @@ @@ -452,13 +410,6 @@ The elements that follow the removed move up to occupy the vacated spot. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/PortCollection_Item/CPP/portcollection_item.cpp" id="Snippet2"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/PortCollection/Overview/portcollection_item.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/PortCollection/Overview/portcollection_item.vb" id="Snippet2"::: - ]]> diff --git a/xml/System.Web.Services.Description/PortType.xml b/xml/System.Web.Services.Description/PortType.xml index d1ad89e36e7..7820b5881fe 100644 --- a/xml/System.Web.Services.Description/PortType.xml +++ b/xml/System.Web.Services.Description/PortType.xml @@ -42,14 +42,7 @@ ## Remarks The class corresponds to the Web Services Description Language (WSDL) `portType` element enclosed by the `definitions` root element. For more information about WSDL, see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/PortType_Class/CPP/porttype_class.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/PortType/Overview/porttype_class.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/PortType/Overview/porttype_class.vb" id="Snippet1"::: - + ]]> @@ -154,12 +147,7 @@ A collection of operation instances defined by the . @@ -194,10 +182,7 @@ A service description of which the is a member. diff --git a/xml/System.Web.Services.Description/PortTypeCollection.xml b/xml/System.Web.Services.Description/PortTypeCollection.xml index 8b211060928..a5a0c00c3d3 100644 --- a/xml/System.Web.Services.Description/PortTypeCollection.xml +++ b/xml/System.Web.Services.Description/PortTypeCollection.xml @@ -34,11 +34,6 @@ @@ -78,11 +73,6 @@ @@ -123,11 +113,6 @@ @@ -168,11 +153,6 @@ @@ -247,11 +227,6 @@ @@ -299,13 +274,6 @@ The elements after the insertion point move down to accommodate the new element. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/PortTypeCollection_2/CPP/porttypecollection_2.cpp" id="Snippet2"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/PortTypeCollection/Contains/porttypecollection_2.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/PortTypeCollection/Contains/porttypecollection_2.vb" id="Snippet2"::: - ]]> The parameter is less than zero. @@ -360,11 +328,6 @@ @@ -404,11 +367,6 @@ The parameter cannot be explicitly cast to type . @@ -453,13 +411,6 @@ The elements that follow the removed move up to occupy the vacated spot. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/PortTypeCollection_1/CPP/porttypecollection_1.cpp" id="Snippet2"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/PortTypeCollection/Add/porttypecollection_1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/PortTypeCollection/Add/porttypecollection_1.vb" id="Snippet2"::: - ]]> diff --git a/xml/System.Web.Services.Description/Service.xml b/xml/System.Web.Services.Description/Service.xml index bbc6f5b6bb1..8a4914642cb 100644 --- a/xml/System.Web.Services.Description/Service.xml +++ b/xml/System.Web.Services.Description/Service.xml @@ -42,14 +42,7 @@ ## Remarks The `Service` class corresponds to the Web Services Description Language (WSDL) `` element enclosed by the `` root element. For more information about WSDL, see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/ServiceClass/CPP/serviceclass.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/Service/Overview/serviceclass.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/Service/Overview/serviceclass.vb" id="Snippet1"::: - + ]]> @@ -117,12 +110,7 @@ The collection of extensibility elements associated with the . @@ -163,12 +151,7 @@ A collection of port instances contained in the . @@ -203,10 +186,7 @@ A of which the is a member. diff --git a/xml/System.Web.Services.Description/ServiceCollection.xml b/xml/System.Web.Services.Description/ServiceCollection.xml index 904df419ce3..ec44be7093d 100644 --- a/xml/System.Web.Services.Description/ServiceCollection.xml +++ b/xml/System.Web.Services.Description/ServiceCollection.xml @@ -76,11 +76,6 @@ @@ -121,11 +116,6 @@ @@ -166,11 +156,6 @@ @@ -245,11 +230,6 @@ @@ -297,13 +277,6 @@ The elements after the insertion point move down to accommodate the new element. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_Read/CPP/servicedescription_read.cpp" id="Snippet3"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/ServiceCollection/Insert/servicedescription_read.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Insert/servicedescription_read.vb" id="Snippet3"::: - ]]> The parameter is less than zero. @@ -358,11 +331,6 @@ @@ -402,11 +370,6 @@ @@ -450,13 +413,6 @@ The elements that follow the removed move up to occupy the vacated spot. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/ServiceCollection_Item/CPP/servicecollection_item.cpp" id="Snippet2"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/ServiceCollection/Add/servicecollection_item.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Add/servicecollection_item.vb" id="Snippet2"::: - ]]> diff --git a/xml/System.Web.Services.Description/ServiceDescription.xml b/xml/System.Web.Services.Description/ServiceDescription.xml index eb6695d92d8..5f10aa4ba27 100644 --- a/xml/System.Web.Services.Description/ServiceDescription.xml +++ b/xml/System.Web.Services.Description/ServiceDescription.xml @@ -49,15 +49,6 @@ WSDL is an XML-based language for describing XML Web services. The class corresponds to the root element, `definitions`, of a WSDL file. For more information about WSDL, see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - -## Examples - The following example shows how to create an instance of the class. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/ServiceDescription/CPP/servicedescription.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/ServiceDescription/Overview/servicedescription.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Overview/servicedescription.vb" id="Snippet1"::: - ]]> @@ -129,13 +120,6 @@ ## Remarks The returned by this property corresponds to the list of `binding` elements enclosed by the Web Services Description Language (WSDL) `definitions` root element. For more information about WSDL, see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_Bindings/CPP/servicedescription_bindings.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/ServiceDescription/Bindings/servicedescription_bindings.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Bindings/servicedescription_bindings.vb" id="Snippet1"::: - ]]> @@ -176,11 +160,6 @@ @@ -222,11 +201,6 @@ @@ -271,13 +245,6 @@ ## Remarks The returned by this property corresponds to the list of `import` elements enclosed by the Web Services Description Language (WSDL) `definitions` root element. For more information about WSDL, see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_Imports_Service/CPP/servicedescription_imports.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/ServiceDescription/Imports/servicedescription_imports.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Imports/servicedescription_imports.vb" id="Snippet1"::: - ]]> @@ -322,13 +289,6 @@ ## Remarks The returned by this property corresponds to the list of `message` elements enclosed by the Web Services Description Language (WSDL) `definitions` root element. For more information about WSDL, see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_Constructor_4/CPP/servicedescription_constructor_4.cpp" id="Snippet3"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/ServiceDescription/Messages/servicedescription_constructor_4.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Messages/servicedescription_constructor_4.vb" id="Snippet3"::: - ]]> @@ -363,11 +323,6 @@ @@ -412,13 +367,6 @@ ## Remarks The returned by this property corresponds to the list of `portType` elements enclosed by the Web Services Description Language (WSDL) `definitions` root element. For more information about WSDL, see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_PortTypes_2/CPP/servicedescription_porttypes_2.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/ServiceDescription/CanRead/servicedescription_porttypes_2.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/CanRead/servicedescription_porttypes_2.vb" id="Snippet1"::: - ]]> @@ -468,11 +416,6 @@ @@ -512,11 +455,6 @@ @@ -556,11 +494,6 @@ @@ -600,11 +533,6 @@ @@ -794,11 +722,6 @@ @@ -956,13 +879,6 @@ ## Remarks The returned by this property corresponds to the list of `service` elements enclosed by the Web Services Description Language (WSDL) `definitions` root element. For more information about WSDL, see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/ServiceCollection_Item/CPP/servicecollection_item.cpp" id="Snippet4"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/ServiceCollection/Add/servicecollection_item.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/ServiceCollection/Add/servicecollection_item.vb" id="Snippet4"::: - ]]> @@ -1004,11 +920,6 @@ @@ -1053,13 +964,6 @@ ## Remarks The instance returned by this property corresponds to the list of `types` elements enclosed by the Web Services Description Language (WSDL) `definitions` root element. For more information about WSDL, see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/ServiceDescription_Types/CPP/servicedescription_types.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/ServiceDescription/Types/servicedescription_types.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/ServiceDescription/Types/servicedescription_types.vb" id="Snippet1"::: - ]]> @@ -1145,11 +1049,6 @@ @@ -1222,11 +1121,6 @@ @@ -1265,9 +1159,6 @@ diff --git a/xml/System.Web.Services.Description/ServiceDescriptionBaseCollection.xml b/xml/System.Web.Services.Description/ServiceDescriptionBaseCollection.xml index 7c89da01295..05a5683c37f 100644 --- a/xml/System.Web.Services.Description/ServiceDescriptionBaseCollection.xml +++ b/xml/System.Web.Services.Description/ServiceDescriptionBaseCollection.xml @@ -33,12 +33,7 @@ Forms the basis for the strongly typed collections that are members of the namespace. diff --git a/xml/System.Web.Services.Description/ServiceDescriptionCollection.xml b/xml/System.Web.Services.Description/ServiceDescriptionCollection.xml index 41d20c08e77..d92d1f0af9a 100644 --- a/xml/System.Web.Services.Description/ServiceDescriptionCollection.xml +++ b/xml/System.Web.Services.Description/ServiceDescriptionCollection.xml @@ -34,11 +34,6 @@ @@ -70,11 +65,6 @@ @@ -114,11 +104,6 @@ @@ -159,10 +144,6 @@ @@ -203,11 +184,6 @@ @@ -247,11 +223,6 @@ The specified is not a member of any instances within the collection. @@ -327,11 +298,6 @@ The specified is not a member of any instances within the collection. @@ -372,11 +338,6 @@ The specified is not a member of any instances within the collection. @@ -417,11 +378,6 @@ The specified is not a member of any instances within the collection. @@ -462,10 +418,6 @@ @@ -513,13 +465,6 @@ The elements after the insertion point move down to accommodate the new element. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionCollection_Insert_Item_CopyTo/CPP/sdcollection_insert_item_copyto.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/CopyTo/servicedescriptioncollection_insert_item_copyto.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/CopyTo/servicedescriptioncollection_insert_item_copyto.vb" id="Snippet1"::: - ]]> The parameter is less than zero. @@ -574,11 +519,6 @@ @@ -618,11 +558,6 @@ @@ -702,12 +637,6 @@ The elements that follow the removed move up to occupy the vacated spot. - - -## Examples - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/ServiceDescriptionCollection/Contains/servicedescriptioncollection_contains_indexof_remove.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionCollection/Contains/servicedescriptioncollection_contains_indexof_remove.vb" id="Snippet3"::: - ]]> diff --git a/xml/System.Web.Services.Description/ServiceDescriptionFormatExtensionCollection.xml b/xml/System.Web.Services.Description/ServiceDescriptionFormatExtensionCollection.xml index 4c6fd95acf5..fa611fa031f 100644 --- a/xml/System.Web.Services.Description/ServiceDescriptionFormatExtensionCollection.xml +++ b/xml/System.Web.Services.Description/ServiceDescriptionFormatExtensionCollection.xml @@ -37,13 +37,6 @@ ## Remarks This collection can either contain instances of classes deriving from , or instances of the class. In a derived class, class allows users to define extensibility elements in addition to those defined in the Web Services Description Language (WSDL) specification. Use these in your if you know in advance the type of extensibility element you want to make. Use an when you do not know the format of an element in advance. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionFormatExtension_13/CPP/servicedescriptionformatextension_13.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/ServiceDescriptionFormatExtensionCollection/Overview/servicedescriptionformatextension_13.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionFormatExtensionCollection/Overview/servicedescriptionformatextension_13.vb" id="Snippet1"::: - ]]> @@ -82,13 +75,6 @@ ## Remarks Since many of the classes in the namespace expose an `Extensions` property representing a , the constructor assigns a parent object corresponding to the level within the Web Services Description Language (WSDL) hierarchy where the current `ServiceDescriptionFormatExtensionCollection` is nested. For more information about WSDL, see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionFormatExtension_13/CPP/servicedescriptionformatextension_13.cpp" id="Snippet2"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/ServiceDescriptionFormatExtensionCollection/Overview/servicedescriptionformatextension_13.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionFormatExtensionCollection/Overview/servicedescriptionformatextension_13.vb" id="Snippet2"::: - ]]> @@ -128,11 +114,6 @@ @@ -173,11 +154,6 @@ @@ -218,11 +194,6 @@ @@ -319,13 +290,6 @@ ## Remarks This method searches the collection in index order, and returns the first that meets the criteria of the two parameters. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionFormatExtension_13/CPP/servicedescriptionformatextension_13.cpp" id="Snippet5"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/ServiceDescriptionFormatExtensionCollection/Overview/servicedescriptionformatextension_13.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionFormatExtensionCollection/Overview/servicedescriptionformatextension_13.vb" id="Snippet5"::: - ]]> @@ -380,13 +344,6 @@ > [!NOTE] > The array returned is empty if the search is unsuccessful. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionFormatExtension_13/CPP/servicedescriptionformatextension_13.cpp" id="Snippet6"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/ServiceDescriptionFormatExtensionCollection/Overview/servicedescriptionformatextension_13.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionFormatExtensionCollection/Overview/servicedescriptionformatextension_13.vb" id="Snippet6"::: - ]]> @@ -472,11 +429,6 @@ @@ -524,13 +476,6 @@ The elements after the insertion point move down to accommodate the new element. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionFormatExtension_13/CPP/servicedescriptionformatextension_13.cpp" id="Snippet13"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/ServiceDescriptionFormatExtensionCollection/Overview/servicedescriptionformatextension_13.cs" id="Snippet13"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionFormatExtensionCollection/Overview/servicedescriptionformatextension_13.vb" id="Snippet13"::: - ]]> The parameter is less than zero. @@ -579,13 +524,6 @@ ## Remarks This method checks whether the `item` parameter is an or a (or a derived class) before determining whether it is supported by the XML Web service. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/ServiceDescriptionFormatExtension_13/CPP/servicedescriptionformatextension_13.cpp" id="Snippet7"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/ServiceDescriptionFormatExtensionCollection/Overview/servicedescriptionformatextension_13.cs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/ServiceDescriptionFormatExtensionCollection/Overview/servicedescriptionformatextension_13.vb" id="Snippet7"::: - ]]> @@ -626,11 +564,6 @@ @@ -670,11 +603,6 @@ @@ -747,11 +675,6 @@ diff --git a/xml/System.Web.Services.Description/SoapAddressBinding.xml b/xml/System.Web.Services.Description/SoapAddressBinding.xml index 8f7e7bd058f..8e847d7cc5a 100644 --- a/xml/System.Web.Services.Description/SoapAddressBinding.xml +++ b/xml/System.Web.Services.Description/SoapAddressBinding.xml @@ -42,14 +42,7 @@ ## Remarks For more information about specifying protocols for XML Web services, see [XML Web Services Using ASP.NET](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ba0z6a33(v=vs.100)). For more information about Web Services Description Language (WSDL), see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/SoapOperationBinding/CPP/soapoperationbinding.cpp" id="Snippet4"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/SoapAddressBinding/Overview/soapoperationbinding.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/SoapAddressBinding/Overview/soapoperationbinding.vb" id="Snippet4"::: - + ]]> @@ -119,9 +112,6 @@ diff --git a/xml/System.Web.Services.Description/SoapBinding.xml b/xml/System.Web.Services.Description/SoapBinding.xml index 6fd3e780c60..5b5a1523633 100644 --- a/xml/System.Web.Services.Description/SoapBinding.xml +++ b/xml/System.Web.Services.Description/SoapBinding.xml @@ -52,14 +52,7 @@ This class specifies that the data transmission will use the SOAP protocol version 1.1. For more information about specifying protocols for XML Web services, see [XML Web Services Using ASP.NET](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ba0z6a33(v=vs.100)). For more information about Web Services Description Language (WSDL), see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/SoapOperationBinding/CPP/soapoperationbinding.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/SoapAddressBinding/Overview/soapoperationbinding.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/SoapAddressBinding/Overview/soapoperationbinding.vb" id="Snippet1"::: - + ]]> @@ -124,14 +117,7 @@ ## Remarks The field value is `"http://schemas.xmlsoap.org/soap/http/"`. - - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/SoapOperationBinding/CPP/soapoperationbinding.cpp" id="Snippet5"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/SoapAddressBinding/Overview/soapoperationbinding.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/SoapAddressBinding/Overview/soapoperationbinding.vb" id="Snippet5"::: - + ]]> @@ -168,14 +154,7 @@ ## Remarks The field value is `"http://schemas.xmlsoap.org/wsdl/soap/"`. - - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/SoapBodyBinding_Parts/CPP/soapbodybinding_parts.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/SoapBinding/Namespace/soapbodybinding_parts.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/SoapBinding/Namespace/soapbodybinding_parts.vb" id="Snippet1"::: - + ]]> @@ -252,11 +231,6 @@ @@ -303,8 +277,6 @@ -## Examples - SoapBinding_SoapOperationBinding#2 ]]> diff --git a/xml/System.Web.Services.Description/SoapBindingStyle.xml b/xml/System.Web.Services.Description/SoapBindingStyle.xml index f7ea47b1d88..c6ada0feb89 100644 --- a/xml/System.Web.Services.Description/SoapBindingStyle.xml +++ b/xml/System.Web.Services.Description/SoapBindingStyle.xml @@ -38,11 +38,6 @@ -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/SoapBinding_SoapOperationBinding/CPP/soapprotocol.cpp" id="Snippet3"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/SoapBinding/Style/soapprotocol.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/SoapBinding/Style/soapprotocol.vb" id="Snippet3"::: - ]]> diff --git a/xml/System.Web.Services.Description/SoapBodyBinding.xml b/xml/System.Web.Services.Description/SoapBodyBinding.xml index 2594d35c4e7..fcd43c1a9c9 100644 --- a/xml/System.Web.Services.Description/SoapBodyBinding.xml +++ b/xml/System.Web.Services.Description/SoapBodyBinding.xml @@ -45,13 +45,6 @@ For more information about specifying protocols for XML Web services, see [XML Web Services Using ASP.NET](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ba0z6a33(v=vs.100)). For more information about Web Services Description Language (WSDL), see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/SoapOperationBinding/CPP/soapoperationbinding.cpp" id="Snippet3"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/SoapAddressBinding/Overview/soapoperationbinding.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/SoapAddressBinding/Overview/soapoperationbinding.vb" id="Snippet3"::: - ]]> @@ -129,11 +122,6 @@ -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/SoapBindingStyle_Rpc/CPP/soapbindingstyle_rpc.cpp" id="Snippet3"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/SoapBodyBinding/Encoding/soapbindingstyle_rpc.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/SoapBodyBinding/Encoding/soapbindingstyle_rpc.vb" id="Snippet3"::: - ]]> @@ -184,11 +172,6 @@ -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/SoapBindingStyle_Rpc/CPP/soapbindingstyle_rpc.cpp" id="Snippet4"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/SoapBodyBinding/Encoding/soapbindingstyle_rpc.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/SoapBodyBinding/Encoding/soapbindingstyle_rpc.vb" id="Snippet4"::: - ]]> @@ -235,13 +218,6 @@ This property returns exactly the same information as the property, but the results are returned within an array rather than within a space-delimited string. - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/SoapBodyBinding_Parts/CPP/soapbodybinding_parts.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/SoapBinding/Namespace/soapbodybinding_parts.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/SoapBinding/Namespace/soapbodybinding_parts.vb" id="Snippet1"::: - ]]> @@ -290,11 +266,6 @@ -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/SoapFaultBinding_ctor/CPP/soapfaultbinding_ctor.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/SoapBodyBinding/PartsString/soapfaultbinding_ctor.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/SoapBodyBinding/PartsString/soapfaultbinding_ctor.vb" id="Snippet1"::: - ]]> @@ -345,8 +316,6 @@ -## Examples - SoapBinding_SoapOperationBinding#9 ]]> diff --git a/xml/System.Web.Services.Description/SoapFaultBinding.xml b/xml/System.Web.Services.Description/SoapFaultBinding.xml index b0f015c6cbf..4f6c5460452 100644 --- a/xml/System.Web.Services.Description/SoapFaultBinding.xml +++ b/xml/System.Web.Services.Description/SoapFaultBinding.xml @@ -47,11 +47,6 @@ -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/SoapFaultBinding/CPP/soapfaultbinding.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/SoapFaultBinding/Overview/soapfaultbinding.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/SoapFaultBinding/Overview/soapfaultbinding.vb" id="Snippet1"::: - ]]> @@ -129,11 +124,6 @@ -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/SoapFaultBinding_ctor/CPP/soapfaultbinding_ctor.cpp" id="Snippet4"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/SoapBodyBinding/PartsString/soapfaultbinding_ctor.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/SoapBodyBinding/PartsString/soapfaultbinding_ctor.vb" id="Snippet4"::: - ]]> @@ -217,11 +207,6 @@ -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/SoapFaultBinding_ctor/CPP/soapfaultbinding_ctor.cpp" id="Snippet5"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/SoapBodyBinding/PartsString/soapfaultbinding_ctor.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/SoapBodyBinding/PartsString/soapfaultbinding_ctor.vb" id="Snippet5"::: - ]]> @@ -267,11 +252,6 @@ diff --git a/xml/System.Web.Services.Description/SoapHeaderBinding.xml b/xml/System.Web.Services.Description/SoapHeaderBinding.xml index c5825a342b1..cd7d5534d03 100644 --- a/xml/System.Web.Services.Description/SoapHeaderBinding.xml +++ b/xml/System.Web.Services.Description/SoapHeaderBinding.xml @@ -45,11 +45,6 @@ -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/SoapHeaderBinding/CPP/soapheaderbinding.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/SoapHeaderBinding/Overview/soapheaderbinding.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/SoapHeaderBinding/Overview/soapheaderbinding.vb" id="Snippet1"::: - ]]> @@ -212,11 +207,6 @@ @@ -263,11 +253,6 @@ -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/SoapHeaderBinding_Use/CPP/soapheaderbinding_use.cpp" id="Snippet2"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/SoapHeaderBinding/Message/soapheaderbinding_use.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/SoapHeaderBinding/Message/soapheaderbinding_use.vb" id="Snippet2"::: - ]]> @@ -357,11 +342,6 @@ @@ -407,8 +387,6 @@ diff --git a/xml/System.Web.Services.Description/SoapOperationBinding.xml b/xml/System.Web.Services.Description/SoapOperationBinding.xml index a74d6898209..981d3317be8 100644 --- a/xml/System.Web.Services.Description/SoapOperationBinding.xml +++ b/xml/System.Web.Services.Description/SoapOperationBinding.xml @@ -44,14 +44,7 @@ This class specifies that the message transmission will use SOAP and provides details about how the SOAP message will be formatted. For more information about specifying protocols for XML Web services, see [XML Web Services Using ASP.NET](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ba0z6a33(v=vs.100)). For more information about Web Services Description Language (WSDL), see the [WSDL](https://www.w3.org/TR/wsdl/) specification. - - - -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/SoapOperationBinding/CPP/soapoperationbinding.cpp" id="Snippet2"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/SoapAddressBinding/Overview/soapoperationbinding.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/SoapAddressBinding/Overview/soapoperationbinding.vb" id="Snippet2"::: - + ]]> @@ -125,11 +118,6 @@ -## Examples - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/SoapBinding_SoapOperationBinding/CPP/soapprotocol.cpp" id="Snippet6"::: - :::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/SoapBinding/Style/soapprotocol.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/System.Web.Services.Description/SoapBinding/Style/soapprotocol.vb" id="Snippet6"::: - ]]> @@ -175,8 +163,6 @@ diff --git a/xml/System.Xml.Serialization/CodeGenerationOptions.xml b/xml/System.Xml.Serialization/CodeGenerationOptions.xml index 04b515e93a3..081b9181b03 100644 --- a/xml/System.Xml.Serialization/CodeGenerationOptions.xml +++ b/xml/System.Xml.Serialization/CodeGenerationOptions.xml @@ -69,13 +69,6 @@ The `GenerateOrder` member instructs the code generator to create the serializat ]]> - - object. - -:::code language="csharp" source="~/snippets/csharp/System.Web.Services.Description/ServiceDescriptionImporter/Overview/import.cs" id="Snippet4"::: - ]]> -