我想從另一臺服務器上的頁面後面的代碼調用遠程webmethod(asmx)。 第二個要求是能夠將一個字符串和一個pdf文件傳遞給webmethod並在webmethod中使用它們。從c調用遠程webmethod#
我所擁有的就是Testing.asmx中的這個簡單webmethod。
[WebMethod]
public string TestPdf()
{
return "Hello World";
}
任何人都可以請讓我知道如何調用此的WebMethod(網址:http://mydomain.com/Testing.asmx/TestPdf)?
我想將一個pdf文件和一個字符串參數傳遞給webmethod並能夠在返回「hello world」之前檢索它。
看一看的[WebClient類(http://msdn.microsoft.com/en-us/library/system.net.webclient(V = vs.110)的.aspx)。 –
請參閱http://johnwsaunders3.wordpress.com/2009/05/17/how-to-consume-a-web-service/ –