Invokes an XML Web service method using HTTP.
Assembly: System.Web.Services (in System.Web.Services.dll)
member Invoke : methodName:string * requestUrl:string * parameters:Object -> Object
- Type: System.String
The name of the XML Web service method in the derived class that is invoking the method.
- Type: System.String
The URL of the XML Web service method that the client is requesting.
- Type: System.Object
An array of objects containing the parameters to pass to the remote XML Web service. The order of the values in the array corresponds to the order of the parameters in the calling method of the derived class.
Return ValueType: System.Object
An array of objects containing the return value and any by-reference or out parameters of the derived class method.
The request reached the server computer, but was not processed successfully.
The methodName parameter is used to find the types of the parameters and return values of the method that is invoking the method. It is also used to find custom attributes which may have been added to the method. HttpMethodAttribute and XmlElementAttribute provide additional information on the derived method that is required for the SOAP protocol.
The following code example is an ASP.NET Web Form, which calls an XML Web service named Math. Within the EnterBtn_Click function, the Web Form synchronously invokes the Add XML Web service method.
The following code example is a proxy class generated by the Web Services Description Language tool (Wsdl.exe) for the Math XML Web service below. Within the Add method of the proxy class, the method synchronously invokes the Add Web Service method.
The following code example is the Math XML Web service, from which the above proxy class was created.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.