Skip to main content

Microsoft Silverlight

Answered Question Local HTTPHandlerRSS Feed

(0)

ricky_brundritt
ricky_br...

Member

Member

0 points

3 Posts

Local HTTPHandler

In the past I have created HTTPHandlers to create images that dynamically changed. What I would like to do is create these images on the client side rather than the server side. The only draw back is that I need to be able to access this local service via a query string as certain properties will need to be passed to this service. I was thinking that I could host the handler in the ClientBin but I'm not sure how easy this will be. Does anyone know of some good resources that show how I can do this?

Sergey.Lutay
Sergey.L...

Contributor

Contributor

7256 points

1,354 Posts

Re: Local HTTPHandler

Hi,

You can use handler as is. Use WebClient or WebRequest to make request to handler.

(If this has answered your question, please click on "mark as answer" on this post. Thank you!)

Blog

Twitter

Sincerely,
Sergey Lutay

ricky_brundritt
ricky_br...

Member

Member

0 points

3 Posts

Re: Local HTTPHandler

 That's close but that requires the web service to be on the server. I want to host the web service locally in the ClientBin. I want all the work that the web service would do to be done on the client side rather than on the server. My reason is that I'm expecting extremely high volume of traffic on the server and expect multiple calls to the web service from each client. If I have the web service on the client side then they only download the xap file when the page loads and all calls are made locally.

 

A bit more information: I'm using a pre-built control that takes in a query string and already retrieves the image. I'm aware of how to point the url to the client bin but need to figure out how to create the httpHandler in the xap.

Sergey.Lutay
Sergey.L...

Contributor

Contributor

7256 points

1,354 Posts

Re: Local HTTPHandler

You can't include handler in client application. It is a server side feature.

If you want generate images at client side look at Bitmap API, feature of Silverlight 3

(If this has answered your question, please click on "mark as answer" on this post. Thank you!)

Blog

Twitter

Sincerely,
Sergey Lutay

ricky_brundritt
ricky_br...

Member

Member

0 points

3 Posts

Re: Local HTTPHandler

 After some investigation I think this might suit my needs: http://pagebrooks.com/archive/2009/04/25/a-cool-trick-for-passing-data-to-a-silverlight-application.aspx

Now I just need to figure out what method this will call in my xap.

Jonathan Shen – MSFT
Jonathan...

All-Star

All-Star

24982 points

2,435 Posts

Microsoft
Answered Question

Re: Local HTTPHandler

Hi Ricky,

Application.Current.Host.Source.OriginalString and Application.Current.Host.InitParams are public static type.  We can call it everywhere in your silverlight application.  By the way, both HttpHandler and WebService work on sever side.  You'd better reference to Bitmap API.

Best regards,

Jonathan

Jonathan Shen
Microsoft Online Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities