WCF / ASMX :: Too Many Parameters 400 Bad Request Error

Dec 23, 2010

I created a WCF. The web.config is as follows,

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<compilation debug="true" />
</system.web>
<system.serviceModel>
</system.serviceModel>
<system.webServer>
<directoryBrowse enabled="true" />
</system.webServer>
</configuration>
The following can be seen in the service.svc file,
class AppServiceHostFactory : ServiceHostFactory
{
protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)
{
return new WebServiceHost2(serviceType, true, baseAddresses);
}
}
This is the method in the service.svc.cs,
[WebHelp(Comment="Sample description for GetData")]
[WebGet(UriTemplate="/GetData/param1/{i}/param2/{s}")]
[OperationContract]
public SampleResponseBody GetData(string i, string s)
{
// TODO: Change the sample implementation here
// if (i < 0) throw new WebProtocolException(HttpStatusCode.BadRequest, "param1 cannot be negative", null);
return new SampleResponseBody()
{
Value = String.Format("Sample GetData response: '{0}', '{1}'", i, s)
};
}

The following is the webservice url. It returns data if it's run through the asp.net engine but throws bad request when run from IIS. I added the following entry in the web.config but no use. it still fails.

<httpRuntime maxRequestLength="1500000" executionTimeout="180"/>

[URL]-499,500~~~/param2/621100,621600,622100,611500,611600,611700,561300,611100,611200,611300,611400,622200,622300,623100,621100,621600,622100,611500,611600,611700,561300,611100,611200,611300,611400,622200,622300,623100,621100,621600,622100,611500,611600,611700,561300,611100,611200,611300,611400,622200,622300,623100,,622100,611500,611600,611700,561300,611100,611200,611300,611400,622200,622300,623100,611100,611200,611300,611400,622200,622300,623100,611100,611200,611300,611400,622200,622300,623100,611100,611200,611300,611400,622200,622300,623100,623100,611100,611200,611300,611400,622200,622300,623100,623100,611100,611200,611300,611400,622200,622300,623100,622300,623100,623100,611100,611200,611300,611400,622200,622300,623100,622300,623100,623100,611100,611200,611300,611400,622200,622300,623100,623100,623100,611100,611200,611300,611400,622200,622300,623100,623100,623100,611100,611200,611300,611400,622200,622300,623100,623100,623100,611100,611200,611300,611400,622200,622300,623100

View 2 Replies


Similar Messages:

WCF / ASMX :: Error - The HTTP Request Is Unauthorized With Client Authentication Scheme 'Negotiate'

Oct 15, 2010

I'm using a WCF with windows authentication.

I also use custom binding:

[Code]....

While trying to access the service without specifing the user credentials everything work's ok and the current user(Thread.CurrentPrincipal.Identity.Name) at service is the logged in user.

When I try to set user credentials this way:

[Code]....

The service just ignores them.

When I try it this way:

[Code]....

I'm getting this error: "The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'Negotiate,NTLM'."

View 1 Replies

WCF / ASMX :: Accessing Response Of HttpWebRequest, Even When Request Returns 500 Internal Server Error

Oct 22, 2010

Hoping someone can point me to a solution, haven't been able to find one yet.

I'm using the standard way for send HttpWebRequest

[Code]....

As you can see from Fiddler/SOAPUI it does return the SOAP fault, however using HttpWebRequest i can't capture the response.

Returning 500 triggers my exception handling and Capturing the WebException doesn't expose the response.

Does anyone know how to capture this response xml in the case of 500 Internal Server Errors.

View 1 Replies

MVC :: MVC3 RC2 Bug Binding From Request Parameters To Method Parameters?

Dec 10, 2010

Since ASP.NET MVC3 RC2 I encounter a bug when posting values to a controller method of which one of the parameter is a nullable int. Steps to reproduce:

I've created a test method

[code]....

In MVC3 RC1 this was working without any problems with the nullable int

Update:
I don't seem to have the problem with a newly created MVC3 website. What could I have in my project that influence model binding to nullable int's? And why would there be a difference between RC1 and RC2?

View 10 Replies

WCF / ASMX :: Request Failed With HTTP Status 400: Bad Request Accessing Web Service

May 15, 2010

I have a webservice which works 100% fine on my developer machine. Where Web Service is installed on LOCALHOST on my developer machine,Then i went to my servers, I installed webservice on one server and map it with the server where the website is hosted, Then i tried accessing this service using BROWSER from my web server, it worked fine, That means the mapping was done perfect.Then i run my program on web server (website). It worked fine on page1, then on page2, but when i did the same and call same function on page3, It popped me any error of

View 4 Replies

WCF / ASMX :: While Consuming Webservice Getting Error As "The Request Failed With HTTP Status 401: Unauthorized"

Jun 18, 2010

I am trying to consume a webservice. I added the web reference. But when i try to access the method, I am getting the error as:"The request failed with HTTP status 401: Unauthorized."The web service has username as "user1", password as "pass".I tried this:

Service1.TestPrcsService serv = new Service1.TestPrcsService();
serv.PreAuthenticate = true;
serv.Custom_methodname(true);

How to pass the username and password to access the method?

View 2 Replies

WCF / ASMX :: WCF Add Service Reference Error "The Request Failed With HTTP Status 403: Forbidden"

Apr 11, 2010

when i am adding service reference the Following erro shows Up..where as the same works on the Other machine. The url when tested in Internet explorer works but only while adding shows the error. The request failed with HTTP status 403: Forbidden. The HTTP request was forbidden with client authentication scheme 'Anonymous'.

View 5 Replies

WCF / ASMX :: IIS Memory Increasing For Each Client Request In Asmx Web Service?

Nov 8, 2010

A customer reported that our asmx web service is continually increasing in memory (mem usage as well as private bytes). We are able to reproduce the problem in our lab with Windows 2003 Server SP2 (fully patched) on some of the machines. The customer is using Windows 2008.

We created a Hello World web service targeting the 2.0 framework built under VS2005 SP1 and a test client that continues to call it. The memory increases steadily - approximately 40K per client request. If the test app is paused, the memory remains the same. When it is closed, the memory drops. Explicit calling of GC.Collect does not drop the memory.

We have run the memory profiler on the service and the leak is all native memory. We have uninstalled/re-installed the Framework on one of the machines but no difference. To our knowledge all of the security and IIS settings are not modified. We have compared app pool, default web site and virtual directory properties to machines that have no problem and they are identical.

View 11 Replies

WCF / ASMX :: Calling A Web Request - 400 Bad Server Request?

May 28, 2010

I am facing an issue while calling a web request thru my code. I have searched a lot on number of sites but did not get any solution.

Here is the code which I am using:

[Code]....

View 3 Replies

Why Parameters Are Encoded When Sent Through HTTP Request

Feb 17, 2011

I am curious to know the reasons why the HTTP request encodes(URLEncoded) all the parameters before sending it across the network in POST request.

View 1 Replies

DataSource Controls :: Request.querystring In Select Parameters?

Aug 7, 2010

I need to get a querystring in a select parameter

datasource.selectparameters.add("PostId", request.querystring("PostId"))

Something like that...but...i cant get the snytax right.

View 3 Replies

WCF / ASMX :: Optional Parameters In WCF?

Jan 19, 2011

I want to create a method with optional parameters in my wcf service. I am doing it like this

[Code]....

When I try to use it in my client application and try to pass the values only for first two parameters it gives me an error that"Argument not sepecified for parameter Status"

View 4 Replies

WCF / ASMX :: REST IIS 7 Bad Request 400

Sep 23, 2010

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 [URL] via web browser, i get a message indicating service is running and suggests using svcutil etc etc., but when i go to [URL] the web browser says 400 bad request. this is without changing anything from what VS generated. the operation contract looks like

[Code]....

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

View 4 Replies

WCF / ASMX :: Web Service Getting Request?

Oct 5, 2010

[Code]....Web Service Getting Request

[Code]....

View 1 Replies

WCF / ASMX :: How To Pass The Parameters Into Webservice Method

Jan 4, 2011

i am working in the webservice project. I have one project when i run it then shows the text box for parameters and return the result after passing the parameters.

But another webservice does not allow me to enter the paramerters when execute then list of methods displayed and then show the soap xml when click at any method.

what difference found in both webserivces are Excuting-one that have the Text boxes: Test: "To test the operation using the HTTP POST protocol, click the 'Invoke' button."

2nd One Not provide the parameter text boxes: Test: "The test form is only available for methods with primitive types as parameters"

Dont know how to fix that. Because i want to debug the webservice and as i am unable to provide the parameter then how can i fix it.

how can i pass the parameters in the 2nd webservice as it has different information mentioned above.

View 1 Replies

WCF / ASMX :: Passing Multiple Parameters To A Web Method?

Dec 15, 2010

I am creating a Web Service, which will be used by a client to send data to our Database.The client will be sending close to 30 fields that will be updated to our table. If I write a Web method, I will need to have all these 30 fields as parameters to that method. Is there a better way than sending all of them as parameters?

View 3 Replies

WCF / ASMX :: Passing Parameters To Webservice Method?

Nov 13, 2010

i have the following method, however i want to pass methods to it, i know how to do it the usual way, however when it comes to Webservices/API's what is the correct way to do it. Here is my method so far;

[Code]....

View 1 Replies

Modify Request Querystring Parameters To Build A New Link Without Resorting To String Manipulation

Apr 6, 2010

I want to dynamically populate a link with the URI of the current request, but set one specific query string parameter. All other querystring paramaters (if there are any) should be left untouched. Eg, imagine I want to build a link back to the current page, but with the querystring parameter "valueOfInterest" always set to be "wibble" (I'm doing this from the code-behind of an aspx page, .Net 3.5 in C# FWIW).Eg, a request for either of these two:

/somepage.aspx
/somepage.aspx?valueOfInterest=sausages

would become:

/somepage.aspx?valueOfInterest=wibble

And most importantly (perhaps) a request for:

/somepage.aspx?boring=something
/somepage.aspx?boring=something&valueOfInterest=sausages

would preserve the boring params to become:

/somepage.aspx?boring=something&valueOfInterest=wibble

Caveats: I'd like to avoid string manipulation if there's something more elegant in asp.net that is more robust. However if there isn't something more elegant, so be it. I've done (a little) homework: I found a blog post which suggested copying the request into a local HttpRequest object, but that still has a read-only collection for the querystring params. I've also had a look at using a URI object, but that doesn't seem to have a querystring

View 3 Replies

WCF / ASMX :: How To Capture SOAP XML Request

Jan 24, 2011

I'm consuming an external web service (yahoo adverts), and what I need is capture the SOAP XML request I'm sending and response I'm getting.

I tried using Fiddler, but wasn't able to capture the request. how to do this?

View 5 Replies

WCF / ASMX :: Encrypting A Request In Web Service?

Nov 11, 2010

Am consuming a web service for example Calculator

Calculator CALC = new Calculator();
int a = CALC.Add("23","27");
and result will be stored in a;

Please help me to encrypt this request using the X509 certificate. Am having a certificate with public key and with subject "My Calculator"and also decrypt the result with the private key "abcdef" and with subject "My Response"

View 2 Replies

WCF / ASMX :: Send A Soap Request?

Jun 28, 2010

I have this wsdl file and here is how the requets look like.

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<Request xmlns=http://www.sometest.com/ttt>
<UserDetails xmlns="">
<UserName>username</UserName>
<PassWord>password</PassWord>
<AsiakkaanViite/>
</UserDetails>
<DestDetails xmlns="">
<SearchNameAndAddress>
<Name>company name</Name>
</SearchNameAndAddress>
</DestDetails>
</Request>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

how i can code this in c# or send the request?

View 2 Replies

WCF / ASMX :: Second Request To Webservice Is Not Handled?

Aug 10, 2010

I have a Asp.net webservice. This webservice uses a dll ( the purpose of the dll is to listen at a port say 3305 and accept the request from one of its client (say client is some name PG and this client is different from webservice client) and the dll keeps communicating to the PG client to get some data.)

The webservice works like this.

When a request comes from my test program to Webservice, the webmethod calls the dll api ( to establish the connection between the dll and PG client). and after the connection is established between dll and PG client, the webmethod uses the data from my test program and implements some business logic and then returns some values to the test program.

After the first request from my test program is processed, the connection between DLL and PG will still be existing so as to serve the subsequent request from the test program.

The problem is after the first request is finished, the second request is not being processed by webservice, the request doesnot come to the webmethod or even to the class constructor.

is the connection between the DLL and PG , hanging up the webservice?

View 3 Replies

WCF / ASMX :: Viewing The Generated Xml Request?

Jan 6, 2011

I have a service reference added to my application. My understanding is that when i call one of its methods within my code, an xml request is generated and sent to the web service. I need to be able to see the xml that gets generated. Is this possible? Maybe by modifying the auto-generated web service code?

View 1 Replies

WCF / ASMX :: Request Timed Out In Web Service?

Mar 31, 2010

I am calling web service which takes very long time to execute due to which i get request timed out exception....

I hav kept my web method processing in try catch block....

even i have handled httpException....but it gives Request timed out exception..

View 1 Replies

WCF / ASMX :: Any Examples For Consuming Web Service Method By XML Parameters Using MVC?

Jan 18, 2011

For example, we are going to consume web method GetEmployeeByQuery(ConnInfoXML, Query, RecordDetail), ConnInfoXML is login information in XML, Query is a SQL statement selecting records, RecordDetail is all records retrieved. All data are in XML format.

So how to write these parameters in XML to consume this web method and get all the information in XML, and then transfer XML to normal string format ?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved