Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Webservice POST to secure site

Thread Tools

Webservice POST to secure site

Posts: n/a
Hello All,
I am new to this group, so please forgive me if this
question has been addressed. I have written a function that posts data
to a secure website. It works fine when in a console application or a
form, but the same code fails when used as a web method in a
webservice. The error message says that the number of bytes exceeds
the number of bytes specified in the ContentLength of the httprequest
object. Can anyone help me?? The code is below....


public string Send_Req(string strRequest)


string result;

HttpWebRequest httpRequest =

httpRequest.Method = "POST";

httpRequest.ContentLength = strRequest.Length;

httpRequest.ContentType = "application/x-www-form-urlencoded";

X509Certificate myCert =
X509Certificate.CreateFromCertFile(@"C:\test.cer") ;


StreamWriter requestWriter = new



HttpWebResponse httpResponse =

StreamReader resultReader = new

result = resultReader.ReadToEnd();


return result;

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Secure your digital information assets with Secure Auditor. SecureWindows with Secure Auditor Cisco 0 04-14-2008 06:53 AM
Secure your digital information assets with Secure Auditor SecureWindows with Secure Auditor Cisco 0 04-14-2008 06:52 AM
This page contains both secure and non secure items. A.M ASP .Net 5 06-08-2004 05:43 PM
Post post post. Shel-hed Computer Support 2 11-08-2003 07:41 AM