HttpMethodAttribute::ParameterFormatter Property

 

Gets or sets a Type that serializes parameters sent from an XML Web service client to the XML Web service method.

Namespace:   System.Web.Services.Protocols
Assembly:  System.Web.Services (in System.Web.Services.dll)

public:
property Type^ ParameterFormatter {
	Type^ get();
	void set(Type^ value);
}

Property Value

Type: System::Type^

A Type that serializes parameters sent from an XML Web service client to an XML Web service method. There is no default.

If the XML Web service client is invoking an XML Web service method using HTTP-GET or HTTP-POST, ParameterFormatter must be XMLReturnReader.

The example is a proxy class generated by the Wsdl.exe utility for an XML Web service client using HTTP-GET, setting ParameterFormatter to the required value of XMLReturnReader.

[System::Xml::Serialization::XmlRootAttribute(Namespace="http://tempuri.org/",IsNullable=true)]
public ref class UserName
{
public:
   String^ Name;
   String^ Domain;
};

public ref class MyUser: public System::Web::Services::Protocols::HttpGetClientProtocol
{
public:
   MyUser()
   {
      this->Url = "http://www.contoso.com/username.asmx";
   }

   [System::Web::Services::Protocols::HttpMethodAttribute(System::Web::Services::Protocols::XmlReturnReader::typeid,System::Web::Services::Protocols::UrlParameterWriter::typeid)]
   UserName^ GetUserName()
   {
      return (dynamic_cast<UserName^>(this->Invoke( "GetUserName", (String::Concat( this->Url, "/GetUserName" )), gcnew array<Object^>(0) )));
   }

   System::IAsyncResult^ BeginGetUserName( System::AsyncCallback^ callback, Object^ asyncState )
   {
      return this->BeginInvoke( "GetUserName", (String::Concat( this->Url, "/GetUserName" )), gcnew array<Object^>(0), callback, asyncState );
   }

   UserName^ EndGetUserName( System::IAsyncResult^ asyncResult )
   {
      return (dynamic_cast<UserName^>(this->EndInvoke( asyncResult )));
   }
};

.NET Framework
Available since 1.1
Return to top
Show: