IIS was installed before VS .Net. I ran the aspnet_regiis utility just to make sure but I am still getting the same error.
Main Topics
Browse All TopicsI created a simple ATL Web Service that accepts a string and returns the string reversed.
The code is a shown below:
--------------------------
// ReverseString.h : Defines the ATL Server request handler class
//
#pragma once
namespace ReverseStringService
{
// all struct, enum, and typedefs for your webservice should go inside the namespace
// IReverseStringService - web service interface declaration
//
[
uuid("8B57749E-80D9-4A18-9
object
]
__interface IReverseStringService
{
[id(1)] HRESULT ReverseString([in] BSTR bstrInput, [out, retval] BSTR *bstrOutput);
};
// ReverseStringService - web service implementation
//
[
request_handler(name="Defa
soap_handler(
name="ReverseStringService
namespace="urn:ReverseStri
protocol="soap"
)
]
class CReverseStringService :
public IReverseStringService
{
public:
// This is a sample web service method that shows how to use the
// soap_method attribute to expose a method as a web method
[ soap_method ]
HRESULT ReverseString(/*[in]*/ BSTR bstrInput, /*[out, retval]*/ BSTR *bstrOutput)
{
// Check the outgoing pointer...
if ( bstrOutput == NULL ) return E_POINTER;
// Reverse the characters
*bstrOutput = SysAllocString(_wcsrev(bst
return S_OK;
}
// TODO: Add additional web service methods here
}; // class CReverseStringService
} // namespace ReverseStringService
--------------------------
The code that consumes the Web services is in C# is as follows:
--------------------------
using System;
using ReverseStringClient.localh
namespace ReverseStringClient
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
static void Main(string[] args)
{
// Create an instance of the ATL Server's
// Web Service proxy
ReverseStringService ws = new ReverseStringService();
string strResult = ws.ReverseString("This is a test!");
Console.WriteLine("The resulting string was '{0}'",strResult);
}
}
--------------------------
The Web Reference is set to http://localhost/ReverseSt
I am running the Web Service in IIS 5.0 on Win2k Advanced Server.
--------------------------
When I try and consume the web service I am getting the error below:
--------------------------
"An unhandled exception of type 'System.Net.WebException' occurred in system.web.services.dll "Additional information: The request failed with HTTP status 405: Method not allowed."
--------------------------
I know that HTTP status 405: Method Not Allowed error is raised when the method specified in the Request-Line is not allowed for the resource identified by the Request-URI. I have checked all my settings on IIS they seem to be correct. I don't how to progress further.Could anyone please help
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: nonubikPosted on 2005-01-15 at 04:16:30ID: 13052564
Maybe the IIS service was installed after the installation of VS.NET on your machine. If so, ASP.NET might not have been registered. To solve this problem, you can run "aspnet_regiis.exe -i". You should be able to find aspnet_regiis.exe under \WINDOWS\Microsoft.NET\Fra mework\v1. 0.3705. or v1.1.4322 (depending on your framework version).