WCF: Main Types: Outline

Notes

%u00b7 Bindings are spread across several namespaces.

%u00b7 DataContractAttribute is placed in the System.Runtime.Serialization namespace not in the System.ServiceModel namespace.

%u00b7 Configuration sections are spread across several namespaces.

%u00b7 ClientSection and ServicesSection: First has the structure client/endpoint, the second – services/service/endpoint. Asymmetric.


System.ServiceModel.dll

System.ServiceModel

%u00b7 ServiceHost

%u00b7 ChannelFactory<TChannel>

%u00b7 ClientBase<TChannel>

Contracts:

%u00b7 ServiceContractAttribute

%u00b7 OperationContractAttribute

%u00b7 MessageContractAttribute

%u00b7 FaultContractAttribute

Bindings:

%u00b7 BasicHttpBinding

%u00b7 NetMsmqBinding

%u00b7 NetNamedPipeBinding

%u00b7 NetPeerTcpBinding

%u00b7 NetTcpBinding

%u00b7 WS2007FederationHttpBinding

%u00b7 WS2007HttpBinding

%u00b7 WSDualHttpBinding

%u00b7 WSFederationHttpBinding

%u00b7 WSHttpBinding

Exceptions:

%u00b7 CommunicationException

%u00b7

System.ServiceModel.Activation

%u00b7 ServiceHostFactory

System.ServiceModel.Activation.Configuration

%u00b7 DiagnosticSection

System.ServiceModel.Channels

Interfaces:

%u00b7 IChannel

%u00b7 IChannelFactory<TChannel>

%u00b7 IChannelListener<TChannel>

Abstract classes:

%u00b7 Binding

%u00b7 BindingContext

%u00b7 BindingElement

%u00b7 ChannelFactoryBase<TChannel>

%u00b7 ChannelListenerBase<TChannel>

%u00b7 CommunicationObject

%u00b7 Message

%u00b7 MessageHeader

%u00b7

Bindings:

%u00b7 CustomBinding

Binding Elements:

%u00b7 TransportBindingElement

%u00b7 MessageEncodingBindingElement

%u00b7

System.ServiceModel.Configuration

Sections:

%u00b7 BehaviorsSection

%u00b7 BindingsSection

%u00b7 ClientSection

%u00b7 DiagnosticSection

%u00b7 ServicesSection

Element: System.Configuration.ConfigurationElement

%u00b7 BaseAddressElement

%u00b7

ElementCollection: System.ServiceModel.Configuration.ServiceModelEnhancedConfigurationElementCollection<ComMethodElement>

%u00b7 BaseAddressElementCollection

%u00b7

System.ServiceModel.Description

%u00b7 ServiceEndpoint

Behavior interfaces:

%u00b7 IContractBehavior

%u00b7 IEndpointBehavior

%u00b7 IOperationBehavior

%u00b7 IServiceBehavior

Descriptions:

%u00b7 ContractDescription

%u00b7 FaultDescription

%u00b7 ServiceDescription

System.ServiceModel.Dispatcher

%u00b7 ChannelDispatcher

%u00b7 EndpointDispatcher

Filters:

%u00b7 ActionMessageFilter

%u00b7 MatchAllMessageFilter

%u00b7 MessageFilter

%u00b7

System.ServiceModel.MsmqIntegration

%u00b7 MsmqIntegrationBinding

System.ServiceModel.Security

Credentials:

Encoders:

System.ServiceModel.Security.Tokens

Tokens:

SecurityTokenParameters:


System.Runtime.Serialization.dll

System.Runtime.Serialization

Attributes:

%u00b7 CollectionDataContractAttribute

%u00b7 DataContractAttribute

%u00b7 DataMemberAttribute

%u00b7 EnumMemberAttribute

MDC 2008 – Minnesota Developer’s Conference…

MDC 2008 – Minnesota Developer’s Conference…

At this year’s MDC, I’ll
be doing a talk on Team Foundation Server 2008 and Scrum – all about where state
of the art stands with TFS 2008 and Scrum process integration.  We’ll
cover Microsoft’s eScrum, Conchango’s Scrum for Team System, and perhaps
a few others to boot.

September 9, 2008 – Marriott
Southwest
.

The whole conference looks great – check out the speakers
and sessions.

Software Development Meme…

Jeff Brand has tagged
me
to answer a few questions on how I got started in this business…

I never do anything personal in this space, so this will be a first.  Here goes:

How old were you when you started programming?

Ummm, my grandfather supplied us with a TRS-80 Model 1 Level 1 (4k, cassette drive)
when I was about 8 years old.  It started there, and proceeded through everything
Radio Shack had to offer for quite some time.  No artsy Commodores/Amigas/Apples
at our house…

What was your first language?

BASIC.

What was the first real program you wrote?

Gosh.  I tried my hand at writing a basic word processor for the TRS-80
– I think I called it TextStar.  I’m sure I lost some school
reports as a result.  In that general timeframe were some text-based adventure
games, too…

What languages have you used since you started programming?

Hmmm.  Basic and QuickBasic as a kid.  Pascal and Fortran in college. 
C and C++ in all my early jobs in this field (along with VB6 to test all those COM
components…)  After that, the only language I’ve approached seriously is
C#.  (Does BizTalk count?)  I dabbled in a lot of other languages, but haven’t
done project work, where you learn all the ins and outs…

What was your first professional programming gig?

As a college intern at CyberOptics, writing
all kinds of applications for laser and vision-based inspection systems.  Very
fun stuff, and some of the best mentoring I’ve ever had.  And hey, what
doesn’t spell fun like writing your WndProcs for Windows 3.0 ?

If you knew then what you know now, would you have started programming?

Certainly!  This has been a great industry to be a part of.  I had
serious dreams of pursuing music as a career at one time, but as David
Chappell
once said, regardless of what artistic value you might attach to a given
gig, you’re really just there to sell beer.

If there is one thing you learned along the way that you would tell new developers,
what would it be?

Focus on the practice/art, more so than individual technologies.  Realize that
the people you work with are the first order function for success, rather than
a given technology choice.

What’s the most fun you’ve ever had…programming?

I’ve always had the most fun when I’ve had the opportunity to work with
a team that is “long-lived”, small, and dangerously focused. 

Often in this industry we work with team sizes (and organizational dynamics) that
breed ineffectiveness.  It is amazing how much more apt you are to
wake up before the alarm when team productivity is at its peek — and “in
the zone” becomes normal.

Who am I calling out?

Loren Halvorsen

Matt Milner

Jon Flanders

Stephen Kauffman

 

 

 

Handling SOAP Exceptions in BizTalk Orchestrations with WCF Send Adapter

Below is an idea how to improve SOAP exception handling in BizTalk to WCF communication. Let’s consider approach recommended in BizTalk SDK documentation (Catch Typed Fault Exception sample):
  1. Add custom WCF fault to the service contract and add corresponding exception handler in the BizTalk orchestration.
  2. In BizTalk orchestration add hander that expects System.Web.Services.Protocols.SoapException to catch any general SOAP exceptions
This allows catching any custom WCF faults and handling them gracefully. It also handles general SOAP exceptions but the downside is that SOAP exception caught will not be original SOAP fault that came over the wire from the service. It’s going to be secondary SOAP exception thrown by the adapter. Receive pipeline will try to match incoming message type using XPath expressions defined in the send port configuration. Since custom WCF faults are embedded as content of Detail node of the soap:Fault message there will be XPath expression like this: /*[local-name()=’Fault’]/*[local-name()=’Detail’]/* | /*[local-name()=’DivideResponse’], where the first part is matching any child of Detail element. In case if WCF service returns general SOAP fault it will put original exception in Detail element as ExceptionDetail node (QName: http://schemas.datacontract.org/2004/07/System.ServiceModel#ExceptionDetail). Since the schema for ExceptionDetail is unknown to pipeline it will throw SOAP exception with generic description and all original details will be lost. This secondary SOAP exception is the one that actually caught by our generic handler:
There was a failure executing the response(receive) pipeline: “Microsoft.BizTalk.DefaultPipelines.XMLReceive, Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35” Source: “XML disassembler” Send Port: “WcfSendPort_BatchEntityService_BasicHttpBinding_IBatchEntityService” URI: “http://100-bztlk-d-009.absg.net/Absg.eCommerce.Ordering.ServiceHost/BatchEntityService.svc” Reason: Finding the document specification by message type “http://schemas.datacontract.org/2004/07/System.ServiceModel#ExceptionDetail” failed. Verify the schema deployed properly.
One solution to this problem is to define http://schemas.datacontract.org/2004/07/System.ServiceModel#ExceptionDetail schema and include it as a fault contract for the WCF operation on the client side. That way all original SOAP fault details can be captured and propagated as ExceptionDetail fault. So that’s how I modified BizTalk orchestration in SDK sample:
  1. Declared new schema ExceptionDetail.
  2. Created new multi-part message type IOperation_Divide_SoapFault that has part of type ExceptionDetail
  3. Added to Divide operation new GenericSoapFault fault of type IOperation_Divide_SoapFault
  4. Added exception handler CatchSoapExceptionDetails for this new fault
Notice no changes required on the service side, all I had to do is on the client. But I did one thing in the service code to throw SOAP exception if numerator equal to 0 (just to be able to test such scenario):
if (numerator == 0)
throw new System.Web.Services.Protocols.SoapException(“Test exception”, new XmlQualifiedName(“A100”));
Dropping input file with 0 as numerator (DivideGenerateSOAPExceptionInput.xml) will create following message in the Fault folder:
<?xml version="1.0" encoding="utf-8"?><MyOperationException xmlns="http://schemas.datacontract.org/2004/07/Service" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <Error>&lt;ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&gt;&lt;HelpLink i:nil="true" /&gt;&lt;InnerException i:nil="true" /&gt;&lt;Message&gt;Test exception&lt;/Message&gt;&lt;StackTrace&gt;   at Service.Operator.Divide(Int32 numerator, Int32 denominator) in C:\Projects\TestBed\Typed Fault Exception Handling\WcfService\Program.cs:line 37
   at SyncInvokeDivide(Object , Object[] , Object[] )
   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]&amp;amp; outputs)
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp;amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp;amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc&amp;amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc&amp;amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc&amp;amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc&amp;amp; rpc)
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)&lt;/StackTrace&gt;&lt;Type&gt;System.Web.Services.Protocols.SoapException&lt;/Type&gt;&lt;/ExceptionDetail&gt;</Error>
  <Operation>Divide</Operation>
</MyOperationException>

Note it contains exception detail section with original “Test exception” message.

Another approach would be to use exclusively SOAP faults for all kind of custom and system faults, reducing number of exception handlers in orchestrations to one. It can be achieved by implementing custom XML Disassembler pipeline component where incoming message would be inspected and if SOAP Fault is detected all properties can be copied to secondary SOAP fault thus preserving all original exception details.

Notice that we received original exception detail with the “test exception” in this message.

BTSUG: Jun 25th – BizTalk RFID – come and test the System to be used at Tech08

Hi folks, we’ve got a great night coming up on this Wednesday – Jun25th
Wednesday


This session we need to do *testing* of our developing RFID Event
Tracking system. This planned to be deployed right throughout TechEd08!!!!

 

Your help is needed – you’ll get Tags, walk through RFID Readers
and get hands on with the gear.

We’ll show you how it’s being developed, the Silverlight V2.0 Beta
2 Duplex HTTP WCF Services that drive the UI screens.

 

So if you’re looking at tracking clothes, wheelchairs, beers in
the fridge or any sort of warehouse tracking then this is a must see session for you.

(RFID is much more than just ’production line’ or ’supply chain’
tracking)

 

We will cover:

(1)    The
components of BizTalk RFID

(2)    Connecting
and using the RFID H/W

(3)    Different
forms of RFID Readers (including windows mobile readers)

(4)    How
to manage 70+ RFID Devices through System Center Operations Manager and the BizTalk
RFID Management Pack

 

What
is in store for our June 25th Session (add to
Outlook)

Where:
Microsoft, North Ryde
1 Epping Road

When:
6pm – Beer + Pizza
6.30pm – Kick off

June
25th

Feel
free to forward this to any of your colleagues/friends I may have missed (tell them
to register on the Sydbiz.org site to be included)

Call
for Speakers/Other People to take Tyre Kicking Sessions


If you’ve got any aspect of BizTalk (& related) that you want to share with us….let
me know, love to hear what you’ve got to say.

Don’t forget – we’re launching a email forum group ’oztalk@groups.yahoo.com’
Great to see a lot of you already joined – it’s a *private* group open to BizTalk
User Group members (we currently have Brisbane, Auckland and Sydney on)
Invite only – send me an email if you want to join and I’ll send you out an
invite.

Love
to see you there – and reply to this email to let me know for catering.

Cheers,

Mick Badran (MVP
– BizTalk) | Microsoft Readiness Instructor
Collaboration and Integration Specialist
Breeze|
m: +61 404842 833

http://blogs.breezetraining.com.au/mickb
| im: