XML Web Services Step by Step tutorial HTTP Client

G

Guest

Did anyone even get to study the MS Press book "XML Web
Services Step by Step" by Adam Freeman and Allen Jones
The book is very good to learn how to program XML Web
Service but I got into a snag for getting the sample in
Chapter 05 to work. The SOAP WebFormsClient in Chapter 4
works but the HTTP simple sample in Chapter 5 failed to
get the creditcard validation to work. The only
difference is that I am using .NET 1.1 with ASP.NET 1.1
and I am wondering if there is some compatibility issue
with using the ASP.NET 1.1 since the original
creditCardValidator.dll was supplied for 1.0. The error
was saying that the WebClient.DownloadData with
WebException: The remote server returns an 500 Internal
Server Error when executing
HttpWebRequest.CheckFinalStatus. If this is not the
right forum, please let me know which newsgroups I should
post use to post this question

The detail errror report is provided here
The remote server returned an error: (500) Internal Server Error.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.WebException: The remote server returned an error: (500) Internal Server Error

Source Error:

Line 74: // as a byte arra
Line 75: WebClient x_web_client = new WebClient()
Line 76: byte[] x_response = x_web_client.DownloadData(x_builder.ToString())
Line 77: // process the string result to obtain a validation resul
Line 78: bool x_valid


Source File: c:\inetpub\wwwroot\xmlwebservices\chapter05\webformsclient\webform1.aspx.cs Line: 76

Stack Trace:

[WebException: The remote server returned an error: (500) Internal Server Error.
System.Net.HttpWebRequest.CheckFinalStatus(
System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult
System.Net.HttpWebRequest.GetResponse(
System.Net.WebClient.DownloadData(String address
WebFormsClient.WebForm1.ValidateButton_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\xmlwebservices\chapter05\webformsclient\webform1.aspx.cs:7
System.Web.UI.WebControls.Button.OnClick(EventArgs e
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData
System.Web.UI.Page.ProcessRequestMain(
 
M

Mark Nicholson

The problem is that in .NET 1.1 the machine.config file has the line
commented out that gets you HttpGet access to web services. Here's
what the relevant section looks like in 1.1:

<webServices>
<protocols>
<add name="HttpSoap1.2"/>
<add name="HttpSoap"/>
<!-- <add name="HttpPost"/> -->
<!-- <add name="HttpGet"/> -->
<add name="HttpPostLocalhost"/>
<add name="Documentation"/>
</protocols>

If you uncomment the line for HttpGet it will work correctly. Do this
on the machine where your web service is hosted.

This bit me too!

Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top