Consume a soapy web service with Xamarin.Forms

I am using Xamarin Studio for Windows to make an Android application (Portable Xamarin.Forms project). I am trying to use the web service using the guide on this page: http://developer.xamarin.com/guides/cross-platform/application_fundamentals/web_services/ in the section "Consuming SOAP Services".

However, I cannot get it to work at all. I can generate a proxy server successfully (using this public url: http://wsf.cdyne.com/WeatherWS/Weather.asmx for testing purposes). A new file is created called "Reference.cs".

But the Reference.cs file generates several compilation errors:

Error CS0234: The type or namespace name "IExtensibleDataObject" does not exist in the namespace "System.Runtime.Serialization" (do you miss the assembly reference?) (CS0234) (XamarinFormsTutorial)

.. and 41 more (all CS0234)

Has anyone understood what is going on?

+5
source share
3 answers

I recently had to implement a cross-platform application using webservice asmx.

My solution was to use the web service in both projects (Android and IOS). In a common project, I used:

#if __ANDROID__ using "namespace droid webservice"; #endif #if __IOS__ using "namespace ios webservice"; #endif 

In the code, it was enough to create a new instance of the web service.

+1
source

Could you use this service? Use the HttpClient and post stringcontent containing SoapAction, and request asmx and parse response. Try creating a C # console application and add this service as a link, then use a violinist to check the request and response. and use the same query in ur xamarin app

0
source

I would suggest creating a proxy server using the slsvc utility, and then try to use the SOAP service in your application. This worked in my case, it was possible to delete all all t

0
source

Source: https://habr.com/ru/post/1212734/


All Articles