Thursday, June 26, 2008

Publishing Schemas as Web Services: "This invalid type may be from a property schema"

Few days ago, I was trying to publish a schema as a Web Service through BizTalk Web Services Publishing Wizard. When I tried to test this Web Service through a Xml Validation pipeline, I received the error "This invalid type may be from a property schema":

This error is due the fact that the BizTalk Web Services Publishing Wizard sets the DocumentSpecName when invokes the web method. My problem was, that my schema had two root nodes and BizTalk Web Services Publishing Wizard don't set in DocumentSpecName the root node:

string bodyTypeAssemblyQualifiedName = "Company.ESB.PC02._02.SOAPService_company_es_ConectorWS_servi" + "ces_SN627003, Company.ESB.PC02.02, Version=1.0.0.0, Culture=neutral, Public" + "KeyToken=9431070526ed7a05";

There are two approaches to resolve this problem:

1) Set the root node in the Web Service:

string bodyTypeAssemblyQualifiedName = "Company.ESB.PC02._02.SOAPService_company_es_ConectorWS_servi" + "ces_SN627003+Root1, Company.ESB.PC02.02, Version=1.0.0.0, Culture=neutral, Public" + "KeyToken=9431070526ed7a05";

2) Set to null this param in the Web Service:

object[] invokeResults = this.Invoke("WebMethod1", invokeParams, inParamInfos, outParamInfos, 0, null, inHeaders, inoutHeaders, out inoutHeaderResponses, out outHeaderResponses, null, null, null, out unknownHeaderResponses, false, false);

Thursday, June 05, 2008

BizTalk Expert Series

QuickLearn offers new BizTalk specialized courses in advanced topics:

- BizTalk Expert Series: Business Activity Monitoring (BAM)
- BizTalk Expert Series: Business Rule Engine (BRE)
- BizTalk Expert Series: RFID Solutions
- BizTalk Expert Series: ESB Solutions
- BizTalk Expert Series: EDI Integration
- BizTalk Expert Series: Testing Strategies

More information in QuickLearn site.

Sunday, June 01, 2008

ESB Guidance: Get Map from UDDI

Inside ESB Guidance, we can use UDDI to get TransportType, TransportLocation, ... and also we can get from UDDI the Map to apply.

First of all, we have to insert an UDDI service, with TransformType property and the value of the map that we will want to apply (map name and assembly), for example:



In previous example, I have setted the value "TransformType://GlobalBank.ESB.DynamicResolution.Transforms.SubmitOrderRequestNA_To_SubmitPurchaseOrderRequestCN,GlobalBank.ESB.DynamicResolution.Transforms, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c2c8b2b87f54180a".

Next, we add a Receive Location and use a Receive Pipeline with a ESB Dispatcher Disassembler Component, for example. We set the component's MapName property, to our UDDI service connection string, for example:

UDDI:\\serverUrl=http://localhost/uddi;serviceName=MyService;serviceProvider=MyProvider

Finally, we have to do a little change inside the ESB's resolver UDDI class (Microsoft.Practices.ESB.Resolver.UDDI.ResolveProvider). Inside the CopyResolution method, add inside the try block this line:

if (!string.IsNullOrEmpty(source.TransformType)) destination.TransformType = source.TransformType;

Now, we can use UDDI to get the transformation to apply.