Hey Demis,

I took your advice and went the WCF path… seems a much better way to do things.

I still have a problem though…

I created a VERY simple service at 
http://hotdogs.infocore.com.au/hotdogs/Service1.svc, it works fine in VS 2010 
but doesn’t work in MT, I have just exhausted my limited knowledge on trying to 
figure it out, with no success…

I added it as a WCF web reference called hdService and then have the following:

hdService.ServiceClient client = new hdService.ServiceClient();
Console.Writeline(client.Greeting”Dean”));

But it doesn’t run, keeps stopping with “Object reference not set to an 
instance of an object” also referencing the System.ServiceModel.ChannelFactory, 
whatever that is ☺

I don’t know if it me, MT, the service or what…

I’ll leave the service running, can someone try and consume it and tell me if 
it works? Or tell me what I am missing / doing wrong?

Thanks!
Dean



From: Demis Bellot [mailto:[email protected]]
Sent: Tuesday, 23 August 2011 12:03 AM
To: Dean Harry
Cc: [email protected]
Subject: Re: [MonoTouch] Web Services

Hey Dean,

Apart from the technical limitations, coupling your web services with your 
RDBMS is generally considered bad practice. (Although I'd also argue that due 
to its inefficiency, using SOAP in your resource constrained MonoTouch app 
should also be avoided).

Why don't you just go the normal route and wrap your DB logic inside a standard 
.asmx web service? though my preference would be to avoid SOAP entirely and 
just use one of the many REST service frameworks available in .NET.

If performance ever becomes a problem you can also try using my 
http://servicestack.net web service framework, where the JSON and JSV endpoints 
are multiple times more efficient than SOAP web services.

D.B
Sent from my iPad

On 22 Aug 2011, at 03:32, Dean Harry 
<[email protected]<mailto:[email protected]>> wrote:
Ok so I found my problem is a bug 
(https://bugzilla.novell.com/show_bug.cgi?id=670956)

So I changed the  SqlXml class of the Reference.cs file to read, as the poster 
mentioned at the bottom of the bug report:

   public partial class SqlXml {
        [System.Xml.Serialization.XmlAnyElement(Namespace="Any")]
        [System.Xml.Serialization.XmlAnyElement(Name="Any")]
        [System.Xml.Serialization.XmlTextAttribute()]
        public System.Xml.XmlNode Any;
    }
But that still doesn’t work… has anyone been able to get this to work?  I’m 
getting desperate…

Cheers,
Dean



From: 
[email protected]<mailto:[email protected]> 
[mailto:[email protected]] On Behalf Of Dean Harry
Sent: Sunday, 21 August 2011 1:13 PM
To: [email protected]<mailto:[email protected]>
Subject: [MonoTouch] Web Services

Hi All,

I am having a web service problem I can’t figure out…

I have a web service on my MSSQL server with a web method on it…

The following works fine in VS.NET<http://VS.NET> but doesn’t work in Mono, now 
I am using 2.8a but I wouldn’t have thought that anything would have changed in 
the web services side…

The code is:

GetMeets service = new GetMeets();
Service.Credentials = new NetworkCredentials(“username”,”password”);

It fails on the first line with:

“There was an error reflecting type ‘…..SqlXml’. Looking at the InnerException 
is shows “There was an error reflecting field ‘Any’…. The elemeny Any has been 
attributed with an XmlAnyElementAttribute and a namespace, but no name.

Has anyone come across this before?

Cheers,
Dean

_______________________________________________
MonoTouch mailing list
[email protected]<mailto:[email protected]>
http://lists.ximian.com/mailman/listinfo/monotouch
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to