Reputation: 33978
My scenario seems quite simple:
We have a file with some format, myfileddmmyyhhss.txt, and inside the file we have something like this:
H|3 |20110607235508
V|M006 |HAB8753 |NY|PAS|20151123|232155|M||
V|M006 |HAB8752 |NY|PAS|20151123|232155|M||
V|M006 |HAB8751 |NY|PAS|20151123|232155|M||
T|3 |20110607235508
Also using the sql adapter we generated a schema for executing a stored procedure.
<?xml version="1.0" encoding="utf-16" ?>
- <xs:schema xmlns="http://SqlAdapterFile" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://SqlAdapterFile" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <xs:annotation>
- <xs:appinfo>
<msbtssql:sqlScript value="exec [sp_insertFile] @fileName=" "" xmlns:msbtssql="http://schemas.microsoft.com/BizTalk/2003" />
</xs:appinfo>
</xs:annotation>
- <xs:element name="fileRequest">
+ <xs:annotation>
- <xs:appinfo>
- <properties xmlns="http://schemas.microsoft.com/BizTalk/2003">
<property distinguished="true" xpath="/*[local-name()='fileRequest' and namespace-uri()='http://SqlAdapterFile']/*[local-name()='sp_insertFile' and namespace-uri()='http://SqlAdapterFile']/@*[local-name()='fileName' and namespace-uri()='']" />
</properties>
</xs:appinfo>
</xs:annotation>
+ <xs:complexType>
- <xs:sequence>
- <xs:element name="sp_insertFile">
- <xs:complexType>
<xs:attribute name="fileName" type="xs:string" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="fileResponse">
- <xs:complexType>
- <xs:sequence>
<xs:element name="Success" type="xs:anyType" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Using the flat file schema wizard we created the schema which is not relevant for this question. Now we need to create a message that should be redirected to a send port, the message only has a child element with the filename, we created a map, but there is no real mapping because we are using a constant. As you can see there is no mapping between fields, we used the value property to set a fixed value, to see if we could make this works. The right side schema is the one pasted above.
However we have this error, all we need is an XML in the send location with the hard coded filename on it.
xlang/s engine event log entry: Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'BizTalkNyCase.BizTalk_Orchestration1(ac1a86a0-9cc1-4850-d5f1-236b0663b4da)'. The service instance will remain suspended until administratively resumed or terminated. If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception. InstanceId: db35db6f-f14d-44ca-bea7-a3f747b550d5 Shape name: Send_2 ShapeId: 81933178-7b3c-49c2-a0b1-0cce3d4aa6ec Exception thrown from: segment 1, progress 16 Inner exception: Root element is missing. Exception type: XmlException Source: System.Xml Target Site: Void Throw(System.Exception) The following is a stack trace that identifies the location where the exception occured
Upvotes: 1
Views: 2423
Reputation: 947
My guess is that generating schema for the sp_insertFile element, your typename will be the same. But, it is not really accepted in BizTalk when trying to instanciate that type. Instead you get "Root node is missing" exception.
At least, that was my problem today. Removing _ from typename (but let the schema node name remain the same), solved my problem.
Upvotes: 0