Categories

Navigation

MVP

Microsoft MVP (since 2006) in the XNA/DirectX category

Tag cloud

Ajax (8) All (206) Arena Wars (21) Boo (4) BroodWar (8) Conferences (1) Development (44) Game Development (142) IronPython (3) Lost Squadron (17) Lua (6) meinSport.de (4) Other (150) Polynapping (12) Programming (156) Racing Game (7) Reviews (76) Rocket Commander (49) Silverlight (10) SQL (1) StudiHelp.de (2) XNA (40)

On this page

Silverlight and Web Services

Archive

Popular

NormalMapCompressor v1...
CR_Commenter v1.7 Upda...
Reminder: Rocket Comma...
Your Christmas Present...
CR_Commenter Update v1...
The year 2005 - Review...
Seattle Day 3 - XNA Pr...
NormalMapCompressor - ...
Zombie Quest - A new f...
Cool tools
My Bookmarks
CeBIT 2006 Pictures

Blogroll

Projects

Arena Wars (2004)

Rocket Commander (2006)

Pizza Commander (2006)

Rocket Racer (2006)

Coop Commander (2006)

Flower Commander (2006)

Fruit Commander (2006)

Euro Vernichter (2003)

Lost Squadron (2005)

Zombie Quest (very simple 2D Adventure, 2006)

Freifunk Hannover project (GoogleMaps support)

Older projects (2000 and earlier)

MeinSport.de - German Sport Community Site

About

About me: Contact

Send mail to the author(s) Email:

Total Posts: 213
This Year: 0
This Month: 0
This Week: 0
Comments: 434
Made with

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

RSS 2.0 | Atom 1.0 | CDF

My brothers

netfreak.de

mirkman.de

Sign In

 Friday, July 13, 2007
Friday, July 13, 2007 8:58:58 PM UTC (  |  |  |  )
Using a webservice in silverlight can be very problematic. It does not work out of the
box when you just add a web reference and try to use it. You will get a lot of
501 - Internal Server Errors, WebException - Error invoking service, etc.

Instead of repeating what so many people have already reported for Silverlight
and Web services I will just link to them and give you a small comment about
each link. My solution is below (it was something completely different than
the links I present here, but maybe I did not read all of them carefully).

Links:
  • Silverlight documentation about using remoting and webservices. Two solutions are presented, but the help is very short and if you have not done it before there can be many problems that are not discussed here. But this two ways are the standard solutions that almost everyone uses.
    http://www.silverlight.net/QuickStarts/Remote/default.aspx



  • I used another solution to put all websites, web services and silverlight projects onto my IIS 7 server in Vista x64, but I had troubles debugging them. I moved also to IIS because it was annoying to test the website with the fun crashes VS Orcas gives you from time to time and it also has the advantage to show a working version on your colleagues computers by pointing to your computer's IIS.





        In short this is what I had to do to get debugging and executing working for web sites and web services in IIS7 with VS Orcas:
  • Install IIS (Internet Information Services) first, you can find it in the Control Panel -> Programs/Features -> Turn Windows features on or off.
  • Open the IIS tree and select the Web Management Tools (just install all of them). Also make sure you install ASP.NET in World Wide Web Services/  Application Development Features, it will also select all the other required components.
  • Last but not least select the Basic, IP, URL and Windows Authentications in the Security tree below World Wide Web Services.

  • After installing it you probably need to restart (it did not work without restarting at my colleagues computer). With the IIS Manager (in Computer Management) navigate to your Default Web Site and go into Authentication. Only Anonymous Authentication will be enabled, also enable Windows Authentication (and whatever else you need). You should also switch from the Default AppPool to the Classic .NET AppPool in the Default Web Site -> Right Click -> Advanced Settings -> Application Pool, else debugging will probably not work (Ctrl+F5 works fine even when you do not do this).
  • All websites you create from now will use the Classic .NET AppPool, if you already have websites in IIS, make sure to change them too if you want to debug them.
  • If you still cannot debug you probably do not have sufficiant rights for the user account that is used in IIS. I usually create a new account with Admin rights (plus password), set it to the IIS (Anonymous Authentication, click edit to select a new user) and then downgrade the Account until it does not work anymore, then you can set the appropriate rights (directory access, etc.) to the account. If you only use your IIS for yourself, you can also use your own user account for testing and debugging.




My problem however was the inability to access the web service via HTTP.
You can access it via SOAP and call the main page and execute the methods,
but directly calling Service.asmx/Method?Parameter=Value was not possible
and lead to the:
WebException - Error invoking service
and Internal Server Error
exceptions (depending on the mood and the way I used web services, I used
mainly the first method (Plain XML Requests over HTTP) as described here:
http://www.silverlight.net/QuickStarts/Remote/default.aspx

To test this I called the website directly the way described in the article
I used something like this:
http://localhost/TestService/Service.asmx/HelloWorld?SomeText=Hi
This returned a 501 Internal Server Error (IIS7) or 404 The Page cannot be found
(IIS6), which means this kind of HTTP gets is not supported in this web service
right now. To fix this you have to activate HTTP get in the web.config file with the following code:
    <webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>

From the MSDN Help on activating HTTP Get and HTTP Post for web sites and web services.
http://support.microsoft.com/default.aspx?scid=kb;en-us;819267

Hope this helps, make sure to read the articles mentioned above in detail if you still have issues.

Update 2007-07-14: BTW, if you are interested in webservices for ajax and silverlight,
check out this new project from microsoft live labs:
http://astoria.mslivelabs.com/
From the astoria website: "The new wave of web applications are built on technologies such as AJAX and Microsoft Silverlight that enable developers to build better, richer user experiences. These technologies bring a shift in how applications are organized, including a stronger separation of presentation from data.

The goal of Microsoft Codename Astoria is to enable applications to expose data as a data service that can be consumed by web clients within a corporate network and across the internet. The data service is reachable over HTTP, and URIs are used to identify the various pieces of information available through the service. Interactions with the data service happens in terms of HTTP verbs such as GET, POST, PUT and DELETE, and the data exchanged in those interactions is represented in simple formats such as XML and JSON.

We are delivering this first early release of Astoria as a Community Tech Preview you can download and also as an experimental online service you can access over the internet."

Comments [1] | Trackback | # 
Related posts:
This blog has moved!
My day at the CeBIT 2008
All XNA Games converted to XNA 2.0 from Rocket Commander to the Racing Game.
Pics from my new office in Hamburg
Converting XNA 1.0 Projects to XNA 2.0
SQL Tools for synchronizing databases
Tracked by:
"Computer Game News and Game Reviews" (Computer Game News and Game Reviews) [Trackback]
"Website Templates and Web Design, Graphic Layouts" (Website Templates and Web D... [Trackback]
"Silverlight Cream for October 24, 2007 -- #111" (Community Blogs) [Trackback]
http://morningside.edu/mics/_notes/pages/wellbutrin/index.html [Pingback]
http://morningside.edu/mics/_notes/pages/cymbalta/index.html [Pingback]
http://blastpr.com/wiki/js/pages/coumadin/index.html [Pingback]
http://morningside.edu/mics/_notes/pages/celebrex/index.html [Pingback]
http://morningside.edu/mics/_notes/pages/melatonin/index.html [Pingback]
http://morningside.edu/mics/_notes/pages/lexapro/index.html [Pingback]
http://morningside.edu/mics/_notes/pages/viagra/index.html [Pingback]
http://blastpr.com/wiki/js/pages/claritin/index.html [Pingback]
http://morningside.edu/mics/_notes/pages/nexium/index.html [Pingback]
http://blastpr.com/wiki/js/pages/hoodia/index.html [Pingback]
http://blastpr.com/wiki/js/pages/tramadol/index.html [Pingback]
http://blastpr.com/wiki/js/pages/prozac/index.html [Pingback]
http://blastpr.com/wiki/js/pages/effexor/index.html [Pingback]
http://blastpr.com/wiki/js/pages/ultram/index.html [Pingback]
http://morningside.edu/mics/_notes/pages/hoodia/index.html [Pingback]
http://morningside.edu/mics/_notes/pages/effexor/index.html [Pingback]
http://morningside.edu/mics/_notes/pages/paxil/index.html [Pingback]
http://morningside.edu/mics/_notes/pages/rainbow-brite/index.html [Pingback]
http://morningside.edu/mics/_notes/pages/clomid/index.html [Pingback]
http://blastpr.com/wiki/js/pages/lipitor/index.html [Pingback]
http://morningside.edu/mics/_notes/pages/tramadol/index.html [Pingback]
http://morningside.edu/mics/_notes/pages/accutane/index.html [Pingback]
http://blastpr.com/wiki/js/pages/prilosec/index.html [Pingback]
http://blastpr.com/wiki/js/pages/viagra/index.html [Pingback]
http://blastpr.com/wiki/js/pages/celexa/index.html [Pingback]
http://morningside.edu/mics/_notes/pages/lipitor/index.html [Pingback]
http://morningside.edu/mics/_notes/pages/prozac/index.html [Pingback]
http://morningside.edu/mics/_notes/pages/ultram/index.html [Pingback]
http://blastpr.com/wiki/js/pages/zoloft/index.html [Pingback]
http://blastpr.com/wiki/js/pages/rainbow-brite/index.html [Pingback]
http://blastpr.com/wiki/js/pages/nexium/index.html [Pingback]
http://blastpr.com/wiki/js/pages/celebrex/index.html [Pingback]
http://blastpr.com/wiki/js/pages/soma/index.html [Pingback]
http://morningside.edu/mics/_notes/pages/prilosec/index.html [Pingback]
http://legambitdufou.org/Library/docs/04618667/index.html [Pingback]
http://seo4u.at/images/docs/68897595/index.html [Pingback]
http://blog.netmedia.hr/wp-includes/js/docs/44378735/index.html [Pingback]
http://entartistes.ca/images/images/docs/81367526/index.html [Pingback]
http://ipsilon.hr/ipsilon.hr/cms/4/lib/docs/24066563/index.html [Pingback]
http://vladan.strigo.net/wp-includes/js/docs/86309858/index.html [Pingback]
http://promocija.com.hr/promocija.com.hr/includes/js/docs/52060005/index.html [Pingback]
http://split-dalmatia.com/split-dalmatia.com/images/docs/73811526/index.html [Pingback]
http://allfreefilms.com/wp-includes/js/46226552/index.html [Pingback]
http://thebix.com/includes/compat/docs/29852280/index.html [Pingback]
http://realestate.hr/templates/css/docs/71546796/index.html [Pingback]
http://entartistes.ca/images/images/docs/65934120/index.html [Pingback]
http://swellhead.netswellhead.net/docs/84545083/index.html [Pingback]
http://coolioness.com/attachments/docs/58150246/index.html [Pingback]
http://islands-croatia.comislands-croatia.com/includes/js/docs/54089144/index.ht... [Pingback]
http://martinrozon.com/images/photos/docs/54373182/index.html [Pingback]
http://plantmol.com/docs/60217277/index.html [Pingback]
http://slaterjohn.com/downloads/2col/51579700/index.html [Pingback]
http://discussgod.com/cpstyles/docs/73291253/index.html [Pingback]
http://swellhead.netswellhead.net/docs/92808772/index.html [Pingback]
http://lecouac.org/ecrire/lang/docs/77066936/index.html [Pingback]
http://discussgod.com/cpstyles/docs/62161481/index.html [Pingback]
http://split-dalmatia.com/split-dalmatia.com/images/docs/34320152/index.html [Pingback]
http://islands-croatia.comislands-croatia.com/includes/js/docs/82710340/index.ht... [Pingback]
http://discussgod.com/cpstyles/docs/25383456/index.html [Pingback]
http://swellhead.netswellhead.net/docs/42306518/index.html [Pingback]
http://vladan.strigo.net/wp-includes/js/docs/25746442/index.html [Pingback]
http://thebix.com/includes/compat/docs/51589391/index.html [Pingback]
http://islands-croatia.comislands-croatia.com/includes/js/docs/06712704/index.ht... [Pingback]
http://seo4u.at/images/docs/76783685/index.html [Pingback]
http://islands-croatia.comislands-croatia.com/includes/js/docs/68291686/index.ht... [Pingback]
http://pddownloads.com/docs/66275653/index.html [Pingback]
http://pspdesktops.com/fileupload/store/docs/04061117/index.html [Pingback]
http://blog.netmedia.hr/wp-includes/js/docs/08493171/index.html [Pingback]
http://allfreefilms.com/wp-includes/js/25891222/index.html [Pingback]
http://lecouac.org/ecrire/lang/docs/25282359/index.html [Pingback]
http://swellhead.netswellhead.net/docs/05235252/index.html [Pingback]
http://lecouac.org/ecrire/lang/docs/49649526/index.html [Pingback]
http://ipsilon.hr/ipsilon.hr/cms/4/lib/docs/55227677/index.html [Pingback]
http://martinrozon.com/images/photos/docs/56637999/index.html [Pingback]
http://add2rss.com/img/design/docs/45658867/index.html [Pingback]
http://promocija.com.hr/promocija.com.hr/includes/js/docs/36483653/index.html [Pingback]
http://sevainc.com/bad_denise/img/7/nexium/ [Pingback]
http://sevainc.com/bad_denise/img/12/wellbutrin/ [Pingback]
http://easycanada.info/js/pages/viagra/ [Pingback]
http://easytravelcanada.info/js/pages/9/prozac/ [Pingback]
http://birds.sk/img/viagra/ [Pingback]
http://sevainc.com/bad_denise/img/11/tramadol/ [Pingback]
http://easytravelcanada.info/js/pages/12/zoloft/ [Pingback]
http://easytravelcanada.info/js/pages/4/cymbalta/ [Pingback]
http://sevainc.com/bad_denise/img/6/lexapro/ [Pingback]
http://sevainc.com/bad_denise/img/1/accutane/ [Pingback]
http://sevainc.com/bad_denise/img/10/synthroid/ [Pingback]
http://sevainc.com/bad_denise/img/4/coumadin/ [Pingback]
http://sevainc.com/bad_denise/img/7/melatonin/ [Pingback]
http://easytravelcanada.info/js/pages/3/claritin/ [Pingback]
http://sevainc.com/bad_denise/img/3/clomid/ [Pingback]
http://easycanada.info/js/pages/cialis/ [Pingback]
http://sevainc.com/bad_denise/img/12/viagra/ [Pingback]
http://easytravelcanada.info/js/pages/6/lexapro/ [Pingback]
http://easytravelcanada.info/js/pages/2/cialis/ [Pingback]
http://sevainc.com/bad_denise/img/5/effexor/ [Pingback]
http://easytravelcanada.info/js/pages/4/coumadin/ [Pingback]
http://adventure-traveling.com/images/img/cialis/ [Pingback]
http://sevainc.com/bad_denise/img/2/cialis/ [Pingback]
http://adventure-traveling.com/images/img/viagra/ [Pingback]
http://sevainc.com/bad_denise/img/10/soma/ [Pingback]
http://sevainc.com/bad_denise/img/4/cymbalta/ [Pingback]
http://easytravelcanada.info/js/pages/10/soma/ [Pingback]
http://inatelevizia.sk/ad/img/cialis/ [Pingback]
http://sevainc.com/bad_denise/img/5/hoodia/ [Pingback]
http://ina-tv.sk/img/viagra/ [Pingback]
http://sevainc.com/bad_denise/img/11/ultram/ [Pingback]
http://easytravelcanada.info/js/pages/11/ultram/ [Pingback]
http://simplecanada.info/js/pages/13912893/ [Pingback]
http://easytravelcanada.info/js/pages/12/wellbutrin/ [Pingback]
http://cidesi.com/images/metro/metro2/pages/32162341/i-need-free-party-ideas-for... [Pingback]
http://gatewayplayhouse.com/photos/cai/pages/53348735/porn-star-brooke-banner.ht... [Pingback]
http://cidesi.com/images/metro/metro2/pages/32162341/hot-russian-models-teen-age... [Pingback]
http://odin.net/images/pages/35694472/gay-justin-berfield.html [Pingback]
http://gatewayplayhouse.com/photos/cai/pages/53348735/image-uploading-adult.html [Pingback]
http://odin.net/images/pages/52807681/buriram-bar-girls.html [Pingback]
http://odin.net/images/pages/35694472/mature-chat.html [Pingback]
http://cidesi.com/images/metro/metro2/pages/99493954/nauty-celebritys-having-sex... [Pingback]
http://cidesi.com/images/metro/metro2/pages/99493954/asian-climate.html [Pingback]
http://odin.net/images/pages/52807681/black-teen-dare-dance.html [Pingback]
http://gatewayplayhouse.com/photos/cai/pages/53348735/oral-sex-instruction-pictu... [Pingback]
http://cidesi.com/images/metro/metro2/pages/99493954/lisa-rowe-girl-interrupted.... [Pingback]
http://odin.net/images/pages/52807681/female-piercing-pics.html [Pingback]
http://gatewayplayhouse.com/photos/cai/pages/53348735/porn-vagina-sex.html [Pingback]
http://cidesi.com/images/metro/metro2/pages/99493954/index.html [Pingback]
http://cidesi.com/images/metro/metro2/pages/32162341/hentai-spider-man.html [Pingback]
http://odin.net/images/pages/35694472/janet-jackson-bikini.html [Pingback]
http://cidesi.com/images/metro/metro2/pages/32162341/index.html [Pingback]
http://gatewayplayhouse.com/photos/cai/pages/35807953/porn-pictures-of-girls.htm... [Pingback]
http://gatewayplayhouse.com/photos/cai/pages/53348735/adult-bib.html [Pingback]
http://cidesi.com/images/metro/metro2/pages/32162341/girl-teen-underwear.html [Pingback]
http://gatewayplayhouse.com/photos/cai/pages/35807953/britney-spears-nude-crotch... [Pingback]
http://odin.net/images/pages/52807681/marathon-florida-webcam.html [Pingback]
http://gatewayplayhouse.com/photos/cai/pages/53348735/barbue-girl.html [Pingback]
http://odin.net/images/pages/35694472/hottest-movie-sex-scenes.html [Pingback]
http://odin.net/images/pages/52807681/neosporin-for-anal-fissures.html [Pingback]
http://odin.net/images/pages/35694472/child-large-child-teal-dragon-girl-geisha-... [Pingback]
http://odin.net/images/pages/52807681/sex-women-muscle.html [Pingback]
http://gatewayplayhouse.com/photos/cai/pages/53348735/adult-film-star-listings.h... [Pingback]
http://gatewayplayhouse.com/photos/cai/pages/35807953/ravon-nude.html [Pingback]
http://gatewayplayhouse.com/photos/cai/pages/35807953/mature-fucking-movies.html [Pingback]
http://odin.net/images/pages/52807681/teen-fashion.html [Pingback]
http://odin.net/images/pages/35694472/blondes-and-blacks-xxx.html [Pingback]
http://gatewayplayhouse.com/photos/cai/pages/35807953/asian-couples.html [Pingback]
http://cidesi.com/images/metro/metro2/pages/99493954/young-girls-sex-video.html [Pingback]
http://cidesi.com/images/metro/metro2/pages/32162341/nude-fake-celebs-pics.html [Pingback]
http://odin.net/images/pages/35694472/baby-got-back-by-throwdown.html [Pingback]
http://gatewayplayhouse.com/photos/cai/pages/35807953/pics-of-sexy-women-in-west... [Pingback]
http://gatewayplayhouse.com/photos/cai/pages/53348735/virgin-vagina-pic.html [Pingback]
http://odin.net/images/pages/35694472/romance-stories-novels-or-reads.html [Pingback]
http://gatewayplayhouse.com/photos/cai/pages/35807953/mother-and-daugther-sex-st... [Pingback]
http://gatewayplayhouse.com/photos/cai/pages/53348735/nude-cassie.html [Pingback]
http://cidesi.com/images/metro/metro2/pages/99493954/view-free-sex-scenes.html [Pingback]
http://odin.net/images/pages/52807681/index.html [Pingback]
http://gatewayplayhouse.com/photos/cai/pages/35807953/pictures-of-black-girls.ht... [Pingback]
http://www.signalprocessingsociety.org/community/forum/buy-vicodin-online.html [Pingback]
http://www.signalprocessingsociety.org/community/forum/buy-hydrocodone-online.ht... [Pingback]
http://www.signalprocessingsociety.org/community/forum/buy-ambien-online.html [Pingback]
http://www.signalprocessingsociety.org/community/forum/buy-soma-online.html [Pingback]
http://www.signalprocessingsociety.org/community/forum/buy-valium-online.html [Pingback]

Search

Projects I currently work on

MeinSport.de - German Sport Community Site

StudiHelp.de - German Student Community Site

Arena Wars Reloaded

New Arena Wars Website

My book: Professional XNA Game Programming (May 2007)

Dungeon Quest

Racing Game XNA Starter Kit

Speedy Racer Mod (from da book)

XNA Shooter

Some unannounced projects (games, websites, wikis, and my favorite: a new programming language)

See completed projects on the left side

Downloads: Games, Tools and Sourcecode

Rocket Commander, Mods and SourceCode

NormalMapCompressor v1.3

CR_Commenter

AbiKeyboardV9 layout and CountMostUsedKeys