Skip to main content

Microsoft Silverlight

Debug WebServiceRSS Feed

(0)

NickyM
NickyM

Member

Member

10 points

8 Posts

Debug WebService

When i start debug Silverlight project with reference on web service, visual studio return message:

This Silverlight project you are about to debug is consuming web services. Calls to the web service will fail unless the project is executed in the context of the web which contains the web service. 

What this mean?


Second question
How i debug web service in my silverlight project?
 

NickyM
NickyM

Member

Member

10 points

8 Posts

Re: Debug WebService

I call webservice. The row in autogenerate reference file

object[] results = this.Invoke("...", new System.Windows.Browser.Net.SoapHttpClientProtocol.ServiceParameter[0], typeof(string));

return error

Cross domain calls are not supported by BrowserHttpWebRequest.

What this mean? What i was doing wrong?
 

samsp
samsp

Member

Member

282 points

96 Posts

Microsoft

Re: Debug WebService

welcome to the wonderful world of browser security models. The alpha of silverlight will only allow requests to web services that have the same base url as the page that delivered the application. This is becuase its using the browser http stack to make the calls, which includes any cookies or trust based on your identity. This is to stop the app from making unexpected web service calls to services such as your stock broker, or internal sites that you didn't expect or know about.

So the error is saying you need to host the silverlight app on the same base url (dns name I think) as the web service.

NickyM
NickyM

Member

Member

10 points

8 Posts

Re: Debug WebService

I have this error when i run application in Visual Studio on localhost.

Bye

Nicky 

samsp
samsp

Member

Member

282 points

96 Posts

Microsoft

Re: Debug WebService

Make sure that the silverlight app is loaded into the browser from http://localhost rather than as a filepath.

klausur
klausur

Member

Member

2 points

1 Posts

Re: Debug WebService

samsp:
Make sure that the silverlight app is loaded into the browser from http://localhost rather than as a filepath.
 

So how can I do this? My VS always starts the Silverlight Project directly from the filepath and I don't know how to switch this to http://localhost.

andy.wang
andy.wang

Member

Member

104 points

58 Posts

Re: Re: Debug WebService

You can create a webapplication and then add silverlight project as its link.

add webservice in silverlight project,..

aaakshay
aaakshay

Member

Member

5 points

2 Posts

Re: Re: Debug WebService

Web application project does not allow to add Silver light project reference.

kostkac
kostkac

Member

Member

4 points

2 Posts

Re: Re: Re: Debug WebService

I tried to debug from local filesystem - default setting for silverlight project - id browser addres bar is path from hdd.

 

After this failed, because a crossdomain policy not set i have tried to add silverlight xap file to default.aspx in WebSite project. Webservice is called fine here, but i cant debuging silverlight.

 

Have you got any idea? Thanks!

 

 

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities