Message inspector – huh?? whats that??

A message inspector is an extensibility object that can be used in the service model’s client runtime and dispatch runtime programmatically or through configuration and that can inspect and alter messages after they are received or before they are sent.

Click here for more…

Invoking restful services with BizTalk 2010

ReST supports GET, PUT, POST, and DELETE methods. So, if one has to use ReST with BizTalk Server, the adapter to be used should be able to:
•Exchange non-SOAP messages.
•Support GET, PUT, POST, and DELETE methods.

If we look at the adapters available with BizTalk Server 2010, only the HTTP adapter satisfies the first criteria but it does not support GET (it does support the POST method). Similarly, the webHttpBinding (that supports consuming and exposing ReSTful services) available with WCF-Custom adapter can send non-SOAP messages but that too has no way of specifying the HTTP verb to be used. All other adapters either do not support HTTP verbs or always exchange SOAP messages. So, there is no way to have an out-of-box BizTalk configuration to consume a ReSTful service. To use BizTalk Server with ReST, we’ll have to do some customizations around HTTP adapter or the webHttpBinding of the WCF-Custom adapter. There is no prescribed way of doing customizations around the HTTP adapter. However, to the webHttpBinding, we can add some custom behaviors that when coupled with webHttpBinding enable BizTalk users to invoke and consume ReSTful services. Through these customizations, we can specify the following:
•The HTTP method to use in the request (GET, PUT, POST, DELETE).
•How to form the request URL from operation method parameters (URL path and query string template).
•How to encode the request body and decode the response.

With WCF-Custom port configuration, there’s no way of specifying these customizations directly on the webHttpBinding. So, we’ll have to put these values in the request message. After specifying the values as part of the request message and adding a custom behavior to the webHttpBinding, when the request message hits the WCF-Custom port with the webHttpBinding, the custom behavior extracts the values from the request message and frames the required HTTP transport.

See this link to read more…

See this link for sample code.

Adding WCF service references to multiple projects

If you have multiple projects in your solution and more than one project references a common WCF service, you might have issues to get your application working as BizTalk will not be able to determine the destination schema. The schemas (created by the service references in each project) get deployed resulting in multiple schemas with the same target namespace.

You will see an exception similar to below:

Cannot locate document specification because multiple schemas matched the message type

In such scenarios, it is best to create a seperate project for service references. This project can then be referenced by other projects wanting to call the WCF service.

[WCF] HTTP could not register URL (wcf url) .Your process does not have access rights to this namespace

While hosting BasicHttpBinding WCF service in windows service , I came across the following error.

HTTP could not register URL (wcf url) .Your process does not have access rights to this namespace

The error occurs due to the service account does not have access rights to the namespace.

This is a HTTP WCF Service delegated error, (in other words, this won’t occur if you are hosting Named-Pipe WCF serivces)

To grant the service account access right, in Windows 2008

  1. Open command prompt with administrator account
  2. Execute the following command

netsh http add urlacl url=WCFURL user=DOMAIN\username

You should get a message saying “URL reservation successfully added