BizTalk Server Tutorial

BizTalk Server Concepts and Common Errors

Object reference not set to an instance of an object – BizTalk WCF Service Consuming Wizard

While consuming a WCF Service using BizTalk WCF Service Consuming Wizard you may end up with an error..

“Error consuming WCF service metadata.

Object reference not set to an instance of an object”

One possible reason for this issue is that the WSDL Generated after consuming the Service might not have any namespace for the schema to be imported.

This can be resolved in simple steps as below.

  1. Generate the metadata for the Service using Svcutil.exe as given below.
  2. C:\>svcutil /target:metadata <WCF Service Address>

  3. The above command will generate the Wsdl file and XML Schema file.
  4. Copy the Target namespace from the XML Schema file (.xsd file) and paste it in the <xsd:schema> node of the wsdl file.
  5. The Resultant <xsd:schema> node of the wsdl file should look some thing like this. <xsd:schema targetNamespace=”http://Something.com”&gt;
  6. Now run the BizTalk WCF Service Consuming Wizard and select the second option.
  7. Add both the wsdl and schema file to the Wizard.
  8. Import should now be successful.

Post your comments if any has an alternate solution.
– Shiv


Web Counters

November 2, 2010 - Posted by | Orchestrations | ,

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: