The XML and Web Services Perspective continues with Don, Tim and Martin. Heavy going after lunch,but much better than the first session. This session had more useful content that matched the audiences level of understanding (a very advanced audience).
The future of Remoting: SoapFormating SOAP stack
SoapFormatter is dead. It is the one part of the .NET platform that we'd recall if we were available. It is the SOAP stack underneath .NET remoting. .NET remoting works in situations where you have .NET on both sides of the pipe ('living the COM dream without reference counting' as Don say). is one part of the .NET platform that we'd recall if we were able to.
What is SOAP about?
SOAP is primarily about extensibility, it is designed to allow us to evolve services. The service provider and consumer may evolve at different times. It is important that the server is able to evolve the service without disrupting the established clients.
SOAP 1.2 will be the last version of the protocol. Ever.
There's wont ever be another version of the SOAP protocol. SOAP 1.2 is the last version that we will ever need. Don justifies this with two arguments. Firstly, no one gets a third chance at it. SOAP 1.1 is here and will be with us for a long, long time, we wont get rid of it. SOAP 1.2 is here and we should move to it but this will happen slowly (like the conversion of IPv4 to IPv6). It wont be practical to support more versions of SOAP.
SOAP 1.2 is in the next version of .NET, would have been in earlier (Windows 2003) if it was in a final state as a specification.
SOAP is not just for serialized object graphs
SOAP can be used to serialize an object graph, but this is a lifestyle choice, a subject decision. There's nothing about SOAP that says it has to be like this.
SOAP Headers and SOAP 1.2
SOAP has headers that are extensible. They are meant for the ultimate receiver rather than any intermediaries. The headers have the mustUnderstand element which means that it must be processed successfully, as well as an actor tag that specifies which intermediary is designed to process the message.
Because the headers must be processed before the body is processed, most of the SOAP stack implementations buffer the headers and then stream the body.
SOAP 1.2 adds the s:relay attribute which means that the header is targeted for the current intermediary, but that it can be ignored. However, if it isn't processed it shouldn't be removed from the message - it should be passed on to the next intermediary (presumably changing the actor tag on the way).
There's also a well-known URI 'http://schemas.xmlsoap.org/soap/envelope/next' means the next intermediary should process it. As Don says, 'everyone plays the role of next - it's the Iunkown of SOAP'.
WSDL
Don made us stand up and recite 'WSDL sounds really fun, please tell us how it works'. WSDL is more difficult. Don mentions several times that many of the flexibility points in WSDL were because they weren't sure that Web Services would end up using XML Schema as the type descriptions, and SOAP as the binding. WSDL provides for other type descriptions and bindings, but XML Schema and SOAP are the most common.
Some very funny stuff when they went through Doc/Literal RPC/encoded choices in the WSDL. Basically at each attribute Don said 'there is no other way'. Good laugh, obviously everyone in the room understood that document/literal is the way to go.
Don also joked about the '.NET WSDL parser'. If you run the WSDL.exe tool before adding the binding then if it's successful there will be a 'no classes generated' message, but at least no exception.
AXM Security and Web Services
Tim did some great debugging of IIS and the directory to solve a permissions problem. When it failed first time, Don made the joke that it was not a failure but was 'locked down by default'. Don also made the point that the way the problem was attacked was to change the server until the client message came through (through giving anonymous access to the virtual directory), rather than the better approach which is to give the security credentials to the client (through using the proxy object).
Polymorphic data and serialization
Tim made the point that WSDL generation mandates knowledge of all types at compile time. If you want to use derived types then you have to use the [XmlInclude] attribute so that the SOAP receiver understands where it must look to see if a type has a derivation somewhere. The alternative is that the SOAP stack would have to look through all of the referenced assemblies.