Bad request trying to access SQL Server Using HTTP

Bad request trying to access SQL Server Using HTTP

Post by Bjarte Hetla » Sat, 26 May 2001 20:39:49



I am trying to access an SQL Server using HTTP, the way it is
described in SQL Server Books Online. I am running SQL Server Standard
Edition 8.00.194 on a Windows 2000 Server (Build 2195, SP1). I have
followed the example "Creating the nwind Virtual Directory", but when
I test the virtual directory, I only get a "HTTP 400 - Bad Request"
error message.

Both the SQL server and IIS runs fine.

What am I doing wrong? Any help appreciated.

Bjarte Hetland

 
 
 

Bad request trying to access SQL Server Using HTTP

Post by Roger Wolte » Sun, 27 May 2001 00:26:33


Bad request usually means invalid syntax in your URL.  What are you trying
to send as a URL?


Quote:> I am trying to access an SQL Server using HTTP, the way it is
> described in SQL Server Books Online. I am running SQL Server Standard
> Edition 8.00.194 on a Windows 2000 Server (Build 2195, SP1). I have
> followed the example "Creating the nwind Virtual Directory", but when
> I test the virtual directory, I only get a "HTTP 400 - Bad Request"
> error message.

> Both the SQL server and IIS runs fine.

> What am I doing wrong? Any help appreciated.

> Bjarte Hetland


 
 
 

Bad request trying to access SQL Server Using HTTP

Post by Bjarte Hetla » Sun, 27 May 2001 22:42:27


My URL is:

http://servername/nwind?sql=SELECT * FROM Employees FOR XML AUTO&root=root

just like it is explained in the BOL-example.

I also tried

http://servername/nwind?sql=SELECT+*+FROM+Employees+FOR+XML+AUTO&root...

Bjarte


> Bad request usually means invalid syntax in your URL.  What are you trying
> to send as a URL?



> > I am trying to access an SQL Server using HTTP, the way it is
> > described in SQL Server Books Online. I am running SQL Server Standard
> > Edition 8.00.194 on a Windows 2000 Server (Build 2195, SP1). I have
> > followed the example "Creating the nwind Virtual Directory", but when
> > I test the virtual directory, I only get a "HTTP 400 - Bad Request"
> > error message.

> > Both the SQL server and IIS runs fine.

> > What am I doing wrong? Any help appreciated.

> > Bjarte Hetland

 
 
 

Bad request trying to access SQL Server Using HTTP

Post by Toma » Tue, 29 May 2001 04:46:28


Did you try to register the site using the register tool. Are you using the
SQL 7.0 preview version or the SQl 2000 version
Tomas

> My URL is:

> http://servername/nwind?sql=SELECT * FROM Employees FOR XML AUTO&root=root

> just like it is explained in the BOL-example.

> I also tried

> http://servername/nwind?sql=SELECT+*+FROM+Employees+FOR+XML+AUTO&root...

> Bjarte




> > Bad request usually means invalid syntax in your URL.  What are you
trying
> > to send as a URL?



> > > I am trying to access an SQL Server using HTTP, the way it is
> > > described in SQL Server Books Online. I am running SQL Server Standard
> > > Edition 8.00.194 on a Windows 2000 Server (Build 2195, SP1). I have
> > > followed the example "Creating the nwind Virtual Directory", but when
> > > I test the virtual directory, I only get a "HTTP 400 - Bad Request"
> > > error message.

> > > Both the SQL server and IIS runs fine.

> > > What am I doing wrong? Any help appreciated.

> > > Bjarte Hetland

 
 
 

Bad request trying to access SQL Server Using HTTP

Post by Bjarte Hetla » Wed, 30 May 2001 16:01:07



> Did you try to register the site using the register tool.

If the question is: Did I use the "Configure SQL XML support in IIS"
tool? Then the answer is yes. Or is there some other tool I need to
use?

Quote:> Are you using the
> SQL 7.0 preview version or the SQl 2000 version

I am running SQL 2000 (version 8.00.194)

Bjarte

 
 
 

Bad request trying to access SQL Server Using HTTP

Post by Bryant Like » Thu, 31 May 2001 02:14:58



Quote:> I am trying to access an SQL Server using HTTP, the way it is
> described in SQL Server Books Online. I am running SQL Server Standard
> Edition 8.00.194 on a Windows 2000 Server (Build 2195, SP1). I have
> followed the example "Creating the nwind Virtual Directory", but when
> I test the virtual directory, I only get a "HTTP 400 - Bad Request"
> error message.

First I would try turning off friendly error messages in IE (under
tools/Internet Options/Advanced). This should give you a more defined reason
for the error. Also in the IIS settings did you check the Allow URL Queries
checkbox?

--
Bryant

 
 
 

Bad request trying to access SQL Server Using HTTP

Post by Bjarte Hetla » Thu, 31 May 2001 20:34:59


The problem was solved after turning off friendly error messages.

This is the message I got:

ERROR: 400.100 Bad Request
HResult: 0x80004005
Source: Microsoft SQL isapi extension
Description: Invalid connection settings: access denied

The error message seems to indicate I am trying to access the SQL
database with a user with no permissions. I have been using the
sysadm-account (sa) to avoid these kinds of conflicts. I thought sa
should have all rigths set?

Well, I changed security settings to "Use Windows Integrated
Authentication", which seemed to do the trick. (I was quite sure I
tried that some days ago, with no luck, but I have tried different
settings, so the problem might have been something else then)

Thanks a lot for the help.


> First I would try turning off friendly error messages in IE (under
> tools/Internet Options/Advanced). This should give you a more defined reason
> for the error. Also in the IIS settings did you check the Allow URL Queries
> checkbox?