Welcome to MSDN Blogs Sign in | Join | Help

Supporting Visual Studio 2005 extensions for .NET Framework 3.0 (WCF)...

I don't think that 'support' should block anyone from using the extensions to adopt WCF, as any projects created using the extensions will continue to work with Orcas. The only difference is that Service references created using the extensions will be treated as normal folders that can no longer be updated. The project should compile and continue to work. The proxy class will be treated as any other code file. This should work because the .NET Framework 3.0 has been released and is fully supported in Orcas.

Only if the service is being modifed, would I recommend re-creating a Service reference in Orcas. This will help in managing the proxy class, as well as the configuration, as the service is updated.

To do this you should:
1. Delete the proxy code file for the Fidalgo Service Reference - OPTIONAL
2. Update the App.config file by removing the relevant ServiceModel sections - OPTIONAL
3. Add a Service reference to the service. If you didn't delete the proxy class/config, the conflicts should be resolved automatically.

Note:
- We cannot support the Visual Studio 2005 Extensions as they were only meant to be an early technology preview. They were our means to get tools out to the community quickly to help early adoption of the product. Therefore, longer term concerns were shelved in favor of getting the tools up to quality and out the door as fast as possible. They, consequently, do not meet the bar required for products that we plan to support longer term. The code, nevertheless, that the extensions generate for WCF on the 3.0 framework will definitely work on Orcas and is fully supported, as Orcas fully supports targeting the .NET Framework 3.0.

- We evaluated the costs of automatically migrating Fidalgo Service references (as a part of the upgrade wizard) in the Orcas timeframe against other features and decided that the costs/benefit vis-à-vis other features did not make the bar.

- Feb CTP will have the first drop of the new Orcas Service Reference features. The planned feature set in Feb CTP is far superior (quality-wise) to the features released in Fidalgo. I plan on releasing a list of the CTP features once we ship the Feb CTP. Unfortunately, I can’t recommend relying on the Feb CTP for production as we plan on changing .svcmap file (contains the information about the Service reference) in the future to accommodate new features planned in the following months. Therefore, it is not guaranteed that the Service reference (or even the project) can be upgraded between CTP, Betas, and RTM.

Ali

Posted by a_pasha | 0 Comments
Filed under: ,

Visual Basic Issue with Types that are generated using svcutil.exe (WCF)

If you generate a WCF VB proxy that contains a DataContract type using svcutil.exe, calling a method that returns the type will always incorrectly return an uninitialized type. This works correctly for C#.

 John Stallo, a peer of mine, spent some time investigating this issue. Here's the resolution:

The problem is a namespace mismatch issue that involves the /Rootnamespace compiler switch (on by default in VB projects). 

 

The important line of code that svcutil generates with this switch is an explicit namespace argument for DataContractAttribute. (This information is usually pulled from the service’s WSDL – the namespace below is the default one that’s generated if a namespace isn’t explicitly specified on the data contract on the server side):

 

System.Runtime.Serialization.DataContractAttribute([Namespace]:="http://schemas.datacontract.org/2004/07/")>  _

    Partial Public Class DataContract1

 

Apparently svcutil.exe doesn’t generate the explicit namespace argument by default.  So when the generated proxy is added to a VB project, the Data Contract type now falls under the VB project’s root namespace (e.g. ConsoleApplication1.DataContract1).  Without the explicit namespace argument, WCF has trouble finding the Data Contract type at runtime because the project’s root namespace throws a spanner in the works, which is why you then end up with uninitialized fields.  This doesn’t repro with C# because C# projects don’t have an implied root namespace.

 

Workaround:

Run svcutil with the following switch: /namespace:*,MyNamespace

…where “MyNamespace” is the namespace of your choosing that you want the proxy to be generated in.

 

Note that this will not be an issue with the Service Reference feature that will be available in the Feburary CTP of Visual Studio Orcas.

Cheers,

Ali

 

Posted by a_pasha | 2 Comments
Filed under: , , ,

Consuming a MapPoint Web Service with Windows Communication Foundation (WCF)...

The issue with the MapPoint service is that it uses digest authentication, but the WSDL itself does not contain any policy stating this. Therefore, when you generate proxy class and config to consume the Service, it will fail until you add the appropriate configuration and client credentials. If I have time, I'll add another post with the updated WSDL.

To get it working you need to do the following:

  • Add a Service Reference (if you're using dev tools for .NET 3.0) or create a proxy class using svcutil.exe to the MapPoint Service
  • Where ever you see a binding configuration section, update the security section from
  • <security mode="None">
  • <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
  • <message clientCredentialType="UserName" algorithmSuite="Default" />
  • </security>

 to

  • <security mode="TransportCredentialOnly">
  • <transport clientCredentialType="Digest" proxyCredentialType="None" realm="" />
  • <message clientCredentialType="UserName" algorithmSuite="Default" />
  • </security>
  • Add the appropriate client credentials in code:

Dim myService As New ServiceReference.FindServiceSoapClient
        myService.ClientCredentials.HttpDigest.ClientCredential = New NetworkCredential(username, password)

        myService.ClientCredentials.HttpDigest.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation

Note: In order to use the MapPoint service (i.e. get a user name and password) you will need to register here: https://mappoint-css.partners.extranet.microsoft.com/MwsSignup/Eval2.aspx

Posted by a_pasha | 0 Comments

Using WCF in VB6?

One of the demos a peer of mine gave (Johnathan) included creating a .NET form with a Web reference that, using the interop toolkit (just released), could be called from a VB6 app. This is a great scenario because it enables those with a VB6 legacy code base to use some of the cool features in .NET without having to rewrite their VB6 applciations.

While I thought that was cool, I wanted to see if the same was possible with WCF in .NET 3.0. As you probably know, the benefit of WCF services is that it highly configurable unlike ASMX in .NET 2.0. The biggest issue in VB 6, however, is to figure out where to add that configuration.

The solution is to name the configuration myapp.exe.config and place it right next to the executable, which is simple enough if you publish the VB6 app.

What about if you want to debug it from the VB6 IDE?

In this case, name the configuration vb6.exe.config and place it right next to the vb6.exe in the VB98 directory.

Actual Steps:

  1. Install the Interop Toolkit
  2. Use the InteropForm project template to create a new project (you don't need to do this, but this really is the simplest way)
  3. Use svcutil to generate a WCF proxy to consume the service (alternatively use Orcas CTP and new Service Reference  dialog - http://www.microsoft.com/downloads/details.aspx?FamilyId=D1336F3E-E677-426B-925C-C84A54654414&displaylang=en)
  4. Use the Service reference in your form.
  5. Select Tools->Generate Interop Wrapper Classes from the Menu Items
  6. Build the project.
  7. Open VB6
  8. Add a Project -> Reference to the .NET project's dll
  9. Call the new InteropForm like you would call any other VB6 form.

What's really cool is that you get great intellisense on the InteropForm from VB6!

Let me know if you have any issues.

Ali

Posted by a_pasha | 0 Comments

WCF Databindings (and the Data Sources window)

As my new role in the VB team, I've been tasked to look at WCF Data bindings and determine our story for Orcas and beyond from a tooling standpoint. As a part of the VB team, we are particularly interested in enabling the N-Teir RAD data story in the Orcas timeframe.

What I've been giving thought into is the right user model for our WCF Data binding story and the various approaches that users create the forms. From data I have seen, my perspective is that several people start from the actions that they want to perform. When they see an Amazon API, they want their data grouped under their operations and not a flat list of data they could use in their forms, as their mental model is that of adding functionality to their form. For example, I want this to be the "Add Item to Cart" form. Or I want to add the "Remove Item from Cart" functionality to this form.

Another key concept is the idea of data services. Where you are thinking of the data (like DataTables) first and then the operations for that data, which are very SQL-like (or CRUD-like) in nature. For example, a user wants to add an Order and OrderDetails table to his form and be able to update/delete items as required. In this case, when the user drags and drops a datatable, he wants it to automatically hook up the Form_Load and SaveButton_Click handlers by generating the appropriate code. This is so that the behavior for datasets across n-tiers is the same as it would be across 1 tier.

Therefore, there are many ways of using the Data Sources window to design a client form using a WCF Service data source, just as they are many ways to design a service (http://blogs.msdn.com/donsmith/archive/2005/09/02/460345.aspx).

How would you like to use the data sources window to design your client form? Have I missed a scenario that you consider important?

Cheers,

Ali

 

Posted by a_pasha | 0 Comments

Moving on ...

My time at VSTS - Arch has been very important to me. I have learnt a lot shipping VS2005 and working on Orcas planning. I have had the opportunity to work with great people and made great friends. I have also been really impressed with the leadership that the team has shown.

Therefore, with mixed emotions, I am announcing that I am leaving the team to join the Visual Basic team, where I will be tasked with working on WCF tooling. I am looking forward to the new challenges and the impact that I can make working on VB.

In the mean time, my blog may be a little bare for the next few weeks while I am transitioning. Best of luck in your architectural pursuits!

Ali

Posted by a_pasha | 1 Comments
Filed under:

Deployment Report Whitepaper...

Kitty interned last summer and this paper was a result of a lot of hard work that he put in: http://msdn.microsoft.com/vstudio/default.aspx?pull=/library/en-us/dnvs05/html/DeployDSD.asp

Cheers,

Ali

Posted by a_pasha | 0 Comments

Describing a software architect by the patterns he uses...

Jack Greenfield sent an email around that described the architect from the perspective of the patterns an architect uses:

The basic working methods of the architects are covered by a limited set of very generic patterns:
- Viewpoint hopping, looking at the problem and (potential) solutions from many points of view, see section 4.2.
- Decomposition, breaking up a large problem in smaller problems, introducing interfaces and the need for integration, see section 4.3.
- Quantification, building up understanding by quantification, from order of magnitude numbers to specifications with acceptable confidence level, see section 4.4.
- Decision making when lots of data is missing, see section 4.5.
- Modeling, as means of communication, documentation, analysis, simulation, decision making and verification, see section 4.6.
- Asking Why, What, How, When, Where questions, see section 4.7.
- Problem solving approach, see section 4.8.

This was taken from the book at: http://www.gaudisite.nl/ArchitecturalReasoningBook.pdf.

Ali

Posted by a_pasha | 1 Comments
Filed under:

Pedro now a lead on the DSL tools team...

I still remember conversations over lunch about how Pedro did not want to be a dev lead/manager, having done it before. How his real passion was development. Therefore, I was taken a back when I saw the announcement so I ran over to Pedro's office to confirm.

Evidently, they made him an offer he couldn't refuse. Let's hope that the dev manager (Dave Sauntry) did not resort to methods that involve horse carcass. :)

Not to worry, Pedro will continue to actively develop the DSL tools.

Congrats Pedro!

Ali

 

 

Posted by a_pasha | 2 Comments
Filed under:

Encrypted Config Sections...

One of the limitations of our designers is that it does not support encrypted appSettings entries. After talking to customers, however, we have realized that this it is not a common scenario to encrypt the config sections during design and that it is usually done at deployment time. In fact, an advantage of the new Web Deployment Projects is that it allows you to replace web.config sections with the the encrypted section for the target machine.

What I'm interested in knowing is if you feel that my assertion above is, in fact, incorrect and why. This information will help us reconsider the decision.

Thanks,

Ali

Posted by a_pasha | 2 Comments
Filed under:

On vacation, on the slopes,

and hurting...

Doing a 720 down the mountain has a completely different connotation for me.

Ali

Posted by a_pasha | 0 Comments
Filed under:

About my office room...

As I read Zillow's web page, which is one of the most hyped startups in Seattle, I came across the About my house... page for each of the executives. I thought it was a great idea so, in true form, I ripped it off and came up with my own version for my office room.

I love that I have my own office after two and a half years of working at Microsoft. I love how Mark and Suhail keep me entertained when they try to balance on my wobble board as they make excuses for why they 'really' came to talk to me. :) I love that Pedro drops by to bug be about my blog every time I make a stupid post. And finally, I love the way that I can hop across the hallway and land straight into Bill's office without having to touch the hallway floor.

I'm not sure Bill appreciates that as much as I do... 

Ali

Posted by a_pasha | 2 Comments
Filed under:

Service/DataContract Versioning

It was sooo hard to find this link and I knew what I was looking for, so I thought I'd post it here for the benefit of others.

The 'official' data contract/service versioning story is here: http://windowssdk.msdn.microsoft.com/library/default.asp?url=/library/en-us/WCF_Con/html/4a0700cb-5f5f-4137-8705-3a3ecf06461f.asp

http://windowssdk.msdn.microsoft.com/library/default.asp?url=/library/en-us/WCF_con/html/bf0ab338-4d36-4e12-8002-8ebfdeb346cb.asp

I know that this may not satisfy a lot of people both internally and externally, but it is a simple story that just happens to be the POR for versioning in the V1 timeframe frame for WCF. From a tooling perspective, I think that we should at least make this story easier until there is a better one to tell.

Ali

Posted by a_pasha | 1 Comments

On factories, factories, factories...

Why I Hate Frameworks: http://discuss.joelonsoftware.com/default.asp?joel.3.219431.12

Internally, I feel that these are the kind of discussions that we have every day. If, for example, we talk about adding a tool window, we usually also start talking about an extensible method for extending the designer to allow users to add their specific tool window should they not like ours. Then it somehow turns into a discussion about coming up with a way to easily snap in any window, not necessarily just a tool window, and provide a way to customize the window to be a tool window.  And on and on...

In a nutshell, when we talk about designing a feature we start talking about extensibility so that anyone can also add a similar or related feature. With that discussion, we often have to talk about the level of extensibility that we want to support. It's no longer as simple as just adding the feature. So the discussion similar to the factory factory factory mentioned in the blog is something that takes place very commonly.

My personal feelings is that there may be a need for a factory, factory, factory given the context. There is, after all, a great need for DSL tools.

Users, however, should not have to deal at that level if they don't have to. If they want a hammer, give them the hammer! Most people don't care about the factory it was built in...

Ali

Posted by a_pasha | 0 Comments

I'm a Mort when it comes to DSL tools!

Senior members in our team have suggested that PM team should start using the DSL tools to prototype some of the new architecture models/designers that are being proposed. Consequently, I've been laboring away on my DSLs for the last few days and  Pedro's been a great help. However, there are two things that I (WARNING: Controversial statements about to ensue. Please read my disclaimer) do not agree with.

The first has to do with the target persona for the DSL tools. Which I was told was the Elvis/Einstein persona for at least v1. The belief is that you need to be at that level to be building DSLs. Well, I'm a Mort! As I write this, I wonder if I have just committed career suicide...:)

This, jokes aside, does not mean that I’m not smart guy. I understand my domain and  I want to model the domain in order to get a designer up and running in to perform the tasks specific to my domain. I'm not interested in the DSL tools themselves per se, I'm interested in the solving my problem as quickly as possible. The idea is around RAD development for the prototype, so that we can incorporate feedaback as quickly as possible and get buy-in to spend the money to build the real tool. Which I leave that to dev team, with the personalities best described as  Elvis and Einstein.

Pedro, after hearing this conversation in the hallway, forwarded me specs about the next interation of DSL tools. While I'm not sure that Pedro bought into the fact that DSL tools should be for the Mort user, the new upcoming features I feel are a leap towards helping Morts build their DSLs.

Ali

Posted by a_pasha | 1 Comments
Filed under: ,
More Posts Next page »
 
Page view tracker