calling JSON Service from Objective C with MULTIPLE parameters - ios

I've found code samples for calling a JSON service, but I'm not sure how to add multiple parameters. Could somebody help me out?
My JSON Service is a .NET WCF service SearchTalent(talentName, agentName, agencyName)

I think you will need to find out the URL's of the service, not the .Net representation of the service.
I'd suggest you use Restkit to interface with the service once you know the urls. You might want to look into that.

Related

Data fetch using OData API in ios

I an new in iPhone.Currently i am working on OData based web service. But i am little confusing with how to call webservice and getting response with OData.I have below information with me.
The metadata of this service is located at :
http://enumbler.azurewebsites.net/odata/$metadata
and Base url is :: http://enumbler.azurewebsites.net/odata/User
Can anyone help me to solve this?
Thanks in advance.
I'm not familiar with IOS, but I may help with common way to consume OData services. Take one OData sample service TripPin, if you want to get all airlines, you can simple calling http://services.odata.org/V4/TripPinService/Airlines. The response is in JSON payload, you can consume this either directly dealing with JSON or use some OData client libraries for IOS. One difference your service and the sample service has may be that TripPin is OData V4 and your service is OData V3. Maybe your service doesn't support JSON but ATOM payload, but you can deal with either way I mentioned above. For more detailed information of OData, you can go directly to OData.org. Hope I helped you with part of your problem.

Wsdl Parsing in ios

Can any one help me how to consume WCF services in an iPhone application?
I am searching it desperately. I have also installed the wsdl2objc from http://code.google.com/p/wsdl2objc/. but still I am not getting any clue that How can I use it to worth get the correct responce.
Please get me out of this trouble...I need the right solution!!
Thanks.
If you are about to use the SOAP services than my advice is don't.....because for SOAP services you may able to construct the base classes using http://code.google.com/p/wsdl2objc/ but the response you will get from the service will give the references and the whole data structures along with response and you can't parse the response.
You can use this wonderful framework called CSOAP

Using a web service in an iOS app

How might I go about using a web service in an iPhone app? For example, if I wanted to use a web service that you can use to convert a value into a different unit, how would I go about doing that? For example: http://www.webqc.org/balance.php
It depends what sort of 'web service' it is. If it is a stateless REST style API, passing data in the URL and/or data encoded Json or XML it couldn't be easier, just use NSURLConnection.
Using examples I found on the web I made an application (server and iOS client) - using the NSURLConnection & NSMutableURLRequest, and encoded/decoded data using YAJL. This was pretty easy to get going.
If you don't want to do this using the core libraries directly- there are some frameworks you can use, e.g. RestKit. I've not used it, but it looks good and comes recommended.
If it is a SOAP style web service, this is a lot more complicated as SOAP services often expose a stateful API.
I should say that the example that you show here is not a web-service, whilst it does come with a way of calling it just using a URL - it returns an html page which makes it hard for you to use the results. I presume that you are more interested in a service that returns results encoded as XML or Json or the like.

mvc return Json() vs. JSON based Web Service

I want to expose a service on my site that any users can call and get a JSON response. In the end, I want the users to be using this service as much as possible.
My site is created using the asp.net MVC framework and i was wondering whats the best way to do this...
I think most would say it's obvious to use a web service (*.asmx) that returns JSON format, but i know that I can just create a url that users can call and have it return JSON format as well (e.g: calling "http://mysite.com/GetList" would return JSON list). In asp.net, using the return Json() method.
What are the advantages/disadvantages doing it this way vs. a Web Service which is specifically intended for this ?
I don't know that most would say use a .asmx web service. Personally I haven't made a .asmx web service in a while and I would go for the MVC approach. The only things I'd be worried about would be:
future changes to the data, url, and/or parameters passed in.
Making the controller too big or cluttered, in which case you could create a separate API controller.
To me the advantages are that it's more consistent with the rest of your app, it's simple and easy to work with, and there's not much to configure.
A web service would expose a WSDL.

Calling Windows Service from a Web Service

I am using .Net 2.0 framework and would like to call a function in Windows service from a web service. Is this possible? And If yes, how much control I will have over the function i.e passing parameters, getting the result back etc. Any ideas would be greatly appreciated :)
Remoting is your best option if you need to pass parameter values.
If you don't need to share objects or anything too complex, ServiceController is probably easier.
You can do it through .NET remoting. If you go that route, it will appear you are calling a method and getting a result, but all your parameters will be serialized over the wire, and the result will be serialized back. Therefore, everything must be made serializable.
How about hosting a WCF service inside of the Windows Service. You can use net.tcp or named pipes to communicate between "your" web service and the one in the Windows Service. You can use the NetDataContractSerializer for serialization with type fidelity.
You could implement a basic http server that maps certain requests to functions. Query-string will be mapped to parameters. Actually not hard and I have done this in the past (as I provided some rudimentary template-based reporting). It wasn't dynamically, but it could be done dynamically. Look at HttpListener for a starting point. You could as well host the asp.net engine in it.
It has it advantages and disadvantages.
Why not package the function in its own DLL then distribute it with the Windows Service and the Web Service separately?
Create service project what export an interface COM or use PIPE to transfer data.
View this Interprocess Communication using Named Pipes in C#

Resources