Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Windows Phone 7
Message
 
To
04/04/2011 08:58:34
John Baird
Coatesville, Pennsylvania, United States
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Miscellaneous
Thread ID:
01505974
Message ID:
01506008
Views:
55
Hi John. Viv . Thanks for replying.
I understand the Data bit... I can work around this.

Its the bit of trying to just Consume the Web Service. I copied the Code Verbatim from My Asp.net Click event of a button and expected it to work.

Yes, I have added the Service Reference added in , but when I try to use
Service se = new Service().... it seems to take this from System.Web and I cant add this in in the Usng section

...Should the Phone version be able to consume the Web Service with th eexact same code as in the We App Vesion
( The WebService itself is a Service I created in Visual Studio and does not require any Login )

Regards,
Gerard


>>Hi.
>>I have following code on a c# Web Site which consumes a We Service that I created in Vis Studio (works fine from a Web App)
>> Service se = new Service();
>> DataSet ds = new DataSet();
>> ds = se.GetDebtorsBalances(searchString.Text.Trim());
>> Session.Add("DataSet1", ds);
>>(This seems to be using rhe System.Web namespace)
>>
>>Now when I try to do the same on a Windows Phone 7 Web App, I get all soerts of errors and cannot use System.WEB (Which allows mw to use the first line: Service se = new Service()
>>
>>Is there some restictio on jusing thios for a WP7 app, and if so is there a way around it ?
>>
>>I am trying to replicate exactly what I have workong on a standard WEB APP to consume a Web Service and to be able to run this from a WM7 app.
>>
>>TIA
>>Gerard
>
>
>Ditto what Viv said, you can't use any system.data with WP7 and silverlight. You must use xml serialization to pass the data back and then place it into, preferably, ObservableCollections to consume it within the phone.
>
>I'm assuming that you have added the service reference to your phone project and connected somewhat like this:
>
>
>      public void Login()
>        {
>            this.EnableProgressBar(true, "logging in...");
>
>            if (this.CanLogin())
>            {
>                Client = new NetVillageServiceContractClient("BasicHttpBinding_INetVillageServiceContract");
>                Client.ProcessCommandCompleted += client_LoginProcessCommandCompleted;
>
>                CommandObject command = new CommandObject();
>                command.CommandType = CommandType.Chat;
>                command.SubCommandType = SubCommandType.Login;
>
>                UserObject.Handle = this.Handle;
>                UserObject.Password = this.LoginPassword;
>                UserObject.VerifyCode = this.VerifyCode;
>                command.Parameters = UserObject;
>                Client.ProcessCommandAsync(command);
>            }
>            else
>            {
>                this.EnableProgressBar(false);
>                MessageBox.Show(_errorMessage, "Please Note!", MessageBoxButton.OK);
>            }
>        }
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform