27 July, 2010

ESB Toolkit and UDDI: Binding a UDDI service to SQL

Maybe I was just blind or stupid when I needed to do this, but it took me a while to find some info on how to set up bindings for SQL in UDDI. So I'm noting these down for next time...

Context: Building a solution using BizTalk 2009 and the ESB Toolkit. I need to call a SQL stored procedure to return price data for a given product. Schemas have already been created using the WCF LOB adapter. Now I want to use a UDDI resolver to configure my off-ramp.

  1. Browse to the publish tab in UDDI
  2. Right click on the desired provider and choose "add service"
  3. Either specify a key or allow the system to generate one
  4. Edit the service name (eg. GetPriceData)
  5. Right click on the service (or click on the bindings tab) and add a binding
  6. Configure the endpoint - instead of an http service, we have an mssql service, so the endpoint will be in this format: mssql://databaseservername//databasename?
  7. Configure the transport type: Add a category and select the scheme microsoft-com:esb:runtimeresolution:transporttype. Choose a value of WCF Custom Binding.
  8. Configure the BizTalk application: Add a custom category and search for tModels using %biztalk%. Select microsoft-com:esb:runtimeresolution:biztalkapplication. Type "BizTalk Application" for the key name and the name of the your BizTalk application container (this is in your admin console) for the key value.
  9. Add instance info (search for tModels containing %esb%) - you need to add the following:
  • microsoft-com:esb:runtimeresolution:transporttype (use WCF-Custom, by which I mean set the instance parameter to WCF-Custom)
  • microsoft-com:esb:runtimeresolution:targetnamespace (target namespace of your SQL schema - in my case http://schemas.microsoft.com/Sql/2008/05/TypedProcedures/dbo )
  • microsoft-com:esb:runtimeresolution:action (the correct action is in your schema, if you created it using the WCF LOB adapter - in my case it was {TypedProcedure/dbo/GetPrice} - note that you need to enclose the action in curly braces)
  • microsoft-com:esb:runtimeresolution:messageexchangepattern (use "Two-Way", if you're sending a request and expecting a response)
  • microsoft-com:esb:runtimeresolution:jaxrpcresponse (set to "false")
  • microsoft-com:esb:runtimeresolution:cachetimeout (set to "-1")
  • microsoft-com:esb:runtimeresolution:endpointconfig (set to "BindingType=sqlBinding")

To get the key to use in your resolver, click on the service name. On the details tab, click the "more details" link on the right. This brings up the UDDI keys. Copy the value for the version 3 key into the "service key" property for the UDDI resolver in your itinerary.

No comments:

Post a Comment