Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > .NET Web Services
|
.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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 3rd, 2005, 12:23 PM
Registered User
 
Join Date: May 2005
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:

Try
            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()
            doc.Save(stm)
            stm.Close()

**** 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)
            Response.Write(r.ReadToEnd())
        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.
 
Old May 4th, 2005, 02:03 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

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

Regards
Ganesh





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





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