Is it possible to use a web service created as "ASP.NET web service application" in my windows phone 7 app?

I tired referencing it as follows after adding a service reference: Dim MyService As ServiceReference1.TrialService = New ServiceReference1.TrialService

However I got this error: "Type 'ServiceReference1.TrialService' is not defined."

This is the way i reference from my smart device application and it works, any idea how to do it in a windows phone 7 app?

有帮助吗?

解决方案

For others to benefit: what i replaced that definition with is this:

    Dim MyService As ServiceReference1.TrialServiceSoapClient = New ServiceReference1.TrialServiceSoapClient()

That worked and I was able to call the methods in the web service successfully

其他提示

yes you can. You have to add service reference by right clicking service reference and then click on discover button and then select your service.then reference is added to your project. then you can use it.

After the service reference has been added to the solution make sure you import the namespace onto the page.

C#

using ServiceReference1;

VB

Imports ServiceReference1

Please let me know if that solves your problem.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top