Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > .NET Web Services
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
.NET Web Services Discussions about .NET XML Web Service technologies including ASMX files, WSDL and SOAP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Web Services section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 3rd, 2005, 12:23 PM
Registered User
Join Date: May 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Consuming web services in asp.net using http post

Hi, I am trying to do a HTTPS POST of an xml file to the server and get the response back, by using HttpWebRequest and HttpWebResponse. Whenever I run the progran, I get an internal server 500 error on the line:

Dim resp As HttpWebResponse = CType(req.GetResponse(), HttpWebResponse)

Here is the complete code:

            Dim doc As XmlDocument = New XmlDocument
            doc.Load("C:\Inetpub\wwwroot\testxml\XMLRequest.xm l")
            Dim req As HttpWebRequest = CType(WebRequest.Create("https://www.test.com/TESTXML/XML.asmx/TESTXML"), HttpWebRequest)
            req.ContentType = "text/xml"
            req.Accept = "text/xml"
            req.Method = "POST"
            Dim stm As Stream = req.GetRequestStream()

**** I am getting error on this line

            Dim resp As HttpWebResponse = CType(req.GetResponse(), HttpWebResponse)


            stm = resp.GetResponseStream()
            Dim r As StreamReader = New StreamReader(stm)
        Catch WebExcp As WebException
         End Try

I checked with the service provider, they have http get protocol commented in the machine.config file, only http post is uncommented. They say that they cannot uncomment http get protocol, is there a way to invoke the web service that has http get commented ?

Thanks in advance.
Reply With Quote
  #2 (permalink)  
Old May 4th, 2005, 02:03 AM
Friend of Wrox
Join Date: Jun 2004
Location: Chennai, Tamil Nadu, India.
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76

y are you using http post? cant you use SOAP??

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Asp.Net 2.0 Web Services shraddhabhatt ASP.NET 1.0 and 1.1 Basics 1 November 8th, 2007 05:41 AM
ASP.NET Web Services aliirfan84 General .NET 1 February 5th, 2007 03:31 PM
Help for Web Services in asp.net vivekshah ASP.NET 1.0 and 1.1 Professional 0 June 8th, 2006 08:20 AM
Call the Java Web Service using HTTP-POST/GET anand_indya J2EE 0 January 17th, 2005 08:23 AM
Simple HTTP POST .Net web service? DaveCollinsPenchant .NET Web Services 1 September 10th, 2004 04:46 PM

All times are GMT -4. The time now is 05:06 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.