BizTalk WCF-SQL Adapter Error: Retrieval of Operation Metadata has failed while building WSDL at TypedPolling

  • Sandro Pereira
  • Apr 8, 2024
  • 3 min read

Today, while importing/generating a WCF-SQL schema for a new BizTalk Server solution, we got the following error inside Visual Studio:

Error while retrieving or generating the WSDL. Adapter message: Retrieval of Operation Metadata has failed while building WSDL at ‘TypedPolling’

failed while building WSDL at TypedPolling

This is a fairly generic error, and to get more insight, you need to click on Details.

Microsoft.ServiceModel.Channels.Common.MetadataException: Retrieval of Operation Metadata has failed while building WSDL at ‘TypedPolling’ —> System.Data.SqlClient.SqlException: Could not find stored procedure ‘dbo.<stored-procedure-name>’.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)

failed while building WSDL at TypedPolling

📝 One-Minute Brief

Troubleshoot the BizTalk Server WCF‑SQL Adapter error “Retrieval of operation metadata has failed while building WSDL at TypedPolling” and learn the root cause along with the correct configuration fix.

Cause

As the description states, the generator tool was unable to locate the stored procedure in the SQL database.

Because this was an inbound operation (polling), the first task I performed was to validate the stored procedure’s existence and check for a spelling error in the polling statement’s configuration. No spelling error was observed, and the stored procedure existed in the database.

The second thing you should do is to disconnect and verify that the URI configuration is correct with regard to the SQL Server and instance name, as well as the database name.

In my case, I forgot to specify the database name, which means the InitialCatalog property.

InitialCatalog property

Because we configure the Server and InstanceName properties, we are able to connect the server, but when the tool tries to generate the Schemas, it doesn’t know where to connect.

Solution

Solving this issue is quite simple:

  • You need to make sure that you configure the URI properties properly:
    • Server property, with the name or network address of the host machine on which SQL Server resides.
    • InstanceName property, with the instance name of SQL Server to connect to. If you need to connect to the default instance, you need to leave this property empty.
    • InitailCatalog property, with the name of the database to which to connect.

After doing that, I was able to successfully generate the SQL schemas

Hope you find this helpful! So, if you liked the content or found it useful and want to help me write more, you can buy (or help me buy) my son a Star Wars Lego! 

Buy me a coffee
Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc. He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.

Leave a Reply

Your email address will not be published. Required fields are marked *

The Ultimate Cloud
Management Platform for Azure

Supercharge your Azure Cost Saving

Learn More
Turbo360 Widget

Back to Top