J
Jay
am trying to call a webservice from C# client.
I am having trouble sending a POST via webrequest.
This is the URL: http://T9946ISP0001:8080/PrintMgr/ProcessRequest.jsp
Here is the method : createSession
The params are aram1=1024
Following is the code snippet - I am not sure how I specify the URL , the
method name and its params..
----------------------------------------------------------------------------
------------------
req.ContentLength = postData.Length;
HttpWebRequest req = (HttpWebRequest)
WebRequest.Create("http://T9946ISP0001:8080/PrintMgr/ProcessRequest.jsp");
req.Method = "POST";
ASCIIEncoding enc = new ASCIIEncoding();
byte[] postData = enc.GetBytes("methodAlias=createSession¶m1=1024");
req.ContentLength = postData.Length;
Stream reqStream = req.GetRequestStream();
reqStream.Write(postData, 0, postData.Length);
reqStream.Close();
WebResponse resp = req.GetResponse();
I am having trouble sending a POST via webrequest.
This is the URL: http://T9946ISP0001:8080/PrintMgr/ProcessRequest.jsp
Here is the method : createSession
The params are aram1=1024
Following is the code snippet - I am not sure how I specify the URL , the
method name and its params..
----------------------------------------------------------------------------
------------------
req.ContentLength = postData.Length;
HttpWebRequest req = (HttpWebRequest)
WebRequest.Create("http://T9946ISP0001:8080/PrintMgr/ProcessRequest.jsp");
req.Method = "POST";
ASCIIEncoding enc = new ASCIIEncoding();
byte[] postData = enc.GetBytes("methodAlias=createSession¶m1=1024");
req.ContentLength = postData.Length;
Stream reqStream = req.GetRequestStream();
reqStream.Write(postData, 0, postData.Length);
reqStream.Close();
WebResponse resp = req.GetResponse();