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
Similar Messages:
Aug 5, 2010
I have my iPhone app that calls an ASP.NET Webservice to download "data". Most of this needs to be protected, but currently the webservice that's deployed can be called by anyone who can figure out its URL, thus resulting in a complete loss of security.
The simplest form that I can think of would be for the phone to make a call over HTTPS including the username, password that the user logs in with, with every web service all. And each method will check to see if these credentials are correct before sending data to the user.
But this will result in an additional database call for every request to check if the user is authenticated, which is not very efficient.
View 2 Replies
Jan 31, 2011
I'm just starting development on a new website and am trying to do it correctly, that is, with a DAL and not with queries in code which I had before. I understand the principles of it all, but I am finding this DAL with table adapters and wizards that do too much to be really messy to work with. Does anyone have any recommendations on what I should be using instead and a link to a tutorial on how to get going quickly with it?
View 5 Replies
Sep 2, 2010
Can we perform Database connectivity without using ado.net?
Can we create our own architecture to connect to database?
View 4 Replies
Jun 29, 2010
I have MS SQL Server2005 enterprise edition. And MS VS.NET 2008. And have IIS 5.0 (which is available in XP professional). Now I want to run .net web application in our intranet (LAN). But I can't access database. Only static pages remain ok....but can't invoke database
View 16 Replies
Feb 14, 2011
I have Visual Studio.When a create a new ASP website (so not a project), I can go to the configuration management and enable roles and an aspnetdb.mdf is automatically created in the app_data directory.When I create a new ASP (MVC 3) project, the configuration management says: can not load MvcApplication1.MvcApplication .Is there some configuration setting for this?
View 3 Replies
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
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
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
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
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
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
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
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
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
Mar 10, 2011
How to create application for iphone and mobile web application in asp.net?
View 5 Replies
Dec 24, 2010
I want to create a native app/web app which works on iPhone, iPad. I am having Visual Studio with me. how to create a app using .net.
View 1 Replies
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
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
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
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
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
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
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
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