문제

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