error deploying web service

M

Mark Finkel

I have developed a web service on my own PC which works properly. Deploying
it to the production web farm I copy all .aspx files and \bin for both the
service and the app that calls it. When I try to invoke the service in
production I get the error below.

Thanks in advance,
Mark Finkel

The request failed with HTTP status 400: Bad Request.
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 request failed with HTTP
status 400: Bad Request.

Source Error:

An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.
 
D

Dan Rogers

Hi,

Try deploying using the menu item on the file menu for publishing your
service to a remote server.

Hope this helps

Dan Rogers
Microsoft Corporation
--------------------
 
M

Mark Finkel

Dan,

Thanks for the suggestion but that is impossible given how the hosting
service operates. I must manually copy files. Is there anything else I must
copy for a web service besides the .aspx files and \bin?

Regards,
Mark
 
D

Dan Rogers

Hi Mark,

Unfortunately, yes. There is a lot more to a web service setup than just
the files you see under an IIS vroot. First, the .NET runtime has to be
installed on the machine you are hosting your service on. The next thing
is that the web site or vroot itself has to be configured as an ASP.Net
application and not just a IIS web site. This takes some administrative
cooperation.

Can you confirm that the runtime is already installed, properly configured,
and that the vroot you are copying to is properly set up? One way to test
this is to try and access the web.config file from a browser. If you can
download that file, it's almost certain that ASP.Net is not properly
installed.

From there, you can most readily get all of the files by xcopy - all of the
files from your dev machine to the production machine. If you want an
optimized copy that only includes runtime files, set up a separate vroot on
your development machine, and publish from your development site to this
new preproduction vroot. If your publish settings are configured to only
copy the files needed at runtime, then these will be what appear in the new
location on your own machines.

Another area where a hosted environment can trip you up is if your
application requires any specific assemblies to be present in the global
assembly cache (GAC). Only an administrator can add assemblies to the GAC,
so again, if you need these, then a simple copy will not do the trick.

I hope this helps

Dan Rogers
Microsoft Corporation
--------------------
 
M

Mark Finkel

Dan,

Thank you very much for all of the information, but I still need to know
exactly which files must be copied besides the .aspx files and /bin.

The way the hosting service is set-up I cannot use the "copy application"
from the Visual Studio menu. My only way to move the files is via FTP.

I did confirm that I am unable to download web.config.

Can you *please* tell me exactly which files must be copied?

Regards,
Mark
 
D

Dan Rogers

Hi John,

In my last post I suggested an effective way to discover the exact files
you need. Since there can be any number of files in any given
applications, I don't think I can effectively guess at all of the file
names. The easiest way is to publish your project to a server that you can
publish to - even if it is just another vroot on your development box. If
you start out with an empty vroot, and then publish to it, any files that
then appear under that directory are the ones you need to copy.

This will cover the isolated files. But it won't cover any machine
specific files.

Have you tried copying a minimal hello world web service to your hosting
company? If you just create a new web service project, accept all of the
defaults, and uncomment out the hello world, you only need to copy the
web.config, the service1.aspx, and all of the files in the debug/bin
directory (oh... forgot to ask if you are deploying the debug build or the
optimized build - this makes a difference).

If after doing that minimum project you can call the hello world service
from the host from a client that can call it from your dev machine (but you
just change the URL programatically) then you know the hoster is able to
serve up web services. If this fails, then you have discovered that the
hoster doesn't support web services.

Please try these steps, as I suspect this is a deeper issue than knowing
which files are involved.

I hope this helps

Dan Rogers
Microsoft Corporation
--------------------
Thread-Topic: error deploying web service
thread-index: AcTYylxqUKjI0H+tTOmJg2G1QfeUIg==
X-WBNR-Posting-Host: 68.46.68.180
From: "=?Utf-8?B?TWFyayBGaW5rZWw=?=" <[email protected]>
References: <[email protected]>
<[email protected]>
 
M

Mark Finkel

Dan,

Thanks for your continued assistance.

Which files to copy is no longer an issue. I managed to copy the application
from Visual Studio using Project...Copy Project. Sadly, it made no difference.

I also passed on your previous suggestions to the NT admins in the hosting
company. I will keep you posted as to their reply. It looks like I may be
playing middleman for a bit, a role I am happy to fill if it leads to a
resolution.

Thanks again,
Mark
 
D

Dan Rogers

Hi Mark,

Glad to help. I do expect you have run into a not-uncommon phenomena -
ISP's that will host an ASP based application but who just aren't prepared
to host ASP.NET applications.

Good luck

Dan

--------------------
Thread-Topic: error deploying web service
thread-index: AcTY8pIogm9AoiX4TDK8SzQrwuVUzQ==
X-WBNR-Posting-Host: 68.46.68.180
From: "=?Utf-8?B?TWFyayBGaW5rZWw=?=" <[email protected]>
References: <[email protected]>
<[email protected]>
<[email protected]>
<#[email protected]>
 
M

Mark Finkel

Dan,

I am afraid there has been a misunderstanding. The ISP *definitely* supports
ASP.NET. I have 2 .NET applications running there just fine. The only problem
is with the invocation of the web service.

I have not yet heard from them since I passed on your comments.

But to summarize: normal ASP.NET applications run fine. A web service which
runs fine on my development PC is copied via Visual Studio - Project...Copy
Project. On the ISP site the statement which invokes the web service fails
with staus 400, bad request.

Regards,
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

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top