I'm also having trouble using a webservice from a windows service and receiving 400 bad request errors. The code for this hasn't changed but this all started in late August and I still haven't found out why. At first I thought it was because the pages were
using http://tempuri.org so changed those to
http://microsoft.com/webservices but that had no effect.
Is there a way to debug this? It's on a live server and I'm having to manually invoke the web methods which work fine this way yet not when called from the windows service. I've checked for firewall issues, permissions and other things that could be blocking
and haven't found anything.
More info, this is the error reported to the event log from the windows service, these methods work when invoked on the local machine, the timer goes off and invokes the methods, all this was working properly until a couple of weeks ago, nothing in code
or settings alters the outcome, I'm suspecting a security update:
The request failed with HTTP status 400: Bad Request.
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at CocamarCentralService.wsB2BProcessor.B2BProcessor.GetJobListByCurrentStatus(AutomationMessageTypes status, Int32 lastMessageDuration)
at CocamarCentralService.Service1.mB2bTimer_Elapsed(Object sender, ElapsedEventArgs e)
The windows service may not have the permissions it needs to call a webmethod on the live server. Installer was used to install it and it's running properly but from the event log it's obvious that it isn't able to call a webmethod so now I'm wondering if
I need to use the utility to register/install a windows service again, or, if I need to build it with full trust instead of limited trust?
I can't see anything else that would affect things ...
Since we weren't able to resolve this, code worked locally and it looked like the DNS server was the culprit we ordered a new server, set things up and it works fine.
The problem then was from the name resolution for the existing server such that when the windows service tried to call the webservice the pointer it was using for IP address or URL was invalid. So Chris, you might want to check into the DNS setup on your
machines to see if this has some relevence to your problem if it's still a problem.
I have the same problem. I have a website calling a function of a webservice1 which calls a function of a webservice2.
We have a testing website and a production website. webservices are the same on the 2 websites in IIS.
I'm sure that will work on the live but want to test on the test website before but I receive this error:
Error: System.Net.WebException: The request failed with HTTP status 400: Bad Request.
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters
AusClans
Member
52 Points
30 Posts
Webservice giving HTTP status 400: Bad Request error
Sep 08, 2007 10:52 PM|LINK
Hi everyone,
over the last few days i've tried everything to solve this issue i'm having with my webservice. :( so i've turn to you guys to help.
my webservice works fine when calling it directly from the code behind in a website.
but when i call the webservice in another function i'm getting this error
The request failed with HTTP status 400: Bad Request.the Namespace is set correctly.. so i'm really not sure what's going on.
and help would be appricated
Chris
InterfaceMir...
Member
147 Points
48 Posts
Re: Webservice giving HTTP status 400: Bad Request error
Sep 11, 2007 09:40 AM|LINK
hello
try following, maybe they work for you.
- is your site using a specific IP address?
change it to All Unassigned.
- or check any firewall or anti virus blocking your traffic.
- or more details on
http://sqlxml.org/faqs.aspx?faq=8
I hope it can help you. Please let me know if still have problem.Kindest Regards,
timallard
Member
636 Points
160 Posts
Re: Webservice giving HTTP status 400: Bad Request error
Sep 11, 2007 06:46 PM|LINK
I'm also having trouble using a webservice from a windows service and receiving 400 bad request errors. The code for this hasn't changed but this all started in late August and I still haven't found out why. At first I thought it was because the pages were using http://tempuri.org so changed those to http://microsoft.com/webservices but that had no effect.
Is there a way to debug this? It's on a live server and I'm having to manually invoke the web methods which work fine this way yet not when called from the windows service. I've checked for firewall issues, permissions and other things that could be blocking and haven't found anything.
All clues appreciated ...
analyst/architect, SDE
timallard
Member
636 Points
160 Posts
Re: Webservice giving HTTP status 400: Bad Request error
Sep 11, 2007 09:57 PM|LINK
More info, this is the error reported to the event log from the windows service, these methods work when invoked on the local machine, the timer goes off and invokes the methods, all this was working properly until a couple of weeks ago, nothing in code or settings alters the outcome, I'm suspecting a security update:
The request failed with HTTP status 400: Bad Request.
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at CocamarCentralService.wsB2BProcessor.B2BProcessor.GetJobListByCurrentStatus(AutomationMessageTypes status, Int32 lastMessageDuration)
at CocamarCentralService.Service1.mB2bTimer_Elapsed(Object sender, ElapsedEventArgs e)
analyst/architect, SDE
timallard
Member
636 Points
160 Posts
Re: Webservice giving HTTP status 400: Bad Request error
Sep 13, 2007 03:36 PM|LINK
Still not resolved so more info:
The windows service may not have the permissions it needs to call a webmethod on the live server. Installer was used to install it and it's running properly but from the event log it's obvious that it isn't able to call a webmethod so now I'm wondering if I need to use the utility to register/install a windows service again, or, if I need to build it with full trust instead of limited trust?
I can't see anything else that would affect things ...
analyst/architect, SDE
timallard
Member
636 Points
160 Posts
Re: Webservice giving HTTP status 400: Bad Request error
Sep 13, 2007 06:42 PM|LINK
More info:
The webmethods work without a problem when invoked by webpages, but not the service.
analyst/architect, SDE
timallard
Member
636 Points
160 Posts
Re: Webservice giving HTTP status 400: Bad Request error
Sep 21, 2007 08:36 PM|LINK
Since we weren't able to resolve this, code worked locally and it looked like the DNS server was the culprit we ordered a new server, set things up and it works fine.
The problem then was from the name resolution for the existing server such that when the windows service tried to call the webservice the pointer it was using for IP address or URL was invalid. So Chris, you might want to check into the DNS setup on your machines to see if this has some relevence to your problem if it's still a problem.
analyst/architect, SDE
goudax
Member
2 Points
12 Posts
Re: Webservice giving HTTP status 400: Bad Request error
Nov 09, 2007 12:19 PM|LINK
Hello,
I have the same problem. I have a website calling a function of a webservice1 which calls a function of a webservice2.
We have a testing website and a production website. webservices are the same on the 2 websites in IIS.
I'm sure that will work on the live but want to test on the test website before but I receive this error:
Error: System.Net.WebException: The request failed with HTTP status 400: Bad Request.
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters
Can anyone help me ?
ZychoFlow
Member
26 Points
26 Posts
Re: Webservice giving HTTP status 400: Bad Request error
Jul 31, 2008 09:09 PM|LINK
I was getting the same problem.
I tried just about everything, and my problem was that I had a proxy configured in the internet options in my machine (the client).
The funny thing is that I had the "Bypass for proxy server for local addresses"
checked and the soap traffic was still trying to go through the proxy server.
Hope this helps.
yliu54
Member
2 Points
7 Posts
Re: Webservice giving HTTP status 400: Bad Request error
Mar 19, 2009 09:15 PM|LINK
We have similar problem.
We got this error when use WSE 2.0 DIME to send document which is a liitle bit larger such as 6MB. However it works fine with small files.
Even with setting in the Web.config to enlarge the size, the problem persists.
Anyone knows that DIME has such a small limit of the document size? Or this is related to something else?