5
votes

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

However, I can't seem to make it work at all. I can generate the proxy successfully(using this public url: http://wsf.cdyne.com/WeatherWS/Weather.asmx for testing purposes). A new file called "Reference.cs" is generated.

But the file Reference.cs generates several compile errors:

Error CS0234: The type or namespace name 'IExtensibleDataObject' does not exist in the namespace 'System.Runtime.Serialization' (are you missing an assembly reference?) (CS0234) (XamarinFormsTutorial)

.. and 41 others(all CS0234)

Anybody got an idea what is going on?

3
@Michael can you please help me how to build the same process with the visual studio - Manoj

3 Answers

1
votes

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

My solution was to consume the web service in both projects (Android and IOS). In the shared 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 webservice.

0
votes

Were you able to consume the service ? Use HttpClient and post stringcontent containing SoapAction and request to the asmx, and parse response. Try creating a c# console app and add this service as reference, then use fiddler to check the request and response. and use the same request in ur Xamarin app

0
votes

I would suggest to generate the proxy via using slsvc tool and then try to consume the SOAP service in your app.This worked in my case was able to remove all the all t