WSCF.blue V1 Final Released

by Alex Meyer-Gleaves 30 September 2009 - 4:23 AM

image The team is very pleased to announce that WSCF.blue has achieved the important V1 milestone. Thank you to everyone who provided feedback in the form of suggestions and bug reports. This input has really helped us improve the stability of WSCF.blue and increase the available feature set. It has also given us many other good ideas that will no doubt be rolled into future releases.

The primary feature set for WSCF.blue V1 includes the following:

  • A WSDL Wizard that allows the developer to step through the creation of a WSDL from one or more XSDs.
  • A Data Contract Generator (similar to XSD.exe, XSDObjectGen.exe and SvcUtil.exe) that generates the .NET equivalent of the XSD types.
  • A Service/Endpoint Stub (SVC) Generator and
  • A Client Proxy Generator.
  • A Generate Data Contract Code feature that supports the selection of multiple XSD/WSDL source files. (More Information)
  • A Paste XML as Schema option that generates a schema for a block of XML in the clipboard. (More Information)
  • Support for C# and VB.NET code generation.
  • You can choose if operation methods on your service class will throw a NotImplementedException, call an implementation method in a partial class, or will be defined as abstract methods. (More Information)
  • Force the SOAP actions (Action and ReplyAction) applied to each operation contract follow the standard WCF format: <namespace>/<service>/<operation>[Response]
  • Errors found in your WSDL are reported in a WSCF.blue pane in the Output window. (More Information)

Like many other open source projects, I have found WSCF (classic and blue versions) to be invaluable over the years. It feels good to give something back to the .NET open source community that has provided me with such a wide range of free and quality software to choose from. Thanks to WSCF.blue contract-first web service development in WCF for .NET developers is easily achievable. Please keep the feedback coming in and enjoy the release.

Tags: ,

Categories: WSCF | Web Services

Improved WSDL error handling in WSCF.blue

by Alex Meyer-Gleaves 28 September 2009 - 4:29 AM

I finally got around to making one of those improvements to WSCF.blue that has been calling out for my attention for a while. It was to improve the error handling when the WSDL selected for Client-side proxy or Service-side stub code generation contains errors that will cause the process to fail. Previously, you would receive an exception and stack trace that unfortunately did not provide the details required to determine what was actually wrong with your WSDL. Now when these errors are encountered a message box will inform you of the problem and direct your attention to the new WSCF.blue pane in the Output window where you can see all the error details.

WSDL errors in the Output window.

As you can see in the screen capture above the error messages are very descriptive and informative, and in fact are the same as those returned from svcutil.exe. I am sure you always get your WSDL correct first go (especially with the help of WSCF.blue), but just in case your having one of those days, this should help you out.

Tags: ,

Categories: Web Services | WSCF

Paste XML as Schema in WSCF.blue

by Alex Meyer-Gleaves 21 September 2009 - 9:24 PM

The WCF REST Starter Kit includes a Visual Studio Add-in called Paste XML as Type that, as you would expect given the name, allows you to paste XML from the clipboard into your code as a .NET type definition. This works well in a REST scenario where the response from a web service is XML that you want to deserialise into a .NET type for use on the client. WSCF.blue now includes a similar feature, but one that is designed to better fit with the contract-first approach. Instead of taking the XML and creating a .NET type definition, WSCF.blue infers an XML schema that can be used in your web service contract.

Imagine that you have an application that passes XML documents around via the file system or maybe even a queue. You decide that you would like to update this application to use web services, and will of course take the contract-first approach using that WSCF.blue tool that your friends keep raving about. You can open one of those XML documents and copy the contents into the clipboard, then jump over to Visual Studio and have an XSD file containing the appropriate schema added to your project in seconds. After defining the schema for your messages, WSCF.blue will help you construct your WSDL and generate your stub service and client code.

The new feature appears as the Paste XML as Schema menu item on the Edit menu in Visual Studio. The menu item will only be enabled if a project is currently open and selected. You may notice in the screen capture that the menu items looks suspiciously familiar, maybe even to a neighbouring menu item.

Paste XML as Schema Menu Item

WSCF.blue will ensure the text in your clipboard is valid XML before inferring the schema. The paste operation actually adds a new file into your project and does not paste the XSD directly into the active editor window. I know that is a little strange for a paste operation that corresponds to a text formatted copy operation, but think of it as pasting a magically created file into your project. Your new XSD file will be named the same as the root element in the XML. For example, performing the paste with the XML below in your clipboard:

<?xml version="1.0"?>
<catalog>
   <book id="bk101">
      <author>Gambardella, Matthew</author>
      <title>XML Developer's Guide</title>
      <genre>Computer</genre>
      <price>44.95</price>
      <publish_date>2000-10-01</publish_date>
      <description>An in-depth look at creating applications 
      with XML.</description>
   </book>
   <book id="bk102">
      <author>Ralls, Kim</author>
      <title>Midnight Rain</title>
      <genre>Fantasy</genre>
      <price>5.95</price>
      <publish_date>2000-12-16</publish_date>
      <description>A former architect battles corporate zombies, 
      an evil sorceress, and her own childhood to become queen 
      of the world.</description>
   </book>
</catalog>

Will result in the currently selected project having a file called catalog.xsd added to it. Below is the schema inferred from the XML that will appear in the XSD file:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="catalog">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" name="book">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="author" type="xs:string" />
              <xs:element name="title" type="xs:string" />
              <xs:element name="genre" type="xs:string" />
              <xs:element name="price" type="xs:decimal" />
              <xs:element name="publish_date" type="xs:date" />
              <xs:element name="description" type="xs:string" />
            </xs:sequence>
            <xs:attribute name="id" type="xs:string" use="required" />
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

Please download the latest V1 Beta 2 build (1.0.4) and take it out for a spin. Hopefully this feature will make it easier for people to create web services using contract-first and will remove the need for passing around those old XML documents. Web services are a much more fun way to pass XML around!

Tags: ,

Categories: Web Services | WSCF

Comparison keyboard shortcuts for Pending Changes in TFS

by Alex Meyer-Gleaves 5 September 2009 - 1:01 AM

Logitech MX5500 One of the first things I configured in my Visual Studio environment when I starting using TFS was keyboard shortcuts to make comparing my pending changes easier. I find having to right-click on each item in the Pending Changes window and navigate through the context menu to perform a comparison quickly tests my patience. The drop down menu on the tool bar button is slightly faster but still not quick enough for my liking. I am always fastest when my hands don’t need to leave the keyboard.

I have configured keyboard shortcuts to compare my pending changes with the Latest, Workspace and Previous versions. Obviously the shortcuts only work when the option would normally appear enabled on the context menu. To configure these shortcuts select Options from the Tools menu in Visual Studio. In the Options dialog use the tree to drill into Environment and then to the Keyboard settings. Enter the command names below into the Show commands containing text box one at a time:

  • TeamFoundationContextMenus.SourceControlPendingChangesSourceFiles.Compare.TfsContextPendingCheckinsCompareWithLatestVersion
  • TeamFoundationContextMenus.SourceControlPendingChangesSourceFiles.Compare.TfsContextPendingCheckinsCompareWithWorkspaceVersion
  • TeamFoundationContextMenus.SourceControlPendingChangesSourceFiles.Compare.TfsContextPendingCheckinsCompareWithPreviousVersion

For each command enter your desired keyboard shortcut into the Press shortcut keys text box and click the Assign button. I have used the shortcut keys below, assigned to the commands in the same ordinal position above:

  • Ctrl+`
  • Ctrl+Shift+`
  • Ctrl+Alt+`

With this in place I can quickly fire up and navigate through my diffs in WinMerge using only my keyboard. No mucking about and no reaching for the mouse. Even a simple set of steps can become frustrating when you have to repeat them a large number of times. Save yourself all that clunky mouse based GUI interaction and embrace the power of the keyboard!

Tags: ,

Categories: Development Tools

Data contract generation is now available in WSCF.blue

by Alex Meyer-Gleaves 1 September 2009 - 2:47 AM

I am pleased to report that data contract generation is now available, and that the functionality has been extended to allow the selection of multiple source XSD or WSDL files. This feature is available in the V1 Beta 2 release, and as always, user feedback and bug reports are welcome.

Data contract generation was one of the features from WSCF.classic that got left behind while the work was done to support WCF in WSCF.blue. Since this was a very popular feature it was important to make sure it was available in WSCF.blue as part of the V1 release.

The generated data contract types are designed to work with the XmlSerializer. WSCF.blue uses the XmlSerializer because the DataContractSerializer is limited in regards to its support for many of the XSD constructs that often appear in contract-first WSDL. Regardless, I would like to add the ability to generate data contract types using the DataContractSerializer. Please let me know if this is a feature you would like to see implemented.

To generate data contracts start by selecting the required XSD or WSDL file in your project. You can select one or more files as required.

Source XSD files.

Right-click your selection and choose Generate Data Contract Code... from the context menu.

Generate Data Contract Code...

You will be presented with the Data Contract Code Generation Options dialog.

Data Contact Code Generation Options

You can choose to create a separate file for each type or keep them all in a single file. The usual list of Code generation options are also available. Click Generate and enjoy your data contracts!

Tags: ,

Categories: Web Services | WSCF

About the author

Alex Meyer-Gleaves I'm a software developer living in Australia (that island like continent in the southern hemisphere). I love Microsoft .NET and C#. I hate early mornings, slow drivers and Lotus Notes.

Google Reader Clips

SpringWidgets
RSS Reader
This widget is the staple of our platform. Read all your feeds right here with thisone widget - Supported feeds are OPML, RSS, RDF, ATOM. Watch your favorite Podcastin the embedded Video Player on the Desktop or publish your own video playlist toyour site for others to view!

Recent Comments

Comment RSS

Links

Disclaimer

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

© Copyright 2008