Webservice Won't Accept JSON Requests?

Apr 13, 2010

The main issue is that I cannot run a webservice that accepts requests in JSON format. I keep getting a 500 Server error stating that the "request format is invalid." My ASP.NET AJAX extensions are installed. My server is running Plesk Control Panel 8.6 which is undoubtedly causing these problems.

The default handler for this specified extension is shown in the web.config like so:

For my applications webservice to handle JSON it needs to have this reference:

<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

Plesk is not allowing the request to be handled properly. I need to know the correct http directive(s) to put into the web.config to properly handle JSON webservices.

View 1 Replies


Similar Messages:

How To Configure IIS To Accept Post Requests

Aug 12, 2010

I know by default IIS doesn't accept post requests how can I change this setting. Can someone walk me through changing this (step by step).

If so I'm more than willing to be your friend in the afterlife.

View 2 Replies

Trying To Enable A Webservice To Accept HTTP Get?

Mar 8, 2011

I'm trying to enable a webservice to accept HTTPGet. I've done this in the past, but I have a feeling BlogEngine.NET may be interfering somehow. I've added these sections to web.config:

<system.web>
<webServices>
<protocols>
<add name="HttpGet" />
<add name="HttpPost" />
</protocols>
</webServices>

And my method has this signature:

[ScriptMethod(UseHttpGet = true)]
[WebMethod]
public void GetCurrent(string setupType)

Yet when I call the service, I just get the the WSDL description page. I'm trying to binary write a file to track numbers of downloads, so I have a rewrite rule to redirect what looks like a .zip file to my download service. The rewriting works fine as I see the WSDL file, but the method isn't invoked.

View 1 Replies

Is It Possible To Make JSON Requests Using Fiddler's Request Builder

Apr 7, 2010

I keep getting a Request format is invalid.

Here's the raw http that get's sent:

[code]....

View 1 Replies

WCF / ASMX :: How To Configure Webservice For Jquery Requests And Responses

Jan 23, 2011

I added a new asmx file, which start like this:

[Code]....

I have uncommented the ScriptService line to allow access from scripts.

What else do I need to set to make jquery connections?

Can I prevent access from outside my app? I only want to provide a service for signed-in users (web forms) via own webpage.

View 5 Replies

WCF / ASMX :: Code Within A WebService And WCF Client Work Only When Fildder Is Capturing Requests?

Mar 31, 2011

I have a piece of code written in 2 different ways, one a web service and another a WCF client which are trying to access an external 3rd party URL.

The same code when written as an exe works fine, i see my submissions on the 3rd party site, while the web code does not work.

I installed Fiddler to check traffic and to my surprise the web code works when Fiddler is capturing traffic, As soon as I stop Fiddler my code does not work.

For the web service code I get error: The remote name could not be resolved:

For the WCF client I get error: There was no endpoint listening at <<3rd party URL>> that could accept the message. This is often caused by an incorrect address or SOAP action.

Am quite sure now that this is because of some network and/or proxy on my corporate network, but not able to figure out what it can be.

View 1 Replies

How To Return JSON In A Webservice

May 27, 2010

[code]....

What's wrong?

Edit: And what if I need to return {Message:'',Type:1} ?

Edit2: The answer for the last one is: I can return a Dictionary<string, string>

View 2 Replies

Any Webservice That Returns JSON?

May 11, 2010

Does anyone know of free webservice that returns a list in the form of JSON? I have searched many webservice sites but they all return xml. Geonames.org is not required.

View 3 Replies

JSON Webservice Response Compression In IIS 7?

Mar 20, 2010

I have trouble with JSON response compression. I look to response headers after uploading website to production server (Windows 2008, IIS 7) and found uncompressed response. Turning on "Enabled static compression" and ""Enable dynamic compression" in IIS control panel does not effect. ASPX pages was responsed gzipped, but webservice response uncompressed.

I looked to google, but no answer found about this trouble. Also, I try this [URL] way (and adding to web.config this module) - but this source is excellent working at development machine with ASP.NET development server (and have seven times response size reduced) and totally ignored at IIS7.

How I can apply gzip compression to json responses from my webservice?

View 2 Replies

Call External Json Webservice From C#?

Jan 15, 2010

I need to make a call to a json webservice from C# Asp.net. The service returns a json object and the json data that the webservice wants look like this:

"data" : "my data"

This is what I've come up with but I can't understand how I add the data to my request and send it and then parse the json data that I get back.

string data = "test";
Uri address = new Uri("http://localhost/Service.svc/json");
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(address);
request.Method = "POST";
request.ContentType = "application/json; charset=utf-8";
string postData = "{"data":"" + data + ""}";

How can I add my json data to my request and then parse the response?

View 1 Replies

Passing JSON Data To A Webservice?

Jul 8, 2010

I have two parameters (categoryName and categoryDescription) that I need to pass to the web service using JSON. I found the syntax to pass categoryName but have not been able to get the correct syntax to pass both parameters. Here is the code.

<script src="js/jquery-1.4.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {

[code]...

View 4 Replies

Vb.net - Passing Data To Webservice Using JSON?

Jun 22, 2010

I have successfully returned data from a ASP.Net webservice in JSON format (using a service method that required no parameters) but have struggled with making a webservice call that requires a parameter.

Webservice:

<WebMethod()> _
<ScriptMethod(ResponseFormat:=ResponseFormat.Json, UseHttpGet:=True)> _
Public Function TestWebService(ByVal Description As String) As Stock
Dim res As New Stock(Guid.NewGuid, Description)
Return res

[Code]....

View 1 Replies

JQuery :: Get Data From Databse Using Json With Webservice?

Dec 23, 2010

i want to get data from my database and dispaly it in my web page using json with webservicei'm going to post my code i create a webservice and add method which return string to get all data so my code like this

[Code]....

and in my page

[Code]....

View 6 Replies

Error While Accessing The JSON Webservice From Server?

Jan 19, 2011

I have a website where I am using the JSON webservice. I have uploaded my website on the server.

Problem:

When I try to access the webservice it gives me the error as shown in below screenshot. In the below screenshot MyServices is my webservice. MyServices.asmx is the name of the file that I am trying to access.

Troubleshooting that already has been done:

I tried cleaning the bin folder and rebuilding again. But it didnt work.

View 1 Replies

Cannot Upload A File To A Webservice And Get The Response In Json Format

Aug 10, 2010

I have a simple webservice that I would like to upload a file to. The problem is that I need the response in json.

Form my experience in order to get a response in Json my request has to have a content-type of 'application/json'. But ofcourse this cannot be the case with a file upload since the content type will have to be 'multipart/form-data'.

In my Json i want to return a value showing whether successful and a filename.

[code]...

View 3 Replies

JQuery UI Autocomplete WebService Source Returning JSON?

Nov 29, 2010

I have been trying for two months to get this code working, and I am close, but still confused. I want the JQuery UI Autocomplete function to call an web service which returns JSON data and display that data for selection, and on selection put the selected value into a hidden field.

There are several issues:

1) The autocomplete function is not firing
2) The source: "/AutoSuggest.asmx/DOTFind?" line throws an invalid object exception
3) The service requires two parameters: (string prefixText, int count) - count tells it how many records to return.
4) I am not at all certain that this code will accept JSON data that comes back from the service

Here is the code:

[code]....

View 4 Replies

Iphone - How To Create JSON Webservice In C# With Database Connectivity

Jan 3, 2011

How to create a JSON webservice in ASP.NET that connect to MS SQL Database and update/delete values from the database?

This webservice will eventually be used to communicate with iPhone SDK.

View 3 Replies

How To Send A Single Quote As Value In JSON Webservice Call

Feb 17, 2011

I'm trying to make a call to a JSON ASP.NET web service with .NET.

It is ok when I send " { county : 'whatever' } ", but I get a 500 Internal Server error if I try for example " { county : 'It's ok' } ".

[Code]....

I've found some posts with examples but I cannot make it work:

" { county : "whatever" } " and " { "county" : "whatever" } " also works.

But either of " { county : "It's ok" } ", " { county : "It's ok" } " or any other combination that contains a single quote in the variable work.

How can I send a single quote inside a JSON call?

View 2 Replies

JQuery :: Compute JSON In JTemplate In Webservice Manually?

Mar 31, 2011

I have a webservice which retrieves data from another external service. The data is already in JSON Format. So I retrieve it and set it to the return value (type: string) of my webservice. But according to firebug the webservice then encapsulates the provided JSON-Data with a backslash, e.g. it returns:

[Code]....

instead of

[Code]....

But the JSON provided by the external service is correct. So how could I provide the correct string to jTemplate from my Webservice?

View 4 Replies

AJAX :: How To Bind DataList Using JQuery Json And Webservice

Jun 27, 2012

I try lots. we can bind asp.net gridview many ways but datalist i not able to bind. How can I bind asp.net datalist using jquery/json and webservice.

View 1 Replies

Make A JQuery Ajax Call To A Webservice That Needs To Return JSON

Jun 19, 2010

Actually I am trying to learn jQuery Ajax calls to asp.Net webservices.

I have been trying to call the webmethod below:

[code]....

Do I need to serialize my object in some way before setting the 'data' attribute, so that I can call $.ajax() function?

View 2 Replies

Jquery - Iterate Through JSON Object List Provided By Webservice?

Nov 24, 2010

I have an ASP.NET webservice method that returns a generics list (List'<'Construct>) serialized as JSON, using code such as this:

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ScriptService]
public class TestService : System.Web.Services.WebService {
[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public string GetOccupationListJSON(int SOCLevel)
{
Construct NewConstructList = new ConstructList();
DataContractJsonSerializer serializer = new DataContractJsonSerializer(ConstructList.GetType());
MemoryStream ms = new MemoryStream();

[Code]....

I assumed (from looking elsewhere) that accessing the JSON data through the index would provide me with access to the underlying object at that index, so that I can then work with it to access its properties.
However, when i=0 and I do var Construct = data[i]; I get the character at the i position of the data array ([), and in the next iteration I get the second character ({). So clearly I am accessing the elements of a string array rather than the JSON data object.How do I make sure that the data returned by the webservice gets into proper JSON format, so that I can iterate through the object elements within it?

View 1 Replies

JQuery :: Sending Large Data From Json Based Webservice?

Mar 11, 2011

i am using combination of jquery and JSON based webservice in most of projets. Lately i am facing this problem. if the data returned from webservice is huge ajax call from jquery fails. yup i know i can implement paging etc etc but is there a way i can increase the limit to get more data from webservice with jquery ajax call?

View 2 Replies

WCF / ASMX :: Convert Webservice Xml Response To Object Dynamically Using JSON?

May 10, 2010

convert webservice xml response to object dynamically using JSON

View 1 Replies

Webservice And Two "parallel" Requests From Client

Nov 5, 2010

I have such a problem. Suppose we have a client (WinForms app), which invokes some methods from webservice. Every 5 minutes (Interval of Timer) I invoke asynchronously webmethod A. Suppose that time of its execution take a 1 minute. When this operation runs, I open some Window, and invokes webmethod B synchronously... or i try to do it. Application suspended, wait until webmethod A ends, then process webmethod B (or I have an exception - Connection was closed, or Timeout...). Is there any possibility to run this A, B webmethods 'parallel'?

View 1 Replies







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