Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Config Issue?

Status
Not open for further replies.

bardley

Programmer
May 8, 2001
121
US
I am trying to create a web service using Visual Studio .NET. So I create the default web service project, uncomment the "hello world" example, and compile. Then I go to in a browser. I get the cute little page that lists all the web methods exposed by that service. In this case, the only one showing is HelloWorld. So I click on HelloWorld, and it takes me to the page with the example SOAP requests, etc. and the "INVOKE" button to test the method.

Great so far. But when I press the button, it opens a new window with the url and I get a 404.

Is there something wrong with my ASP? Any ideas what could be causing this???

Thanks anyone/everyone!!!

Brad Gunsalus
bardley90@hotmail.com
 
That's the normal behavior...but what code are you using specifically in your WebMethod? This probably has something to do with the return value the WebMethod is expecting.

Also, it could be the format of the data returned as XML. If it's inherently SOAP, it might not be visible in the test page.
 
the entire class is:
Code:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;

namespace WebService3
{
	/// <summary>
	/// Summary description for Service1.
	/// </summary>
	public class Service1 : System.Web.Services.WebService
	{
		public Service1()
		{
			//CODEGEN: This call is required by the ASP.NET Web Services Designer
			InitializeComponent();
		}

		#region Component Designer generated code
		
		//Required by the Web Services Designer 
		private IContainer components = null;
				
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if(disposing && components != null)
			{
				components.Dispose();
			}
			base.Dispose(disposing);		
		}
		
		#endregion

		// WEB SERVICE EXAMPLE
		// The HelloWorld() example service returns the string Hello World
		// To build, uncomment the following lines then save and build the project
		// To test this web service, press F5

		[WebMethod]
		public string HelloWorld()
		{
			return &quot;Hello World&quot;;
		}
	}
}

This is the example given in Visual Studio .NET 2003. It compiles fine, but I must assume that when you go to that page to test it (using the INVOKE button) it's supposed to give you something other than a 404 Error (page cannot be found). I'm wondering if something is off with my ASP.NET configuration or something.

I have very little experience with web services. I seem to get the concept, but I've learned the hard way that &quot;getting the concept&quot; and &quot;making it work&quot; are sometimes very far apart, especially when dealing with MS.

:)

Any ideas?

Brad Gunsalus
bardley90@hotmail.com
 
Brad,

Are other pages able to be served fune off of the server you're working on?
 
Well, I guess it's not a big deal. I went ahead and built a client to consume the web service, and that works ok. The web service works fine. It just puzzles me that I can't see the response when I go to test it. No biggie. I'm not going to worry about it. Thanks Jason.

Brad Gunsalus
bardley90@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top