WSCF.blue now supports Visual Studio 2010 RC

by Alex Meyer-Gleaves 24 February 2010 - 12:56 AM

image There is another WSCF.blue update (V1.0.7) available for download on CodePlex. This update adds support for Visual Studio 2010 RC in addition to Visual Studio 2008. Please note that Visual Studio 2010 Beta 2 is not supported.

All features should work exactly the same way in both versions of Visual Studio. If you have any problems please jump onto the Issue Tracker and let us know.

I would also love to hear more about what features you would like to see in upcoming versions of WSCF.blue. If you have any thoughts please contact me or simply start a thread in the Discussions forum. Your feedback is always welcome.

Tags: ,

Categories: Web Services | WSCF

WSCF.blue V1.0.6 Update

by Alex Meyer-Gleaves 18 February 2010 - 1:20 AM

There is now a V1.0.6 update for WSCF.blue that includes fixes for a number of bugs that have been reported since the V1.0.5 release. It has taken some large and complex contracts to uncover some of the more obscure bugs. Below is a list of the bugs that have been fixed:

  • The data contract type filter was not including all the required types in some complex contracts.
  • When adjusting the casing of enumeration members references in DefaultValue attributes and constructors were not being updated.
  • When using the List<T> option along with the Public properties option the backing field used for properties was sometimes left as an array instead of a generic list.
  • When using the List<T> option along with the Public properties option the backing field used for properties with an XmlChoiceIdentifier attribute was converted to a generic list instead of being left as an array to match the property.
  • Fixed an Adjust casing bug related to enumeration values that cannot be used as valid property names. The XmlEnumAttribute was being set to the generic ItemX property name instead of being left with the value from the original enumeration.

If you have any problems with the update please let us know through the Issue Tracker. Thanks to everyone who has reported bugs.

Tags: ,

Categories: WSCF | Web Services

More than 1000 downloads for WSCF.blue V1

by Alex Meyer-Gleaves 5 January 2010 - 12:41 AM

On the last day of September in 2009 we released the first version of WSCF.blue on CodePlex. I was very pleased to see that there has now been more than 1000 downloads of the V1 release. Congratulations to the team and thank you to everyone who has downloaded WSCF.blue. It is great to see that interest in contract-fist development is still alive and well. Of course, Christian and Buddhike did a great job of spreading the word with their excellent MSDN article.

image

Now that everyone is back from holidays and feeling refreshed there is no doubt work will continue on the next version. We all have plenty of ideas for the features we would like to see, but what we would really like is feedback from the community on what you want. If you have ideas on what you would like to see in future versions of WSCF.blue please jump onto the forum and let us know.

Tags:

Categories: WSCF | Web Services | Development Tools

Would you become a signatory of the SOA Manifesto?

by Alex Meyer-Gleaves 20 November 2009 - 11:12 PM

Most developers have heard of the Agile Manifesto, but did you know there is also a SOA Manifesto? Like the Agile Manifesto, and perhaps even more so, I am sure it will be wide open to interpretation and will spark some level of debate. There is already a SOA Manifesto Dialog site dedicated to discussion of the manifesto, and a poll that it hosts suggests that opinion is indeed varied. I have embedded the same poll below if you would like to voice your opinion right now.

I am just happy to see some activity taking place within the SOA community, and for SOA to be getting some form of press once again. SOA has provided a great deal of benefit to the many organisations that have embraced it, and I believe that fact should be recognised. If you too believe in the benefits that SOA delivers you should head on over to the site, and if you agree with what is written become a signatory to the manifesto.

Tags:

Categories: Web Services

Contract-First article on MSDN

by Alex Meyer-Gleaves 4 October 2009 - 12:44 PM

Congratulations to Christian and Buddhike for their excellent MSDN article: Schema-based Development with Windows Communication Foundation. If you are new to contract-first web service development, or even if you have been practicing it for a while, I am sure you will really enjoy reading this article. It is great to see an article on MSDN that is focused on contract-first and how it can be achieved with WCF. Of course, there is a section dedicated to the WSCF.blue Visual Studio 2008 Add-in.

The diagram below was created for the article, and Christian has also put it on the WSCF.blue homepage on CodePlex.

The schema-first approach has five discrete steps.

I really like this diagram, it paints a picture that is very clear and easy to understand. It shows that there is a sequence of steps that are undertaken when doing contract-first development, and highlights that this entire sequence becomes an iterative process. Well done guys!

Tags: ,

Categories: Web Services | WSCF

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

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

Controlling your Service method implementation in WSCF.blue

by Alex Meyer-Gleaves 8 August 2009 - 3:26 AM

I have added some new options to WSCF.blue that control how the methods in your service class are code generated. It was a post in the Discussions forum on our CodePlex site that prompted me to finally add the feature that I myself have wanted for some time now. The default service class code generated by WSCF.blue contains operation method implementations that throw a NotImplementedException. The issue with this approach is that you need to manually update the generated code to call another class that contains your actual service implementation, otherwise you will loose your implementation code during the regeneration process. You can now decide if you would like your service implementation to exist in a partial class or abstract class that can be defined in a separate file. These options can be found in the Service Method Implementation group in the Code Generation options dialog.

Options for Service Method Implementation

The first and default option is to generate method bodies that throw a NotImplementedException. Making this option the default keeps the behaviour consistent with previous builds of WSCF.blue. However, using this option will always result in your having to perform same manual modifications to the generated service class.

[System.ServiceModel.ServiceBehaviorAttribute()]
public class FooService : IFooService
{
    public virtual FooResponse Foo(FooRequest request)
    {
        throw new System.NotImplementedException();
    }
}

Selecting the partial class option will cause the generated service class to be marked as partial. It will also contain operation methods that call through to a partial method that can be defined in another partial class and in another file. This file must be created manually yourself, but once created it will remain untouched when you regenerate your service code.

[System.ServiceModel.ServiceBehaviorAttribute()]
public partial class FooService : IFooService
{
    public virtual FooResponse Foo(FooRequest request)
    {
        return FooImplementation(request);
    }
}

The naming convention for the partial method is the name of the operation method suffixed with Implementation. In the example above you can see the Foo operation method calls a FooImplementation method that is expected to be present in your partial class definition. You will receive a compiler error until you have defined your partial class containing the appropriate partial methods.

public partial class FooService
{
    protected FooResponse FooImplemenation(FooRequest request)
    {
        FooResponse response = new FooResponse();
        // Some web service processing code.
        return response;
    }
}

Your partial class definition should be created in a separate file to the service class that calls it. This will ensure you do not have to make any changes when regenerating your service code, which is obviously the very issue the option is designed to solve.

Because a partial class can be defined in a separate file, but must reside within the same project, an abstract class option was added that allows you to place your service implementation in another assembly. This option causes an abstract service class containing abstract operation methods to be code generated.

[System.ServiceModel.ServiceBehaviorAttribute()]
public abstract class FooService : IFooService
{
    public abstract FooResponse Foo(FooRequest request);
}

You can then inherit from the abstract service class and place your implementation in the overridden abstract methods. Similar to the partial class approach, this allows you to separate your implementation into another file that remains untouched when you regenerate your service code, but also allows for the implementation to be created in another assembly.

public class FooServiceImplemenation : FooService
{
    public override FooResponse Foo(FooRequest request)
    {
        FooResponse response = new FooResponse();
        // Some web service processing code.
        return response;
    }
}

Both the partial class and abstract class approaches are equally valid, and both result in the desired outcome of protecting your implementation code. The important points to remember are that when using the partial class option, your implementation class must have the same name as the code generated service class and must be defined in a file within the same project. When using the abstract class option, your implementation class cannot have the same name as the code generated service class but can be defined in a file that is not in the same project. Which you prefer to use entirely up to you and is probably a matter of taste for the most part.

I hope you find this feature useful, I know I certainly will. Please report any WSCF.blue bugs in the Issue Tracker and feel free to raise your suggestions in the Discussions forum.

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