Getting a web service and using android to consume them? - c#

I have been looking up on youtube regarding Web Services being consume using android. Most of the video are all 1 or 2 years old. Is this doing outdated? is there a better way to do this? currently i am in a company and i was assign to have a android version of their webservice.
I was told to create the service with sql using Visual studio.
Create the android UI and using the services to pull the data.
Am i doing it right?
What is the better or ideal way of going about this?
Should i add JavaScript or something like that?
I have been looking at RESTful , Soap , Json and Wcf. But what is the best way to go if i have to start everything from scratch?
-Programs/System that i am using.
Microsoft Visual Studio Express 2013 for Web
SQL server
IIS express
Android Studio
*I was told to only user framework 4.0 for Visual studio

You can use WCF (SOAP), WCF (RESTful) or WebApi to create a service, both has it's own advantages and disadvantages. You may want to take some time to look at your requirement and then decide what type of service you want to develop. SOAP uses a more complicated messaging pattern using XML, where as REST uses the standard HTTP protocol and methods to communicate and transfer data. But if you are planning consume this service across of variety of applications like mobile, web, desktop, client side script interaction etc, you may consider developing the service as a RESTful. More information on SOAP and RESTful and for detailed understanding you may refer to this link
Understanding SOAP and RESTful

Related

Can i use WCF Services to develop a Distributed System(as middleware)

i am new to visual studio, and i developing a distributed system with visual studio, i'm developing two applications
windows forum application c#
Web application asp.net
so i using WCF Services to make this system distributed, is is right?
in web application im using a WCF Services to Login and insert data and retrive data.
In your situation, i can say WCF would be fine. But in future if you are planning to support your application on devices like smartphones/tablets then Web API would be better choice.
But its totally depend on the situation. You will get more info on the following link:
http://www.dotnettricks.com/learn/webapi/difference-between-wcf-and-web-api-and-wcf-rest-and-web-service
Hope this will help you to choose appropriate option for your application.

Build JSON REST api/webservices in vs2010 or vs2012 that will consumed by ajax clients in mobile devices

I have an Existing Web application builded two years ago with VS2010 ASP.NET Web Forms, C# and SQL SERVER 2008 .Now i want to build mobile version and install it in mobile devices. I want to develop it using JQuery Ajax, Jquery Mobile and Apache Cordova. My simple question is how can build serialize from database json REST api/webservices in vs2010 or vs2012 that will consumed by ajax clients in mobile devices ???
Thanks to all
I would recommend you for WebAPI. because of following reasons.
If we need a Web Service and don’t need SOAP, then ASP.Net Web API is best choice.
It is Used to build simple, non-SOAP-based HTTP Services on top of existing WCF message pipeline.
It doesn't have tedious and extensive configuration like WCF REST service.
Simple service creation with Web API. With WCF REST Services, service creation is difficult.
It is only based on HTTP and easy to define, expose and consume in a REST-ful way.
It is light weight architecture and good for devices which have limited bandwidth like smart phones.
It is open source.
Tutorial is here.
http://channel9.msdn.com/Events/Build/2014/3-603
Save yourself a lot of coding, and use SlashDB. http://www.slashdb.com/how-it-works/
It will automatically make a web API for an existing database. Your case is very typical because many websites use server-side templates to make dynamic HTML, which of course does not work well if you need a native app or a highly responsive HTML5 mobile page.
Disclosure: I am the founder and CEO of the company behind SlashDB, but you don't have to take my word it - just try it.

Consuming IIS-hosted WCF Service from Linux Web Application

I was tasked at work to create a web application (viewable in Firefox on Linux!) that displays results in a tabular format using data exposed by a WCF service (written in C#) hosted on a separate Windows 7 machine on the same network. Rather than returning formatted HTML, the WCF service returns structs and it will be up to the client application to take these objects, pull out the data, and format it.
Unfortunately, it has been a couple years since I have worked with any sort of web technologies. What is the best approach to solve this problem? Is there anything more current than REST/AJAX/JSON/jQuery technologies? If anyone can point out some helpful and current resources on the proper way to accomplish this, it would be most appreciated.
Use a SOAP framework to consume the WCF service. Configure WCF to use SOAP (one of the HTTP-bindings).
Webservices are easy to consume these days thanks to a standard RPC format (SOAP) and libraries supporting it. You can surely find a SOAP client for any language you are proficient in.
Checking back in here to report my own solution for this problem. I ended up going a bit of a different route that produced the simplest solution for the situation. Instead of consuming any services on the Linux side, I simply made an ASP.NET website on the Windows/IIS side (where it is easy to consume the WCF services right from Visual Studio), and then just render the website on the Linux side via the URL in a Firefox browser. For me, that fulfilled the customer requirements and was perfect, although this may not be the best approach for others that need to work with or manipulate the data in some way.

adding a WCF to existing website or have a new service?

I am a total newbie to the WCF world. I have an ASP.net (v4) website running on our dedicated windows 2008 server box. I'll refer to the website as, webisteA.com
I'm creating a new website, websiteB.com.au and I'd like to expose the functionality in WebsiteA.com to the new site. Things like logging in, registering in the database etc.
I think the best way to do this is to create a WCF service which sits in WebsiteA.com - but I am struggling to find any tutorials on how to do this. There are lots about creating a new project, but not that many about adding a WCF service to existing websites.
Is this the best way to do it? In the future I'd also like to use the service for mobile apps in the future too - not sure if that will make a difference.
OR - do I create a new service in a new app which is totally seperate to websiteA.com and websiteB.com and host this as website0.com and expose the database via that?
The questions I don't have answers for are...
is it restful? Do I use XML or JSON?
Baiscally, I want to be able to use it like an API - for example, saying "show me all the members who meet criteria X".
Thanks for any information.
ps) I have visual studio express 2010 c# (and a trial of studio pro)
You can certainly include WCF within the website A project - but have you considered the ASP.NET Web API? I haven't used it yet - but did use the earlier WCF Web API which spawned it.
Neat features include Content Negotiation (if the client asks for XML the API sends XML. If it asks for JSON is gets JSON) and a lot less config cruft (WCF web.configs are dreadful and completely overcomplicated IMO)
It's probably a lot easier to make a RESTy API with the ASP.NET Web API than with standard WCF.
A great open-source .NET solution is NancyFX which is really worth a look too.

What web service to implement so it's easy to read from an iphone application?

I want to develop a web service that will enable me to synchronize the databases of my iphone app with a main database.
I will be using c# to write this web service. What kind of web service should I write, and how should it look like for it to be easy to call from the iphone application?
To answer the comment question: I think would prefer XML
REST webservice with JSON. It will be easier to read from iphone app. iPhone interaction with ASP.NET WebService
Also see this for tutorial http://www.codeproject.com/KB/webservices/RestWebService.aspx
You can't go wrong with WCF.
It's recommended by microsoft for all web services (outside the MVC world) and supports many different scenarios and interop. For an easier (but more fragile and less versatile) solution you would go with an aspx -> asmx service but I wouldn't recommend it.
Used RESTful WCF as a web service see this: WCF REST Service JSON Post data
and this: http://www.codeproject.com/KB/WCF/RestServiceAPI.aspx?q=wcf+rest+web+service+example
Also used JSON instead of XML tutorial here: http://www.raywenderlich.com/5492/working-with-json-in-ios-5
Also used NSURLConnection but haven't found one very good tutorial yet.

Categories

Resources