SoapBodyBinding.Use Property
Indicates whether the message parts are encoded using specified encoding rules, or define the concrete schema of the message.
[Visual Basic] Public Property Use As SoapBindingUse [C#] public SoapBindingUse Use {get; set;} [C++] public: __property SoapBindingUse get_Use(); public: __property void set_Use(SoapBindingUse); [JScript] public function get Use() : SoapBindingUse; public function set Use(SoapBindingUse);
Property Value
One of the SoapBindingUse values. The default is Default.
Remarks
The Namespace and Encoding properties depend on the value of this property. Their values should be set only if the value of this property is Encoded. Otherwise the XML Web service will produce unexpected behavior.
Example
[Visual Basic] ' 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) [C#] // 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); [C++] // 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);
[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button
in the upper-left corner of the page.
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
See Also
SoapBodyBinding Class | SoapBodyBinding Members | System.Web.Services.Description Namespace