HttpMethodAttribute::ReturnFormatter Property
.NET Framework (current version)
Gets or sets a Type that deserializes the response from an XML Web service method.
Assembly: System.Web.Services (in System.Web.Services.dll)
If the XML Web service client is invoking an XML Web service method using HTTP-GET, ReturnFormatter must be UrlParameterWriter, whereas a client using HTTP-POST must set ReturnFormatter to HtmlFormParameterWriter.
The example is a proxy class generated by the Wsdl.exe utility for an XML Web service client using HTTP-GET, setting ReturnFormatter to the required value of UrlParameterWriter.
[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
Available since 1.1
Show: