ASMX test page & remote machine access

by jk 27. September 2007 19:47
Even though I love WCF, ASMX is not going away anytime soon.  One of the things I like about ASMX is the auto-generated test web page (if you have simple types of course, not messages).  At my current client, we develop a message based endpoint and also create a test web service (in the tempuri.org namespace so there is no confusion about which is the ‘correct’ service to call) with simple types so it is easy to try out the service. 

The other day, I created such a page to share with one of the project analysts who was writing requirements.  I gleefully crufted up the ASMX service page using System.String as the input and sent the link to the analyst.  However, I forgot the auto-generated test page works well on the local machine, but to use it remotely, additional configuration love is necessary.

So, a blog post seemed like a good way to ensure I never forget again (or if I do forget, an easy reference for me instead of having to Google the answer).

The error you see is: "The test form is only available for requests from the local machine."

MSDN forums had a link which helped to resolve the issue:  http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=451735&SiteID=1

“Put this in the <system.web> section of your web.config file.

<webServices>

        <protocols>

            <add name="HttpSoap12"/>

            <add name="HttpSoap"/>

            <add name="HttpGet"/>

            <add name="HttpPost"/>

        </protocols>

</webServices>

Thanks to google and http://www.fincher.org/tips/Languages/csharp.shtml”

I look forward to the day where WCF has this feature again J

jk

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Visual Studio 2008 Beta 2 – WCF test client error

by jk 21. September 2007 19:22

I attended the Microsoft Partner Event "OnRamp240 Microsoft(r) Visual Studio(r) 2008" this morning at the local Microsoft office in Bloomington. Local evangelist Mike Benkovich presented the material.

One of the cool new VS.NET 2008 features Mike demoed is the automatic WCF Test Client. Normally when you write a WCF service you need to implement a client and a host for it, which in .NET 3.0 lacks a bit of tooling (for productivity reasons). In .NET 3.5 you create your WCF service, and then run it in the WCF Test Client. It spins up a simple host (think: like VS.NET 2005 does for a Visual Studio Web Server) and brings up a client interface where you can enter values in a treeview/listview like control and invoke the WCF service method. ASMX could handle this for simple parameters only (e.g. string, int, etc…) but could not handle complex data contracts (messages). This tool handles complex data contracts!!!!!! Granted, I have not given it any real tough contracts yet, but plan to in the upcoming weeks. I will report the findings back here of course.

Post event, I fired up my Visual Studio Team System 2008 Beta 2 Team Suite VPC and tried using the WCF Test Client. Alas, a nasty exception came up:

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'svcutil, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)

File name: 'svcutil, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ---> System.Security.SecurityException: Strong name validation failed. (Exception from HRESULT: 0x8013141A)

The Zone of the assembly that failed was:

MyComputer

Thanks to Google and the Readme file (of course I did not read that first, insert embarrassed smiley face here) for the workaround.

From: http://download.microsoft.com/download/d/d/1/dd18043a-fe86-4f57-ac22-791b30e6f04b/VSReadme.htm

2.3.7.8 Running some WCF-based project templates results in a crash of svcutil.exe crashing due to a signing issue

Running some WCF-based project templates starts the service in WCF Service Host and opens a test form to debug operations on the service. Because of a signing problem, this results in a crash of svcutil.exe and the test form does not work.

To resolve this issue:

Disable strong name signing for svcutil.exe by opening a Visual Studio Command Prompt. At the command prompt run: sn -Vr "<program files>\Microsoft SDKs\Windows\v6.0A\Bin\SvcUtil.exe"  (replace <program files> with your program files path - ex: c:\Program Files)

More to come! Bring on VS.NET 2008!

jk

p.s. another blog post from Word 2007 :)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

19 Eponymous Laws Of Software Development - a.k.a Therapy

by jk 12. September 2007 20:47

I was recently catching up on some old DotNetRocks podcasts (you *do* listen to DNR, right???) and during the show with Mr. Phil Haack (one of the best computer names ever), he mentioned a page containing the 19 Eponymous Laws Of Software Development.  Don't worry if you don't know what eponymous means as there is a link to dictionary.com in that post.  If you've ever been a developer or around developers, this post will be very therapudic and should help you share a chuckle with your fellow developers.

My personal favorite is Hofstadter’s Law because it is recursive and recursion is powerful and dangerous!

I hope the 19 laws brighten your day!

jk

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Small world, Magenicon on ComputerZen

by jk 10. September 2007 11:43

Lutz Roeder's Reflector is one of the best .NET tools ever, and it suprises me how many developers are unaware of it. If you have *not* seen it, go check it out; it is an invaluable tool for figuring out how stuff works!

In that vein, I was reading through "Scott Hanselman's 2007 Ultimate Developer and Power Users Tool List for Windows" and saw many addins for Reflector.  The FileGenerator addin caught my eye as I had an immediate work-related need to grab a bunch of constants and QNames out of a web service protocol assembly.  Lo and behold, fellow Magenicon Jason Bock authored FileGenerator (small world)!  I downloaded, compiled, installed and used the addin with no issues.  More importantly I completed the task-at-hand in a timely fashion (something clients seem to like, lol).

Kudos to tool authors (Mr. Roeder, Mr. Bock) who make developer lives easier and to Mr. Hanselman for researching and maintaining this tool list!

jk

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen