Mike Taulty's Blog
Bits and Bytes from Microsoft UK

June 2005 - Mike Taulty's Blog

Blogs

Mike Taulty's Blog

Elsewhere

  • ScottGu on ASP.NET 2.0, the Atlas project and AJAX

    Nothing that I can add here other than to link to the post: http://weblogs.asp.net/scottgu/archive/2005/06/28/416185.aspx
  • Excellent post on Avalon application deployment

    One of the things that I've been finding most puzzling about Avalon applications is what the mix is between deploying the application to the client and running it off a web server. This post http://nerddawg.blogspot.com/2005/06/avalon-deployment-story.html covers that really nicely.
  • WSE 3.0 Preview: Reliable Messaging Sample Available

    There's a sample implementation of reliable messaging for the WSE 3.0 Technical Preview been made available up here http://msdn.microsoft.com/webservices/default.aspx?pull=/library/en-us/dnwse/html/wseandws-rm.asp#wseandws-rm_topic5 I've yet to have a chance to play with this but it looks very cool indeed - testament to the power of the architecture of these stacks that you can plug these bits post installation
  • WSE3.0 Preview: Authorization and Tokens

    This is not new functionality in WSE3.0 but I thought I'd pick it out anyway. With WSE you can pass different kinds of tokens to a service to identify yourself - out of the box these are Username, Kerberos and X509. When the service receives one of these identifying tokens it can try and work out whether that's a valid token and try to construct an identity from it (i.e. "This SOAP message came from Fred") by using a SecurityTokenManager. There are a number of SecurityTokenManager's in the framework for managing the different token types (username, kerberos, x509 and more esoteric ones). As an example, when a UsernameToken arrives at a WSE service then by default the UsernameTokenManager attempts to use the credentials supplied to log in to Windows. If that doesn't work, the message gets bounced. If you want to change this behaviour then you need to write and register your own UsernameTokenManager to do something else (perhaps look up credentials in a database). public class Manager : UsernameTokenManager...
  • Free Books on MSDN.

    I just wanted to highlight that there are a couple of free, online books around Visual Basic 2005 for developers who are working with VB6 today; Upgrading Microsoft Visual Basic 6.0 to Microsoft Visual Basic .NET http://msdn.microsoft.com/vbrun/staythepath/additionalresources/upgradingvb6/ Introducing Visual Basic 2005 for Developers http://msdn.microsoft.com/vbasic/whidbey/introto2005/
  • WSE 3.0 Preview: Updated WSE 3.0 Tracing Tool

    I've had a go at porting my WSE Tracing Tool (see here and here ) to work with the June WSE 3.0 Community Technical Preview which, in turn, requires .NET Framework 2.0 Beta 2 and plugs in to Visual Studio 2005 Beta 2. The download is here: http://mtaulty.com/downloads/Wse3Trace.zip - please feel free to try it out and let me know whether or not it works for you. It's probably worth saying that the implementation has changed once again :-) The way that I've done tracing with WSE 2.0 in the past has always been to create Filters in the pipeline and the filters simply copy the SOAP message and send it over soap.tcp to the tracing client which displays them in its UI. So, we're using WSE to trace WSE. In creating filters to do tracing the ordering is important. I want my tracing filter to run nearest to the wire but, usually, WSE wants its Security (or tracing) filter to run in that place. I've gone through a couple of iterations on this for WSE 2.0 and then WSE 2.0 Service Pack 2 and now we have a new one which I...
  • WSE 3.0: Playing with policy and security

    With WSE you can choose to apply security to your web services through either code or configuration and most people would choose configuration. You get WS-Security provided features of authenticating who a SOAP message came from, checking the integrity of the message for tampering and also protecting the privacy of the message from people who snoop on it. If you go down the configuration route then you apply it via policy . This means that you deploy a little XML file next to the service and the XML file controls what you are/aren't prepared to send and receive. For instance you can require that your service won't receive a message unless it's signed with a Kerberos token and so on. You can drop a similar policy file next to a client as well and, thereby, get a client and service to have compatible policies so that they can exchange messages. In WSE2.0 you used a configuration wizard to build the policy file specifying your requirements around authentication, integrity and privacy and it spat out a file that complied...
  • WSE 3.0 Preview: Getting to SOAP Envelopes

    Following up on this post: WSE3.0 Preview- Hosting ASMX Web Services over TCP I was wondering how you would manipulate a SoapEnvelope like you did in WSE 2.0 from one of these ASMX web services that you can host either using HTTP in IIS or over TCP using your own host. In WSE2.0 if you were using the TCP transport you could write methods like; [SoapMethod("action")] public void DoSomething(SoapEnvelope envelope) and WSE2.0 would deliver the SoapEnvelope right into your method. You could also do something like; [SoapMethod("action")] public void DoSomething(MyCustomType t) and WSE would do the serialization for you. From what I can see, if you build a WSE3.0 service using the "ASMX programming model" then you can't do; [WebMethod] public void DoSomething(SoapEnvelope envelope) which is not that surprising. What you can still do though inside a "WebMethod" is get hold of the SoapContext; [WebMethod] public void DoSomething() { SoapEnvelope e = RequestSoapContext.Current.Envelope; } and that works whether you choose...
  • WSE 3.0 Preview: Sending binary with the MTOM support

    I’ve been playing a little bit with the Message Transmission Optimisation Mechanism (MTOM) support in WSE 3.0. From my point of view, MTOM’s about moving lumps of binary around in SOAP messages and optimizing that whilst not damaging the “XML ness” of those messages by which I mean being able to present a proper XML Infoset when someone asks for one. MTOM’s meant to be the ultimate replacement for the WS-Attachments technology in WSE2.0 and the guys out there doing SOAP with Attachments (SwA) also agree that MTOM’s the right way to go for moving binary around in SOAP. Because MTOM preserves that “XML ness” it makes it possible to combine MTOM’d messages with things like WS-Security so that you can sign and encrypt your SOAP messages even if they’ve got large lumps of binary in them whereas with WSE2.0 and WS-Attachments today you have to take a different approach for attached binary data. In understanding this stuff, the main thing to get seems to be the XML-binary Optimised Packaging (XOP) spec ( here ). XOP...
  • WSE3.0 Preview: Hosting ASMX Web Services over TCP

    I took some time today to play with the WSE 3.0 Technical Preview that’s just recently become available. One of the WSE3.0 features is .NET Framework 2.0 and Visual Studio 2005 support so the preview requires beta 2 of Visual Studio 2005 so I installed it onto my box that has those things. Then I set about playing with the new feature WSE 3.0 has for hosting ASMX web services over a TCP channel. This is a great idea I created a new class library project in VS 2005 and wrote this code; using System; using System.Web.Services; public class Person { public string FirstName; public string LastName; public int Age; } public class Address { public int Number; public string Street; } public class PersonAddress { public Person Person; public Address Address; } [WebService(Name="PersonService", Namespace="urn:person-com")] public class MyService { public MyService() { } [WebMethod] public PersonAddress Combine(Person p, Address a) { PersonAddress pa = new PersonAddress(); pa.Person = p; pa.Address = a; return (pa); } ...
  • AJAX and .NET

    In follow-up to this post ( http://mtaulty.com/blog/archive/2005/06/12/2765.aspx ) I had a bit of a play with the AJAX.NET wrapper and found it to be pretty good fun. I just wrote a simple ASPX page which displays data out of the Northwind database. In the Page_Load for the page I wrote a little bit of code to register the page for using AJAX and to download some script to the browser. In particular, the script has a function called ClientGetTable which takes a table name and performs the AJAX functionality to go and get that table from the server which returns back a DataSet. There's also a Callback function which is called when the AJAX work is done. This takes the "browser-side" representation of the DataSet and turns it into an HTML table. Finally, there's a bit of script registered for the onload event so that we initially call GetClientTable('shippers') so that there's some data on the screen when the page first loads. The whole page_load function looks like this; private void Page_Load(object sender, System...
  • PDC 05 Buttons

    Once again there's a bunch of "buttons" advertising PDC 05. Not sure why but I always like displaying these so here goes; The only sad thing - I'm not quite sure yet whether I'm going to be able to get to PDC 05. Certainly hope so!
  • Defining web service contracts

    I've been thinking about something very simple. Say I want to write a web service with an operation called something like LookupAddress which takes as part of its data a postcode (or zipcode ). The thing I'm struggling with is that if I want to build that new postcode data type as some kind of restricted string then the only "language" I'm aware of for modelling it is XSD. If I start with anything other than XSD (e.g. a .NET type in ASMX, WSE or Indigo) then I can't model a string that has a specific length and matches a particular regular expression. There's no way of emitting that WSDL (AFAIK) from any of those frameworks. So, I'd have to start with XSD. No? Further, if I do take that XSD and bring it into the environment of my toolkit then I'm a bit stuck because the toolkit can't represent the restriction I've built so it'll get lost at that point.
  • Custom WSDL via SOAP Extensions

    JamesW asked me a question around how you can write an ASMX web service with an operation that looks like; public XmlNode GetData() and yet still return XML schema for the return type from this operation. This caused me to go off and find this article again http://msdn.microsoft.com/msdnmag/issues/02/12/XMLSchemaImporting/default.aspx around how you can do this with SOAP extension reflectors. With the code from the article referenced in my config file I can do; [WebMethod] [return:XmlImportedElement("urn:people-com", "person.xsd", ElementName="person")] public XmlNode GetXml() and now the code from the article will reflect the fact that the XmlNode that I'm returning is meant to be a person from the person.xsd schema. Nice! :-)
  • WSE3.0 and WSE2.0 Tracing Tool

    Just a quick note. In case you're wondering, my WSE tracing tool does not work with the WSE3.0 CTP that's available right now. There's a bunch of work I'd need to do in order to move to Framework 2.0 for the tool (pretty easy work as it happens - pretty much done this). There's a little bit more work around understanding WSE 3.0 and how it's different with respect to filters and policy assertions - the model seems to have changed and it sounds like I'd need to write a custom policy assertion rather than just a filter or two for WSE3.0. No doubt, it's achievable. I'll try and get a version that works "real soon now", just as soon as I get some time to play with WSE 3.0 properly.
1 2 Next >