Home » .Net Framework

WCF webservice: HTTP/1.1 400 Bad Request while sending large input

I am connecting to a WCF based webservice. For certain methods, the input contains a list of objects/structures. When the number of items in this list increases beyond a certain number, the service fails with HTTP/1.1 400 Bad Request when I try to test the same using SOAPUI. I tried changing the web.config file with the following changes:

<httpRuntime maxRequestLength="2097151" />

  <binding name="basicHTTP" closeTimeout="00:01:00"
    openTimeout="00:01:00" receiveTimeout="00:01:00" sendTimeout="00:01:00" maxReceivedMessageSize="4194304" maxBufferSize="98547" maxBufferPoolSize="258547">
   <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />



2 Answers Found


Answer 1

set up WCF trace on the server and see the exact error:



Answer 2

The issue was solved by the maxReceivedMessageSize setting. Initially in my binding, I did not set the bindingConfiguration explicitly, though the basicHttpBinding was declared and set. As such changes in maxReceivedMessageSize in the binding was not getting applied and the default setting of 64kb was active. I have set the bindings like:

<endpoint address="" binding="basicHttpBinding" bindingConfiguration="basicHttpBinding"
 name="AMS" bindingName="basicHttpBinding" contract="Entity.AccuchekMobility.Service.IAccuchekMobilityService" />

  <binding name="basicHttpBinding" closeTimeout="00:01:00"
    openTimeout="00:01:00" receiveTimeout="00:02:00" sendTimeout="00:01:00" maxReceivedMessageSize="4194304" maxBufferPoolSize="524288" maxBufferSize="4194304">





I'm trying to write a simple feed syndication wcf service.


Here is my interface:

  publicinterface ILayers
    [WebGet(UriTemplate = "GetLayers?format={format}", BodyStyle = WebMessageBodyStyle.Bare)]
    SyndicationFeedFormatter GetLayers(string format);

And my config looks like:


<system.serviceModel><behaviors><serviceBehaviors><behaviorname="LayerSvc.LayersBehavior"><serviceMetadatahttpGetEnabled="true"/><serviceDebugincludeExceptionDetailInFaults="true"/></behavior></serviceBehaviors></behaviors><services><servicebehaviorConfiguration="LayerSvc.LayersBehavior"name="LayerSvc.Layers"><endpointaddress="" binding="wsHttpBinding"contract="LayerSvc.ILayers"></endpoint><endpointaddress="mex"binding="mexHttpBinding"contract="IMetadataExchange"/></service></services></system.serviceModel>


The service works fine when I using the wcftestclient, but not when I try to call it using the url template. 

In the browser I call it using: http://localhost:13970/Layers.svc/GetLayers?format=rss, for example

I have read other blogs and threads about  this error, and have checked that the server has HTTP Activation enabled.

I also have the wcf logging and tracing enabled, but nothing useful there - just:

<InnerException><ExceptionType>System.Xml.XmlException, System.Xml, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>The body of the message cannot be read because it is empty.</Message><StackTrace>
at System.ServiceModel.Channels.HttpRequestContext.CreateMessage()
at System.ServiceModel.Channels.HttpChannelListener.HttpContextReceived(HttpRequestContext context, ItemDequeuedCallback callback)
at System.ServiceModel.Activation.HostedHttpTransportManager.HttpContextReceived(HostedHttpRequestAsyncResult result)
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest()
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest()
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequest(Object state)
at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.WorkItem.Invoke2()
at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.WorkItem.Invoke()
at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.ProcessCallbacks()
at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.CompletionCallback(Object state)
at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.ServiceModel.Diagnostics.Utility.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
</StackTrace><ExceptionString>System.Xml.XmlException: The body of the message cannot be read because it is empty.</ExceptionString></InnerException>

Anyone have any ideas?

hi all

recently i configured report server, but when i hot URL i am getting message as
The request failed with HTTP status 400: Bad Request
when i look in event logs i found as :Report Server (MSSQLSERVER) cannot connect to the report server database.:

Windows service accoutn (Sql reporting services) running on a Domain account,
webservice account is running on NT authority\Networkservice, do i need to change this web service account to machine\aspnet account ? if so how can i change this

And also Intialization tab is disabled in Reporting configuration tool? why i am seeing this as disabled.
Appreciate your help guys !! its urgent


I am trying to submit a fairly large amount of data via a POST request (~67k).  When I submit the "large" amount of data, I get a 400 Bad Request response from the server.  When I submit one less record (where the specific record chosen does not appear to matter) the request succeeds without errors.

Here are the details about my environment and what I've done to attempt to get more information about the Bad Request error:

My web server is the ASP.NET Development server (port 4470 currently).
I am running VS2008 SP1 RTM and .NET 3.5 SP1 RTM.
My initial POST is from S2B2 with the Refresh DLL, but subsequent POSTs are made with Fiddler without the use of Silverlight.
I have Verbose errors turned on in my DataService::InitializeService method (config.UseVerboseErrors = true)
I have overridden HandleException in my DataService class (it is not being hit).
Just in case, I added the Regedit setting mentioned in this article: http://support.microsoft.com/kb/826437/en-us. Based on my experiments with Fiddler I have no reason to believe that any unexpected characters are the issue here.
I am getting no errors in Event Viewer.

Here are the steps to reproduce the error:

I run my Silverlight ADO.NET Data Services program.
I make the change that causes the large request.  In this case, I'm changing the sort order of a row in a large list of data.  That can change the SortOrder field of many of the rows.
I submit the changes.
I get an exception in my SaveCompleted method in Silverlight, with the StackTrace for the inner exception being:

at System.Data.Services.Client.DataServiceContext.HandleResponse(HttpStatusCode statusCode, String responseVersion, Func`1 getResponseStream, Boolean throwOnFailure)

at System.Data.Services.Client.DataServiceContext.SaveAsyncResult.HandleBatchResponse()

I can see the request and the 400 response in Fiddler. 
I clone the request into Fiddler's Request Builder.
I reissue the request and verify that the same error occurs.
I delete changesets from the request (from --changeset to the closing entry tag) and keep reissuing the request until it succeeds.

44 records with a "bytes sent" size of 67597 fails.

43 records with a "bytes sent" size of 66105 succeeds.

I tried deleting a selection of different records to go from 44 to 43 to verify that the problem was not with a particular record.  Regardless of which changeset record I deleted from the request, 44 records failed and 43 records succeeded.

Here is the header, followed by the first changeset entry:

Code Snippet

POST /WebSite/BridgetechDataService.svc/$batch HTTP/1.1
Accept-Charset: UTF-8
Accept-Language: en-us
dataserviceversion: 1.0;Silverlight
Accept: application/atom+xml,application/xml
Content-Type: multipart/mixed; boundary=batch_31734f78-0ebe-49d9-aaa7-196465ddf839
maxdataserviceversion: 1.0;Silverlight
Referer: http://localhost:4470/WebSite/Admin/Parameters.aspx
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 3.5.21022; .NET CLR 3.0.30618; .NET CLR 3.5.30729)
Host: localhost.:4470
Content-Length: 66928
Connection: Keep-Alive
Pragma: no-cache

Content-Type: multipart/mixed; boundary=changeset_95b966d1-1e3c-443f-b0d6-aa0eb6f134ff

Content-Type: application/http
Content-Transfer-Encoding: binary

MERGE http://localhost.:4470/WebSite/BridgetechDataService.svc/Parameter(732) HTTP/1.1
Content-ID: 533
Content-Type: application/atom+xml;type=entry
Content-Length: 1215

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<entry xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
  <title />
    <name />
  <content type="application/xml">
      <d:Capture m:type="Edm.Boolean">true</d:Capture>
      <d:CopyForward m:type="Edm.Boolean">false</d:CopyForward>
      <d:Deleted m:type="Edm.Boolean">false</d:Deleted>
      <d:DisplayScript m:null="false" />
      <d:PDAVisible m:type="Edm.Boolean">false</d:PDAVisible>
      <d:ParameterAbbr>Mode switch err</d:ParameterAbbr>
      <d:ParameterID m:type="Edm.Int32">732</d:ParameterID>
      <d:ParameterName>Mode switch error</d:ParameterName>
      <d:ReadScript m:null="false" />
      <d:SortOrder m:type="Edm.Int32">104</d:SortOrder>
      <d:Units m:null="false" />
      <d:WebVisible m:type="Edm.Boolean">false</d:WebVisible>

Does anyone have any idea what might be going on? Or does anyone have any other debugging/analysis suggestions? I realize that there could be other ways to deal with my specific case in order to reduce the size of the request. In particular, I suspect that what I'm going to want to do in this case is to create a Data Services method that will let me simply set the SortOrder for a particular record. That method would handle updating all of the other records that are affected by that SortOrder change, so that the change happens completely on the server (and then update the appropriate SortOrder values on the client side to keep it in sync).

But I would still like to know if there is some sort of limitation or bug I'm running into with ADO.NET Data Services, or if there's something I might be doing wrong.


David Cater


I recently installed the explorer on my computer and when I go to the explorer window in Visual Studio 2005 professional it tries to connect.  However, it times out with the "HTTP Status 400: Bad Request" error popup.

When I searched for this error, a lot of other people had seen this error with Reporting Servers and that it had something to do with MSSQL related stuff.  I've never really messed with Reporting servers or their services nor have I really worked with MSSQL. 

Is there another reason why I might be seeing this error popup?



I am trying to get my MS CRM 4.0 (rollup 7) instance to play nicely with other web sites on a server that also use Kerberos authentication but have application pools that run under different service accounts.  I thought I had it all figured out by using a DNS A record (dev-crm.company.local) pointing to the server IP address and then creating an SPN for HTTP/dev-crm.company.local.  I setup the CRM web site in IIS to use this host header.

Accessing the CRM application through IE appears to work perfect.  Even the reports are working with the double Kerberos hop.

I receive an "HTTP status 400: Bad Request" error however when I try to run the Microsoft CRM Outlook Client Configuration Wizard.

Event Details:

EventType : crmmanaged     P1 : 4.0.7333.2138
P2 : microsoft.crm.client.config     P3 : microsoft.crm
P4 : the request failed with http status 400_ bad request.;hash='-1612535305'

Temp File Generated from Error:

Exception generated at: 5/24/2010 5:27:18 PM
Error Type: System.Net.WebException
Error Message: The request failed with HTTP status 400: Bad Request.
Error Stack Trace: 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)
   at Microsoft.Crm.CompactProxy.CrmService.Execute(Request Request)
   at Microsoft.Crm.Application.Outlook.ClientAuth.ClientAuthProvider.LoadUserId(String organizationName)
   at Microsoft.Crm.Config.Client.ClientConfig.SetSilentUserId(ClientConfigInfo configInfo)
   at Microsoft.Crm.Config.Client.ClientConfig.SetOrganizationId(IDictionary data)
   at Microsoft.Crm.Config.Client.ClientConfig.Run()
   at Microsoft.Crm.Config.Client.ClientConfig.Main(String[] e)
Stack Frame: 
at SetupErrorReportManager.ReportException(Exception exception)
at SetupBase.OnUnhandledException(Exception exception)
at ClientConfig.Main(String[] e)


I ran Fiddler 2 to see what was going on.  It looks like a response is coming from the server name instead of the host header and maybe this is causing the issue.

The response caught by Fiddler is:

HTTP/1.1 400 Bad Request
Content-Type: text/html
Date: Tue, 25 May 2010 13:56:50 GMT
Connection: close
Content-Length: 39

<h1>Bad Request (Invalid Hostname)</h1>


Please let me know if it possible to use the CRM Outlook Client with an A record.  If so, how do you resolve this issue I am seeing?

I found an article (http://gustafwesterlund.blogspot.com/2006/10/changing-of-cname-not-without-problems.html) where Gustaf says it causes problems but that was in 2006.  Surely in 2010 there have been changes and this is possible...I hope.

Thanks in advance,



I am running MOSS 3007 Standard on Windows 2003. When trying to upload files larger than about 29Mb, I am getting an HTTP 400 Bad request error. The error states "HTTP Error 400 - Request is badly formed." I am able to successfully upload a 28Mb file. Sharepoint is configured to accept files up to 75Mb.

I have done a fair amount of research on this, but none of the solutions seem to apply to our environment. The two most likely candidates do not apply, for example we are NOT running URLScan (there are a variety of solutions suggesting this could be an issue with uploads of 30Mb or more), and we are on 2003 with IIS6, so again the issue relating to 2008 and IIS7 do not apply.

The "Request is badly formed" part of the request is particularly confusing as most issues I have come across where this error is the symptom point to errors in custom code that is trying to talk to SharePoint. We have done none of our own custom coding and this error is occurring when attempting a simple upload to a document library.

Trying to drag and drop the file across when the document library is open in windows explorer also fails.

I did come across someone saying they had a similar problem which was caused by a damaged content database, however in this case, it is occuring regardless of which content database I use, so either they are all corrupt, or the issue is IIS related.

Am starting to bang my head, so any additional help or pointers would be greatly appreciated.




I have a custom WCF service running fine on the server, and I can browse it at http://servername:90/_vti_bin/WCF.svc/mex

Now I created a Host Header called externalname in IIS but I can't browse to http://externalname/_vti_bin/WCF.svc/mex

All the sites/pages at http://externalname are working fine and I can even browse to some of the OOB REST services, like http://externalname/_vti_bin/listdata.svc

Also, I have added externalname as an Alternate Access Mapping for Intranet zone in the Farm Administration.


I can browse to http://servername:90/_vti_bin/WCF.svc/mex

I cannot browse to http://externalname/_vti_bin/WCF.svc/mex being 'externalname' a host header in IIS. I always get '400 Bad Request'.

I have tried Fiddler but have no clue to what's going on:

  When I browse to http://servername:90/_vti_bin/WCF.svc/mex I get an HTTP 200 result.

  When I browse to http://externalname/_vti_bin/WCF.svc/mex I get an HTTP 401 followed by an HTTP 400 Bad Request.

I have also tried these workarounds (http://support.microsoft.com/kb/896861/en-us) even though they don't seem totally related to my issue.

Thanks in advance to anyone who might help.



I have defined a WCF service which I want to expose through 2 different bindings (wsHttpBinding and basicHttpBinding). To do so I need to define 2 endpoints:

<system.serviceModel><services><servicebehaviorConfiguration="ServiceBehavior"name="OneWayDemoServiceLibrary.OneWayDemoService"><endpointaddress="" binding="wsHttpBinding"contract="OneWayDemoServiceLibrary.IOneWayDemoService"><identity><dnsvalue="localhost"/></identity></endpoint><endpointaddress="mex"binding="mexHttpBinding"contract="IMetadataExchange"/><endpointaddress="basic"binding="basicHttpBinding"contract="OneWayDemoServiceLibrary.IOneWayDemoService"/></service></services><behaviors><serviceBehaviors><behaviorname="ServiceBehavior"><!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --><serviceMetadatahttpGetEnabled="true"/><!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --><serviceDebugincludeExceptionDetailInFaults="false"/></behavior></serviceBehaviors></behaviors></system.serviceModel>


As the service is hosted in IIS, the base address is defined by the Virtual directory where my service is deployed. It is: http://localhost/WebHost/OneWayDemoService.svc If i type this url in my browser, it shows up properly.

From the MSDN document WCF Addressing In Depth (http://msdn.microsoft.com/en-us/magazine/cc163412.aspx), I understand that the url of the service using basicHttpBinding is  http://localhost/WebHost/OneWayDemoService.svc/basic If I type this url in a browser, I get an HTTP 400 Bad request error.


Now If I use WcfTextClient.exe and put in http://localhost/WebHost/OneWayDemoService.svc, the client shows both endpoint (wsHttpBinding and basicHttpBinding). I have written in my service code something to get the url of the service instance (string uri = OperationContext.Current.EndpointDispatcher.EndpointAddress.Uri.ToString();) which i log into a file. Looking at the log file, I can see that when I call the operation through the basicHttpBinding, the uri equals to: http://mymachine/WebHost/OneWayDemoService.svc/basic and when I call the operation through the wsHttpBinding the uri equals to: http://mymachine/WebHost/OneWayDemoService.svc

I have turned on WCF tracing as well and I can see that the Processing Message activity always receive message on http://mymachine/WebHost/OneWayDemoService.svc in both case but that the Proccess action activity shows in the "Received message over a channel" the following:

<ExtendedDataxmlns="http://schemas.microsoft.com/2006/08/ServiceModel/MessageTransmitTraceRecord"><MessageProperties><Encoder>text/xml; charset=utf-8</Encoder><AllowOutputBatching>False</AllowOutputBatching><Via>http://mymachine/WebHost/OneWayDemoService.svc/basic</Via></MessageProperties>

Note the via node: <Via>http://mymachine/WebHost/OneWayDemoService.svc/basic</Via>

This is for the call through basicHttpBindings; when calling the operation through wsHttepBindings, the Via value is http://mymachine/WebHost/OneWayDemoService.svc


So I am a little at lost here. While everything seems to work fine, I do not understand why I cannot access the url http://mymachine/WebHost/OneWayDemoService.svc/basic which returns the HTTP 400 Bad request error. Is there someone who can explain me why is that and how I can fix it / make it accessible? Being able to see if the endpoint is running in a browser is something I find to be handy.


King regards,

Francois Malgreve






This is both information to those experiencing the issue and a question.

I recently reproduced this problem using a trivial WCF service (the one from endpoint.tv) after resolving the usual config issues one faces moving a service from local IIS to shared hosting.


The problem was the following response (from fiddler) upon checking the url in browser. In searching the web for posts on the topic I found a number of unresolved issues pointing to the same problem in addition to the posts where the usual shared hosting config issues fix them up.

HTTP/1.1 400 Bad Request
Server: Microsoft-IIS/7.0
X-Powered-By: ASP.NET
Date: Tue, 17 Aug 2010 00:27:52 GMT
Content-Length: 0

I was scratching my head regarding this for a while, then I thought to try putting in the "www." which I was previously omitting from my url for no particular reason.

Problem solved.

I can now see the normal output in the browser and interact with the service via WCF Test Client.

So the question is why does this make a difference to the hosted WCF service when I know it does not make a difference for browsing to the website hosted at the same address? With or without the "www." I can browse to the website.


So far I've tested this repro on a GoDaddy service. I may try some others later.


Also, if you happen to know - I'd be interested to know what features are likely to make my WCF services need full trust rather than medium trust. And any thoughts you have on whether it is a good idea to utilise such features (in context of least priv ideology).





I am trying to learn WCF REST Services through http://blogs.msdn.com/endpoint/archive/2010/01/14/updating-state-in-wcf-webhttp-services.aspx , It's a link of Part 3 of 12 part blog series.

Now I am trying the same stuff given in the part 3 with my own Entities and Entity Model instead of what is given in the blog.

Here is my full project I am working on .. http://cid-9e3f62c0688824b0.skydrive.live.com/self.aspx/.Public/pronerveEPMS.zip

For comparision with the code shown in the Blog I am following, you can download the zip file of the project from the same link given here at starting (At the end of the blog and before comments starts).

And here is the method in Program.cs file of console project in my application that raises the exception.....

       private static Role UpdateRole(HttpClient hc, Role role1)


           Console.WriteLine("Updating Role {0} : ",     role1.RoleID);


           string updateURI = "Roles/" + role1.RoleID.ToString();

           HttpContent content = HttpContentExtensions.CreateDataContract(role1);

           using (HttpResponseMessage response = hc.Put(updateURI, content))


               response.EnsureStatusIsSuccessful();               // It raises the "Bad Request" exception

               return response.Content.ReadAsDataContract<Role>();



Here is the my service implementation for the same.......

[WebInvoke(UriTemplate = "Roles/{roleID}", Method = "PUT")]

       public Role UpdateRole(string roleID, Role role)


           int roleIDToUpdate = Convert.ToInt32(roleID);

           role.RoleID = roleIDToUpdate;

           using (PronerveObjectContext poc = new PronerveObjectContext())




               poc.Refresh(RefreshMode.StoreWins, role);


           return role;



Please help me solve this issue.

Thanks in Advance,

Nikhil Thaker



tried so many different things but havent got past this seemingly trivial problem.

I created a WCF service application from visual studio 2010 WCF templates. it generated the IService.cs and Service1.svc files and generated the web.config

i created a website in IIS 7 on windows 2008, and pointed it to the app folder. when i go to http://service.myhost.com/service1.svc via web browser, i get a message indicating service is running and suggests using svcutil etc etc., but when i go to http://service.myhost.com/service1.svc/getdata?value=10 the web browser says 400 bad request. this is without changing anything from what VS generated. the operation contract looks like

string GetData(int value);

and the proxy looks like

public string GetData(int value)
return string.Format("You entered: {0}", value);

web .config looks like

<?xml version="1.0"?>

<compilation debug="true" targetFramework="4.0" />
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<modules runAllManagedModulesForAllRequests="true"/>


Update: forgot to mention i even tried decorating the operation with WebGet attribute with UriTemplate parameter, without luck.


Hi All,

I have issue while accessing the Wcf Rest Service in my Asp.Net Application below are the code spinets.



  [WebGet(ResponseFormat = WebMessageFormat.Xml, UriTemplate = "hello/{Name}"

2.Class File that Implements the Interface



 DNNService : IDNNService
.Format("Hello {0}"
, Name);

3.Web.config File
<system.serviceModel><services><servicebehaviorConfiguration="DNNServiceBehavior"name="DNNService"><endpointaddress="" binding="wsHttpBinding"contract="IDNNService"><identity><dnsvalue="localhost"/></identity></endpoint><endpointaddress="mex"binding="mexHttpBinding"contract="IMetadataExchange"/><endpointaddress="rest"binding="webHttpBinding"behaviorConfiguration="httpBehavior"contract="IDNNService"/></service></services><behaviors><serviceBehaviors><behaviorname="DNNServiceBehavior"><serviceMetadatahttpGetEnabled="true"/><serviceDebugincludeExceptionDetailInFaults="false"/></behavior></serviceBehaviors><endpointBehaviors><behaviorname="httpBehavior"><webHttp/></behavior></endpointBehaviors></behaviors></system.serviceModel>
bove are my code.


Well i am able to generate my SVC file that return correct information with wsdl

But the problem is when i try to access my actual method http://localhost/DC560X_rest/DesktopModules/DNNCentric-RestService/Entities/DNNService.svc/rest/hello/prabhakar

1 IE Dispaly "400 Bad Request" 2.Firefox Display Blank Page

Please help me out.

Please help me

Thanks in advance

i've just installed esb for the fourth time in a row...

i've been following instructions from quicklearn site: http://www.quicklearn.com/blog/post/Getting-up-and-Running-with-BizTalk-ESB-Toolkit-20.aspx

i've done all steps until opening web page with settings... then  i get information:

Event Type:    Warning
Event Source:    ASP.NET 2.0.50727.0
Event Category:    (3)
Event ID:    1309
Date:        9/7/2009
Time:        3:25:30 PM
User:        N/A
Computer:    ComputerName
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 9/7/2009 3:25:30 PM
Event time (UTC): 9/7/2009 2:25:30 PM
Event ID: 3730fa022421436e95f4b8a832593228
Event sequence: 13
Event occurrence: 4
Event detail code: 0
Application information:
    Application domain: /LM/W3SVC/1/ROOT/ESB.Portal-3-128968059563683423
    Trust level: Full
    Application Virtual Path: /ESB.Portal
    Application Path: C:\Projects\Microsoft.Practices.ESB\Source\Samples\Management Portal\ESB.Portal\
    Machine name: computername
Process information:
    Process ID: 6512
    Process name: w3wp.exe
    Account name: domain\btsserviceaccount
Exception information:
    Exception type: WebException
    Exception message: The remote server returned an error: (400) Bad Request.
Request information:
    Request URL: http://localhost/esb.portal/default.aspx
    Request path: /esb.portal/default.aspx
    User host address: ::1
    User: domain\myuserlogin
    Is authenticated: True
    Authentication Type: Negotiate
    Thread account name: domain\btsserviceaccount
Thread information:
    Thread ID: 7
    Thread account name: domain\btsserviceaccount
    Is impersonating: False
    Stack trace:    at System.Net.HttpWebRequest.GetResponse()
   at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
Custom event details:

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

when i follow the execution it fails at:
List<UserSetting> settings = client.GetUserSettings(context.User.Identity.Name);

Further investigation revealed that the user I am running this under (a member of the BizTalk Server Administrators group) does not have SELECT permissions on the UserSettings table in EsbExceptionDb. I did see that this table did not have any roles assigned (ESBPortal or ESBPortalAdmin). Is this how the ESb config tool meant to work?

  Can any give Mtom Solution for my below problem,

WCF Method

bool isSucess = objPartRatingBll.InsertPartyDetails(dtTempCounterDetails,





xmlversion="1.0"encoding="utf-8" ?>
maxBytesPerRead="4096"maxNameTableCharCount="16384" />
enabled="false" />
transportclientCredentialType="Windows"proxyCredentialType="None" realm="" />
algorithmSuite="Default"establishSecurityContext="true" />



dnsvalue="localhost" />

Here i can't invoke WCF Method, because it showing error message(The remote server returned an unexpected response: (400) Bad Request.) because my datatable contain 1502 records, so i need MTom solution for this problem, please any one guide me.




I need to host a WCF Data service as part of a legacy ASP.NET MVC website running in IIS 7 Integrated mode.

Read access to the web service is working fine, but whenever I try to POST to the web service, I get a 400 Bad Request error.

For testing purposes, I have downloaded the sample odata service from http://www.odata.org/developers/odata-sdk#/media/7582/odatasampleservices.zip . Posting to that webservice works fine when running it in a IIS website. However, when I put it in my legacy website, I am geting that 400 Bad Request error wen sending a post request to the service again.

Therefore the problem seems to be related to the configuration of my ASP.NET MVC project. However, I am at a loss on how to proceed.

This is the web config file I am using in my legacy project:


<?xml version="1.0" encoding="utf-8"?>
 Note: As an alternative to hand editing this file you can use the 
 web admin tool to configure settings for your application. Use
 the Website->Asp.Net Configuration option in Visual Studio.
 A full list of settings and comments can be found in 
 machine.config.comments usually located in 
 <section name="combres" type="Combres.ConfigSectionSetting, Combres" />
 <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,Log4net" />
 <sectionGroup name="elmah">
  <section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
  <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
  <section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
  <section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
  <section name="errorMailSAZ" requirePermission="false" type="ElmahFiddler.ElmahMailSAZSectionHandler, ElmahFiddler" />
 <combres definitionUrl="~/App_Data/combres.xml" />
  <level value="ALL" />
  <appender-ref ref="RollingFile" />
 <logger name="Combres">
  <level value="DEBUG" />
 <appender name="RollingFile" type="log4net.Appender.RollingFileAppender">
  <file value="log.txt" />
  <appendToFile value="true" />
  <maximumFileSize value="100KB" />
  <maxSizeRollBackups value="2" />
  <layout type="log4net.Layout.PatternLayout">
  <conversionPattern value="%d [%t] %-5p %c - %m%n" />
 <appSettings configSource="appSettings.config" />
 <connectionStrings configSource="connectionstrings.config">
 <!-- Mail server settings-->
			<smtp deliveryMethod="Network" from="support@logmytime.de">
				<network defaultCredentials="true" host="smtp.logmytime.de" port="25" userName="support@logmytime.de" password="Je-4pQmiSe0e"/>
 <globalization uiCulture="de" culture="de-DE" />
 <compilation debug="true">
  <add assembly="System.Web.Mvc, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
  <add assembly="Microsoft.ReportViewer.WebForms, Version=, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
  <add assembly="Microsoft.ReportViewer.Common, Version=, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
  <add assembly="System.Web.Abstractions, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
  <add assembly="System.Web.Routing, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
  <add assembly="System.Data.Linq, Version=, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
  <add assembly="System.Data.Entity, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
  <add assembly="System.Core, Version=, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
  <add assembly="System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
  <add assembly="System.Xml.Linq, Version=, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
  <add assembly="System.Data.DataSetExtensions, Version=, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
  <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
 <authentication mode="Forms">
  <!-- User muessen sich nach 30 Tagen abwesenheit neu einloggen (wenn remember me angeklickt wird)-->
  <forms loginUrl="~/Profile/LogOn" timeout="43200" slidingExpiration="true" />
  <clear />
  <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="500" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression="" applicationName="/" />
  <clear />
  <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="ApplicationServices" applicationName="/" />
 <roleManager enabled="true">
  <clear />
  <add connectionStringName="ApplicationServices" applicationName="/" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  <add applicationName="/" name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
 <customErrors configSource="customErrors.config" />
 <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
  <add namespace="System.Web.Mvc" />
  <add namespace="System.Web.Mvc.Ajax" />
  <add namespace="System.Web.Mvc.Html" />
  <add namespace="System.Web.Routing" />
  <add namespace="System.Linq" />
  <add namespace="System.Collections.Generic" />
  <add namespace="xVal.Html" />
  <add namespace="Zeiterfassung.Views" />
  <add namespace="Zeiterfassung.Models" />
  <add namespace="Zeiterfassung" />
  <add namespace="GrigoreComponents.Generic" />
  <add namespace="DeverMind.Generic" />
  <!--<add namespace="MvcContrib.UI.Grid.ActionSyntax" />-->
  <add path="captcha.ashx" verb="GET" type="ManagedFusion.Web.Mvc.Handlers.CaptchaImageHandler, ManagedFusion, Version=1.0.3490.29346, Culture=neutral" validate="false" />
  <add path="*.mvc" verb="*" type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=, Culture=neutral, PublicKeyToken=null" validate="false" />
  <!--<add path="VSEnterpriseHelper.axd" verb="GET" type="Microsoft.VisualStudio.Enterprise.Common.AspNetHelperHandler, Microsoft.VisualStudio.Enterprise.ASPNetHelper, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />-->
  <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false" />
  <add path="/elmah.axd" verb="POST,GET,HEAD" type="Elmah.ErrorLogPageFactory, Elmah" />
  <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
  <authenticationService enabled="true" requireSSL="false" />
  The system.webServer section is required for running ASP.NET AJAX under Internet
  Information Services 7.0. It is not necessary for previous version of IIS.
 <validation validateIntegratedModeConfiguration="false" />
 <modules runAllManagedModulesForAllRequests="true">
  <add name="Elmah.ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
  <add name="Elmah.ErrorFilter" type="Elmah.ErrorFilterModule" preCondition="managedHandler" />
  <add name="Elmah.ErrorMail" type="Elmah.ErrorMailModule" preCondition="managedHandler" />
  <add name="elmahSAZ" type="ElmahFiddler.ElmahMailSAZTraceModule, ElmahFiddler" />
  <add name="Elmah" path="elmah.axd" verb="POST,GET,HEAD" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" />
  <remove name="MvcHttpHandler" />
  <remove name="UrlRoutingHandler" />
  <add name="MvcHttpHandler" preCondition="integratedMode" verb="*" path="*.mvc" type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=, Culture=neutral, PublicKeyToken=null" />
  <!--<add name="VSEnterpriseHelper.axd" verb="GET" path="VSEnterpriseHelper.axd" preCondition="integratedMode" type="Microsoft.VisualStudio.Enterprise.Common.AspNetHelperHandler, Microsoft.VisualStudio.Enterprise.ASPNetHelper, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>-->
  <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
 <!--404 fehler sind was besonderes, ich will sie nicht in elmah sehen und ausserdem funktioniert es aus unbekannten gruenden eh nicht wenn ich sie auf dem hetzner-server per 
 customerrors handle-->
  <remove statusCode="404" subStatusCode="-1" />
  <error statusCode="404" prefixLanguageFilePath="" path="/Error/FileNotFound" responseMode="ExecuteURL" />
  <!--cache static content on the client side for 7 days-->
  <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" />
  <rule name="CanonicalHostName-Adrian" enabled="true" stopProcessing="true">
   <match url="(.*)" />
   <add input="{HTTP_HOST}" pattern="^worklogger\.de:4567$" />
   <action type="Redirect" url="http://www.worklogger.de:4567/{R:1}" />
  <rule name="CanonicalHostName-Sandra" enabled="true" stopProcessing="true">
   <match url="(.*)" />
   <add input="{HTTP_HOST}" pattern="^worklogger\.de:7654$" />
   <action type="Redirect" url="http://www.worklogger.de:7654/{R:1}" />
  <rule name="CanonicalHostName-Production" enabled="true" stopProcessing="true">
   <match url="(.*)" />
   <add input="{HTTP_HOST}" pattern="^logmytime\.de$" />
   <action type="Redirect" url="http://www.logmytime.de/{R:1}" />
  <rule name="RemoveTrailingSlashRule1" enabled="true" stopProcessing="true">
   <match url="(.*)/$" />
   <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
   <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
   <action type="Redirect" url="{R:1}" />
  <rule name="Rewrite rule for RewriteMap" enabled="true" stopProcessing="true">
   <match url=".*" />
   <add input="{RewriteMap:{REQUEST_URI}}" pattern="(.+)" />
   <action type="Redirect" url="{C:1}" appendQueryString="false" />
  <rule name="jquery-UI images" enabled="true" stopProcessing="true">
   <match url="(.*)combres.axd/UserAreaCSS/images/(.*)" />
   <conditions logicalGrouping="MatchAny"></conditions>
   <action type="Rewrite" url="Scripts/jquery-ui/css/custom-theme/images/{R:2}" />
    <rule name="Add API trailing slash without redirecting the user to a different domain" enabled="false" patternSyntax="ExactMatch" stopProcessing="true">
     <match url="API/V1/APi.svc" />
     <action type="Redirect" url="API/V1/APi.svc/" redirectType="Permanent" />
  <rewriteMap name="RewriteMap">

   <add key="/Zeiterfassung/zeiterfassungssoftware.html" value="/Zeiterfassung/Arbeitszeit/Zeiterfassungssoftware" />
 <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <assemblyIdentity name="Microsoft.VisualStudio.Enterprise.ASPNetHelper" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
  <codeBase version="" href="file:///C:/Program%20Files%20(x86)/Microsoft%20Visual%20Studio%209.0/Common7/IDE/PrivateAssemblies/Microsoft.VisualStudio.Enterprise.ASPNetHelper.DLL" />
  <assemblyIdentity name="Microsoft.VisualStudio.Enterprise.ASPNetHelper" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
  <codeBase version="" href="file:///C:/Program%20Files%20(x86)/Microsoft%20Visual%20Studio%209.0/Common7/IDE/PrivateAssemblies/Microsoft.VisualStudio.Enterprise.ASPNetHelper.DLL" />
  <dependentAssembly xmlns="">
  <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
  <bindingRedirect oldVersion="" newVersion="" />
 <location path="VSEnterpriseHelper.axd">
  <allow users="?" />
 <!-- Deny everyone except siteadmins to see the elmah.axd -->
 <location path="elmah.axd">
  <allow roles="SiteAdmin" />
  <deny users="*" />
 <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />




Thanks for your help,




Please help, any suggestion are highly welcomed. I have a webpage that has a report inside, it work fine when there is not many records, but when it have more than 400 records, it will have the following error:

The remote server returned an error: (400) Bad Request.

An error has occurred during report processing.
Exception has been thrown by the target of an invocation.
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

my aspx page
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OutputSummReport.aspx.cs" Inherits="WebSite.OutputReport" %>

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <form id="form1" runat="server">
        <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" 
            Font-Size="8pt" ShowPrintButton ="False" Height="600px" Width="1100px">
            <LocalReport ReportPath="Output Summary Report.rdlc">
                    <rsweb:ReportDataSource DataSourceId="ObjectDataSource1" 
                        Name="OutReportDataSet_GetOutRecordsForReport" />
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
            OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" 
                <asp:Parameter Name="OrderList" Type="String" />
                <asp:Parameter Name="OrgID" Type="String" />

the code behind
using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Microsoft.Reporting.WebForms;

namespace WebSite
    public partial class OutputReport : System.Web.UI.Page
        protected void Page_Load(object sender, EventArgs e)
            ReportViewer1.Visible = true;
            string mqids = Session["SelectedMQID"].ToString();
            string id = Request.QueryString["orgid"];
            Parameter p1 = new Parameter("OrderList", System.Data.DbType.String, mqids.ToString());
            Parameter p2 = new Parameter("OrgID", System.Data.DbType.String, id.ToString());
            Session["SelectedMQID"] = null;


we are getting an 400/bad Request when we send a request. Please find our code below

PublicSub test123() 
   URL ="http://dev1.xxxxx.employer/employer/v02/Employer.svc" 
   Dim requestDoc 
   Set requestDoc =CreateObject("MSXML2.DOMDocument.3.0") 
   Dim root 
   Set root = requestDoc.createNode(1,"Envelope","http://schemas.xmlsoap.org/soap/envelope/") 
   requestDoc.appendChild root 
   Dim nodeBody 
   Set nodeBody = requestDoc.createNode(1,"Body","http://schemas.xmlsoap.org/soap/envelope/") 
   root.appendChild nodeBody 
   Dim nodeOp 
   Set nodeOp = requestDoc.createNode(1,"Register","http://xxxxx.com/Employer/Contracts/v2") 
   nodeBody.appendChild nodeOp 
   Dim nodeRequest 
   Set nodeRequest = requestDoc.createNode(1,"request","http://xxxxx.com/Employer/Contracts/v2") 
   'content of the request will vary depending on the WCF Service.' 
   ' This one takes just a plain string. ' 
   Dim sv_strTempxml AsVariant 
   sv_strTempxml1 ="<CreateProspectRequest xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">" _ 
   &"<Employer><PartyDisplayName>0707 NS2 DEV1 KRISH 001</PartyDisplayName><PreferredLanguageIdentifier xsi:nil=""true"" />" _ 
   &"<PartyIdentifier xsi:nil=""true"" /><PartyAddresses><PartyAddressStructure><BeginTimeStamp xsi:nil=""true"" /><CityName>Alexander City</CityName>" _ 
   &"<CountryCode>US</CountryCode><EndTimeStamp xsi:nil=""true"" /><FirstLineAddress>111 Main Street</FirstLineAddress><PostalCode>35010</PostalCode>" _ 
   &"<SecondJurisdictionCode>AL</SecondJurisdictionCode><SecondJurisdictionTypeCode>ST</SecondJurisdictionTypeCode><SecondLineAddress>PL</SecondLineAddress><AddressIdentifier xsi:nil=""true"" />" _ 
   &"<PartyIdentifier xsi:nil=""true"" /><AddressUsageIdentifier>100000</AddressUsageIdentifier><SecondJurisdiction>1</SecondJurisdiction><ChangeTypeCode xsi:nil=""true"" />" _ 
   &"</PartyAddressStructure></PartyAddresses><PreferredLanguage>100</PreferredLanguage><ChangeTypeCode xsi:nil=""true"" /><PartyTypeIdentifier xsi:nil=""true"" />" _ 
   &"<EstablishedDate xsi:nil=""true"" /><OrganizationTypeIdentifier>100018</OrganizationTypeIdentifier><OrganizationNames><OrganizationNameStructure>" _ 
   &"<NameEndTimestamp xsi:nil=""true"" /><NameStartTimestamp xsi:nil=""true"" /><OrganizationPartyName>0707 NS2 DEV1 KRISH 001</OrganizationPartyName><NameTypeIdentifier>1</NameTypeIdentifier>" _ 
   &"<PartyIdentifier xsi:nil=""true"" /><ChangeTypeCode xsi:nil=""true"" /></OrganizationNameStructure></OrganizationNames><ProspectReceivedDate xsi:nil=""true"" />" _ 
   &"<RatingGroupIdentifier xsi:nil=""true"" /></Employer><AffiliationCode>UUS</AffiliationCode></CreateProspectRequest>" 
   nodeRequest.Text= sv_strTempxml1 
   nodeOp.appendChild nodeRequest 
   Set nodeRequest =Nothing 
   Set nodeOp =Nothing 
   Set nodeBody =Nothing 
   Set root =Nothing 
   'MsgBox "sending request " & vbCrLf & requestDoc.XML 
   Set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP.3.0") 
   'set the proxy as necessary and desired ' 
   'xmlhttp.setProxy 2,"http://localhost:8888" 
   xmlhttp.Open"POST", URL,False 
   ' set SOAPAction as appropriate for the operation ' 
   xmlhttp.setRequestHeader "SOAPAction","http://xxxxx.com/Employer/Contracts/v2/Employer/CreateProspect" 
   xmlhttp.setRequestHeader "Content-Type","application/soap+xml; charset=utf-8" 
   xmlhttp.send requestDoc.XML 
   ' vbCrLf & "Raw XML response:" & vbCrLf 
   MsgBox xmlhttp.responseXML.XML 
End Sub 

is there any item we have missed out



I have windows application that proccess and reply to user SMS. I use a web service to send and recieve SMS.I have no access to sever and service setting and only add its reference in my application via "add Service Reference". When i call test method i get following error:

"The remote server returned an unexpected response: (400) Bad Request"

public void TestMethod()


			OutputMessage newMessage = new OutputMessage("YYYYYYY", "XXXXXXX", MessagePriority.Medium);

			for (int i = 0; i < 10; i++)


				ThreadStart starter = delegate() { AnotherTestMethod(newMessage); };

				Thread newthread = new Thread(starter);



		private void AnotherTestMethod(OutputMessage messageToSend)

			smsSoapClient _client = new smsSoapClient();
			string resultOfdoSendSMSCall = _client.doSendSMS("dpardazesh", "dpardazesh", "XXXXXXXX", "XXXXXXXXX", "SMS Text", true);


Only 2 SMS send by service. I maxReceivedMessageSize  in my app.config file but get same error again.

Can anyone help me?



I have windows application that proccess and reply to user SMS. I use a web service to send and recieve SMS.I have no access to sever and service setting and only add its reference in my application via "add Service Reference". When i call test method i get following error:

"The remote server returned an unexpected response: (400) Bad Request"

		public void TestMethod()


			OutputMessage newMessage = new OutputMessage("YYYYYYY", "XXXXXXX", MessagePriority.Medium);

			for (int i = 0; i < 10; i++)


				ThreadStart starter = delegate() { AnotherTestMethod(newMessage); };

				Thread newthread = new Thread(starter);




		private void AnotherTestMethod(OutputMessage messageToSend)


			smsSoapClient _client = new smsSoapClient();


			string resultOfdoSendSMSCall = _client.doSendSMS("dpardazesh", "dpardazesh", "XXXXXXXX", "XXXXXXXXX", "SMS Text", true);

			Regex expression = new Regex("Send OK.");

			if (expression.IsMatch(resultOfdoSendSMSCall))


				resultOfdoSendSMSCall = resultOfdoSendSMSCall.Replace("Send OK.", string.Empty).Trim();

				XDocument XmlDocument = XDocument.Parse(resultOfdoSendSMSCall);

				var AllMessages =

				from message in XmlDocument.Elements("ReturnIDs")

				select message.Value;




Only 2 SMS send by service. I maxReceivedMessageSize  in my app.config file but get same error again.

Can anyone help me?



I am using IIS 6.0.

I have a server, in which i have a web application, which was in http. The report manager(SSRS 2005) was also in http. I moved the web application to https. After moving, i am not able to access the report manager, but i am able to access the web application.

I am getting the error as "The remote server returned an error: (400) Bad Request.".

How to open the report manager.

Thank you


<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure