Tuesday, May 26, 2009

Commerce Server Inventory Adapter Error: “Finding the document specification by message type "MSInventoryCollection" failed. Verify the schema deployed properly.”

 

I have been coding some sample updates on the Inventory Adapter for Commerce Server (2006 R2 version) on BizTalk 2009. I encountered a funny error.

Note that this is a simple flow that bypasses the message box all together. It is a simple file drop receive location with an XML transmit to an XML receive send port via the Inventory Adapter.

The error that I got was:

There was a failure executing the receive pipeline: "Microsoft.BizTalk.DefaultPipelines.XMLReceive, Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Source: "XML disassembler" Receive Port: "InventorySchemaReceive" URI: "C:\demo\Output\InventoryInput\*.xml" Reason: Finding the document specification by message type "MSInventoryCollection" failed. Verify the schema deployed properly.

Research did not get me anywhere. So I did what every normal BizTalk guy would do… that is right, I flipped it to “passthrough” on both the receive and send side and got the following errors:

The adapter "Commerce Server Inventory Adapter" raised an error message. Details "Failed to create the Inventory Service Agent in 'Commerce Server Inventory Send Adapter'.  Please check that you have a valid URL and that it is accessible. If the URL is valid, please check that you have configured your web proxy settings correctly.  Message: Index (zero based) must be greater than or equal to zero and less than the size of the argument list..  Stack   at System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String format, Object[] args)
   at System.String.Format(IFormatProvider provider, String format, Object[] args)
   at Microsoft.CommerceServer.BizTalk.Adapters.CommonUtilities.ConnectToCatalogService(CommonConnectionProperties connectionProperties, String service, String eventViewId)
   at Microsoft.CommerceServer.Adapter.Inventory.SendAdapterProperties.LocationConfiguration(XmlDocument endpointConfig).".

and

The adapter failed to transmit message going to send port "SendtoInventory" with URL "CommerceServerInventorySend://SendInventory/http://localhost/DefaultSite_CatalogWebService". It will be retransmitted after the retry interval specified for this Send Port. Details:"Failed to create the Inventory Service Agent in 'Commerce Server Inventory Send Adapter'.  Please check that you have a valid URL and that it is accessible. If the URL is valid, please check that you have configured your web proxy settings correctly.  Message: Index (zero based) must be greater than or equal to zero and less than the size of the argument list..  Stack   at System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String format, Object[] args)
   at System.String.Format(IFormatProvider provider, String format, Object[] args)
   at Microsoft.CommerceServer.BizTalk.Adapters.CommonUtilities.ConnectToCatalogService(CommonConnectionProperties connectionProperties, String service, String eventViewId)
   at Microsoft.CommerceServer.Adapter.Inventory.SendAdapterProperties.LocationConfiguration(XmlDocument endpointConfig).".

Ultimately, the error that put things on track was the following:

Failed to create the Inventory Service Agent in 'Commerce Server Inventory Send Adapter'.  Please check that you have a valid URL and that it is accessible. If the URL is valid, please check that you have configured your web proxy settings correctly.  Message: Index (zero based) must be greater than or equal to zero and less than the size of the argument list..  Stack   at System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String format, Object[] args)
   at System.String.Format(IFormatProvider provider, String format, Object[] args)
   at Microsoft.CommerceServer.BizTalk.Adapters.CommonUtilities.ConnectToCatalogService(CommonConnectionProperties connectionProperties, String service, String eventViewId)
   at Microsoft.CommerceServer.Adapter.Inventory.SendAdapterProperties.LocationConfiguration(XmlDocument endpointConfig).

I then found a bug in the Inventory adapter configuration:

image

The Web Service URL had a space in the URL and after this, the adapter worked fine in both XML transmit and Pass Thru with the following message:

The inventory import process started.

No comments: