Can i call a web service from FireMonkey for iOS? - ios

I'm new to iOS, have been developing in Delphi for many years.
I don't know FPC well and i find it very hard to figure out which classes are available on iOS.
is there any FireMonkey classes for calling web services and parsing xml?

Yes you can call a webservice :)
No it is not simple :(
You need to access the iOS framework directly...
The following code fragments will help...
First a pascal example of how to send/receive data via TCP
https://forums.embarcadero.com/thread.jspa?messageID=397346
Secondly, you will need to wrap the call using the relevant headers. See...
http://books.google.com.au/books?id=0nTYIL3-0yoC&pg=PT518&lpg=PT518&dq=beginning+ipad+development+webservices&source=bl&ots=cYniLvL8z2&sig=Ci6HskHgMvUeIrjyUbDecd7fBCQ&hl=en&ei=0_KdTpzBB4nOrQfwzM29CQ&sa=X&oi=book_result&ct=result&resnum=6&ved=0CEAQ6AEwBQ#v=onepage&q&f=true
It is a fair bit of work, but it can be done. Good luck!

You can also try to use RealThinClient (RTC) SDK to allow your Delphi XE2 FireMonkey iOS client to connect to a RTC SDK server. Not SOAP, but I've managed to send data back and forth between the two layers (just in case you do not have to use SOAP, but are merely looking for some way to connect an iOS client to a server)...

Related

Send data to windows from iphone using Xamarin

I'm trying to write an IOS app using Xamarin that sends data to PC using TCP. I want it to do this with Cable or WiFi. I have been researching around the net for sometime now. But couldn't find any good tutorials. I'am aware that I should be using NSNet and Bonjour Windows SDK but I couldn't find anything more than that. Any suggestions or directions on how to achieve this would be very helpful. Thanks in advance.
If you are using Xamarin then the more preferred choice would be to write things using System.Net.Sockets namespace. This way you can reuse the code with other C# clients, including Android (if needed).
Plenty of examples on TcpClient/TcpServer.
https://msdn.microsoft.com/en-us/library/vstudio/system.net.sockets.tcpclient(v=vs.110).aspx

Possible to create a zeroconf service with Delphi XE5?

Working on an appliance and would like to support zero configuration feature. That way users can look for the device on the network and simply double click an icon to access the web interface without having to configure it or know its ip address.
Tried to use UPNPLib_TLB but functions seem to be read-only; am I right? I can create a device using CoUPnPDevice.Create but can't set a FriendlyName or a URL.
Tried to use Deltics Bonjour service but it crashes on create (ACCESS_VIOLATION). The demo code uses a custom test unit which complicates experimentation.
After much research it does not look like there is a component available for this and would appreciate some pointers. Has anyone successfully created a zeroconf broadcast either via UPnP or Bonjour with Delphi XE2/5.. I can go back to Delphi 7 if required. Target = Windows 7.
NOTE: To be clear, I can find existing devices on the network and don't want to enumerate existing devices but what I want is to broadcast my service so that my box behaves like a network printer for example. The only service I need to expose is the URL so that users can access an embedded web server.
Appreciate the help!
EDIT
With the tips provided I did some research and getting this done the RAD way is not possible.
Using MS APIs directly is time consuming and requires a level of understanding of C that I don't have. Porting the Delphi 5/Indy 7 component to XE2/5 will require a good amount of work and debugging.
I discovered UPnP developer tools from Intel now open source here: Developer Tools for UPnP. This tools makes it really simply to create a server in 10-15 lines of code. Intel provides a DLL that I can call from VS Express as follows and it works great:
device = UPnPDevice.CreateRootDevice();
device.FriendlyName = 'My name';
device.PresentationURL = 'URLToEmbeddedServer";
..
I tried to use headconv7 tool to convert the .h file Intel's UPNP.DLL to a pascal file and call the external functions within the DLL directly from Delphi but there were too many problems with the conversion.
It's too bad because the Intel library makes it really simple to create UPnP stacks and the approach would apply itself very well to a component but for now its quicker to use .NET and VS Express to get the job done.
When using UPNPLib_TLB, you are not supposed to create a UPnPDevice object directly. UPnpDevice describes a known device on the network, which is why its properties are read-only.
Read the documentation:
Control Point API
Finding Devices
You are supposed to create an instance of the UPnPDeviceFinder class instead. Its search methods will give you a UPnDevice object for each device that is found.

Consuming SOAP web services in iOS application in Firemonkey

I am new to iOS development with Delphi XE2 and Firemonkey and have a question how to consume SOAP web services from iOS application?
Is there any example for possible set of components involved to get the job done.
Thanks
Yes there is...
http://wiki.freepascal.org/Web_Service_Toolkit
Unfortunately I did not discover this until I had written the whole thing using the cocoa platform!

Delphi - loging all HTTP request

I need loging all HTTP request (from any application).
I have Delphi 7.0.
Anybody know how do that?
I looked into whether the Indy components could do this but found an old newsgroup response from Remy Lebeau that said:
If...you want to look at the traffic
that other applications are
generating, then no, you cannot use
Indy for that. That is outside the
scope of what Indy is designed for.
You would have to write your own NDIS
driver for that kind of capturing. Or
use a third-party sniffer API, such as
WinPCap.
What about WireShark?
There is also a product called Fiddler. I have found this extremely useful to track down exactly what the Indy components are sending/receiving. The one drawback is you have to utilize a proxy. This isn't a problem with Indy components and browsers such as Firefox. But if you need to capture for all applications you would need to be able to set a proxy for those apps.
if you want to go deeper and want pure delphi thing, there is winsock logger program floating around, google might help you ( it hooks winsock apis though).
Do you have to write a Delphi app to do it? Could you use an application like ethereal?

Delphi & SmartCards

Does anyone have experience integrating SmartCard authentication in their Win32 apps? If so, are there any preferred libraries?
Try SecureBlackbox, A component that works fine for me, a second choice can be
Delphi PC/SC SmartCard Component 0.91.
try
Well I guess that you have an SmartCard reader ... if so (and if you don't have one I don't know how you are going to manage this) then it must have some interface, RS232, USB, TCP/IP ... any one will do.
Communication protocol usually is available at SmartCard reader manufacturer. Few lines, and you will have it working in Delphi.
You need to read the developer manual that comes with reader you're going to use. It might only use PC-SC (by MS) to communicate, if so you can use the component specified by RRUZ, however it doesn't work with D2009. Otherwise you'll need to use API provided by SDK.

Resources