Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

The request failed with HTTP status 405: Method Not Allowed

1,112 views
Skip to first unread message

lucky

unread,
Aug 22, 2007, 2:43:00 PM8/22/07
to
Hi all,
I'm newbie with Exchange Server 2007 Web Service.
Problem :

I've added a Web Reference of the Exchange Server which is like this
"https://<Server Name>/EWS/Services.wsdl".
and i tried to use method "FindFolder()" while i tried to get response
from the server, i got an error
"The request failed with HTTP status 405: Method Not Allowed".

I've no idea what is wrong where. I googled the exception and i found
that some ppl had same problem when they referred web reference that
ends with "WSDL". but didnt find any usefull solution to get rid of
the problem.

I'm using,
Development Tools:
c#.net 2005
Exchange Server Web Service.

Please let me know if someone has any solution, i would really
appreciate any help.

Thanks

Glen Scales [MVP]

unread,
Aug 22, 2007, 8:49:11 PM8/22/07
to
You might want to try posting some of the code your trying to use. I would
also recommend having a read of
http://msdn2.microsoft.com/en-us/library/bb508825.aspx this describes about
the proxy objects and has some links to detailed instructions on who to
create a proper visual studio project.

Cheers
Glen

"lucky" <tushar....@gmail.com> wrote in message
news:1187808180....@e9g2000prf.googlegroups.com...

lucky

unread,
Aug 23, 2007, 3:34:08 AM8/23/07
to
Hi Glen,
Thanks for the URL, it was very informative.

here is the code that i'm using.

Web Reference:
"https://<server name>/EWS/Services.wsdl"

Method:

public static void GetFolder()
{
ExchangeServiceBinding esb = new ExchangeServiceBinding();
esb.Credentials = new NetworkCredential("username",
"password", "domain");
esb.Url = @"https://<server name>/EWS/Services.wsdl";

// Identify the folders to get.
FolderIdType folder1 = new FolderIdType();
DistinguishedFolderIdType sentitems = new
DistinguishedFolderIdType();
folder1.Id = "Processed";
sentitems.Id = DistinguishedFolderIdNameType.sentitems;

// Identify the folder properties to return.
FolderResponseShapeType properties = new
FolderResponseShapeType();
PathToUnindexedFieldType ptuft = new
PathToUnindexedFieldType();
ptuft.FieldURI =
UnindexedFieldURIType.folderManagedFolderInformation;
PathToUnindexedFieldType[] ptufts = new
PathToUnindexedFieldType[1] { ptuft };
properties.AdditionalProperties = ptufts;
properties.BaseShape =
DefaultShapeNamesType.AllProperties;

// Form the get folder request.
GetFolderType request = new GetFolderType();
request.FolderIds = new BaseFolderIdType[] { folder1};
request.FolderShape = properties;

try
{
// Send the request and get the response.
GetFolderResponseType response =
esb.GetFolder(request);
ArrayOfResponseMessagesType aormt =
response.ResponseMessages;
ResponseMessageType[] rmta = aormt.Items;

foreach (ResponseMessageType rmt in rmta)
{
if (rmt.ResponseClass ==
ResponseClassType.Success)
{
FolderInfoResponseMessageType firmt;
firmt = (rmt as
FolderInfoResponseMessageType);
BaseFolderType[] folders = firmt.Folders;

foreach (BaseFolderType folder in folders)
{
if (folder is CalendarFolderType)
{
CalendarFolderType calendar;
calendar = (folder as
CalendarFolderType);
}
else if (folder is ContactsFolderType)
{
// Handle the contacts folder.
}
else
{
// Handle SearchFolderType,
TasksFolderType,
// and FolderType.
}
}
}
}
}
catch (WebException ex)
{
throw ex;
}
}


Exception:


The request failed with HTTP status 405: Method Not Allowed

I'm not able to resolve this problem. Please let me know if it make
any sense to you.
I would welcom any other way as well.

thanks
Lucky

lucky

unread,
Aug 23, 2007, 6:48:43 AM8/23/07
to
PROBLEM RESOLVED!!!

Web Reference:
"https://<server name>/EWS/Services.wsdl"

Method:

public static void GetFolder()
{
ExchangeServiceBinding esb = new ExchangeServiceBinding();
esb.Credentials = new NetworkCredential("username",
"password", "domain");

esb.Url = @"https://<server name>/EWS/Exchange.asmx";


Solution :

Adding reference is correct. but when u assign Url to
ExchangeServiceBinding, use "Exchange.asmx" instead of
"Services.wsdl".

and u will be able to you all methods.

Cheers,
Lucky

zhao jingjing

unread,
Nov 5, 2010, 1:57:37 PM11/5/10
to
thanks!!!

> On Wednesday, August 22, 2007 2:43 PM lucky wrote:

> Hi all,
> I'm newbie with Exchange Server 2007 Web Service.
> Problem :
>
> I've added a Web Reference of the Exchange Server which is like this
> "https://<Server Name>/EWS/Services.wsdl".
> and i tried to use method "FindFolder()" while i tried to get response
> from the server, i got an error
> "The request failed with HTTP status 405: Method Not Allowed".
>
> I've no idea what is wrong where. I googled the exception and i found
> that some ppl had same problem when they referred web reference that
> ends with "WSDL". but didnt find any usefull solution to get rid of
> the problem.
>
> I'm using,
> Development Tools:
> c#.net 2005
> Exchange Server Web Service.
>
> Please let me know if someone has any solution, i would really
> appreciate any help.
>
> Thanks


>> On Wednesday, August 22, 2007 8:49 PM Glen Scales [MVP] wrote:

>> You might want to try posting some of the code your trying to use. I would
>> also recommend having a read of
>> http://msdn2.microsoft.com/en-us/library/bb508825.aspx this describes about
>> the proxy objects and has some links to detailed instructions on who to
>> create a proper visual studio project.
>>
>> Cheers
>> Glen
>>
>> "lucky" <tushar....@gmail.com> wrote in message
>> news:1187808180....@e9g2000prf.googlegroups.com...


>>> On Thursday, August 23, 2007 3:34 AM lucky wrote:

>>> Hi Glen,
>>> Thanks for the URL, it was very informative.
>>>
>>> here is the code that i'm using.
>>>

>>> Web Reference:
>>> "https://<server name>/EWS/Services.wsdl"
>>>
>>> Method:
>>>
>>> public static void GetFolder()
>>> {
>>> ExchangeServiceBinding esb = new ExchangeServiceBinding();
>>> esb.Credentials = new NetworkCredential("username",
>>> "password", "domain");


>>>> Submitted via EggHeadCafe - Software Developer Portal of Choice
>>>> ASP.NET MaskedTextBox Custom Control
>>>> http://www.eggheadcafe.com/tutorials/aspnet/39a071cd-9f96-4e81-9346-4e445181d645/aspnet-maskedtextbox-custom-control.aspx

jna...@gmail.com

unread,
Jul 5, 2016, 4:34:23 AM7/5/16
to
Thank you!

Using Exchange.asmx instead of Services.wsdl in the ExchangeServiceBinding.URL did the trick for me.
0 new messages