How to use SOAP Services in PCL for Xamarin? - xamarin

I'm currently working on Xamarin.Android and xamarin.iOS project using mvvmcross.Now i have to consume Soap service via PCL? How can I do that ?I have read in few tutorials that you have to generate the Proxy class manually. Please let me know the feasible approach for this question.Also if there is any other way around.

If you do not target Windows Phone 8.1 (which doesn't support SOAP out-of-the-box), you can just right click References in your PCL project and Add a new service reference. It will generate the proxies automatically as it would in a classic .NET project.

Related

New REST API Client option in Visual Studio Mac?

I need to generate the swagger client SDK for my rest api in .net core project. The option "New REST API Client" is not in the context menu for the project under Add. How do I get it (or otherwise generate the SDK for my project so I can write simple tests)?
Currently, generate new REST API client option is not available for .NET Core projects. You can use tools like NSwagStudio or autorest or Open API Generator to generate clients.

How can I create a REST API client for a Windows Runtime project in Visual Studio / by external tools?

In Visual Studio for .net projects I can use built in tools to generate API clients by swagger. It simply and works great.
This option is missing from Windows Runtime projects as well, like Windows 10 IOT ones.
What is the best way to create API clients by swagger for this? If there is no built in tool / extension for VS, any external tools are highly appriciated.
Thanks a lot!
I don't get your question completely; on Windows IOT Core you can run UWP (background) apps; they are compatible with .net framework and .net standard up to version 1.4. This should work with a generated client from swagger.
Also you can use Refit to create a REST client according to best practices based upon an interface with attribute decorations.

Access an ASMX Service Reference in Universal Windows Apps

Can somebody help me with a little issue about Universal Windows Apps?
I'm trying to develop a small universal app that calls an .asmx web service. I can add the Service Reference successfully to the Windows 8.1 project and reference it from the classes in the shared project. When I compile and run the application, it runs without problem.
But when I switch to Windows Phone 8.1, I'm unable to compile and I get an error telling me that the classes generated by the service reference in the Windows 8.1 Project are not accessible from the Shared Project.
Does anyone know how to solve this?
FInally I solved this unanswered question. It seems in Universal Windows Apps is not possible to use SOAP Web Services as Service References, so I used REST Services instead.

XE2 FireMonkey - connect to a Web Service in iOS app

I have created an XE2 FireMonkey application which needs to run on an iPad. I am familiar with exporting to XCode and recompiling on the Mac machine. This all works quite fine.
The problem however is when I want to connect to an existing web service. Using the WSDL Import, I can create the necessary file and the functionality from my web service works as expected. This only works in a Windows environment though as the file created by the WSDL Import uses the "InvokeRegistry" which is Windows specific.
How can I connect to a web service in FireMonkey in a way which will compile on XCode and work in an iOS environment?
The Web Service Toolkit of Free Pascal is one option. According to this forum post, iOS can be used as target platform.
The toolkit includes a WSDL importer wizard, also available as command line tool ("ws_helper").
"Web Service Toolkit” is a web services package for FPC, Lazarus and
Delphi; “Web Service Toolkit” is meant to ease web services
consumption and creation by FPC, Lazarus and Delphi users.
It seems that one cannot have data connectivity in mobile iOS applications without various forms of "hacking" code. There is currently no standard way with the XE2 framework to support this.
See: http://edn.embarcadero.com/article/41729
XE5 has major improvements and data connectivity is now easily handled via DataSnap. One can easily reference existing web services via a DataSnap server, so the issues I originally had are now solved.

Setting up facebook API using Visual Studio

I am newbie in developing and learning to develop windows 7 phone application. I was trying to run the sample code for Graph API of facebook on https://github.com/facebook/csharp-sdk the compilation of facebook API was successful but when I try to run the example code given, it gives me error "Type or namespace name 'facebook ' could not be found. I have added facebook.dll in the project references
can anyone tell me the exact procedure to follow please ?
thanks
Humm the dll was compiled for which type and version of .NET ? If it's a "desktop" .NET 3.5/4 project, you can't use it directly in your WP7 project.
You need to create a new Class Library Winows Phone 7 Project (Facebook.WP7 for example) and add the existing source files from Github to it. And now you can reference this project in your WP7 project.
Which Facebook.dll you referenced in your project??? There is separate one for WP7 and Desktop version of the kit.

Resources