Forum Replies Created
-
AuthorPosts
-
July 8, 2009 at 12:49 PM in reply to: BizTalk Direct bound to messageBox and Passing context Values #22818
Yes, create a property schema and insert a child field element. In the properties window for this new element be sure to set the Property Schema Base property to MessageContextPropertyBase. This allows you to use this property as a context property.
July 8, 2009 at 8:23 AM in reply to: BizTalk Direct bound to messageBox and Passing context Values #22815Hey Ben, Thanks for your reply….Do I need to create a proprty Schema for That? Can u explain in a bit?
July 8, 2009 at 8:13 AM in reply to: BizTalk Direct bound to messageBox and Passing context Values #22814Yes, you could create a message context property that you can add to each message. This context property can be set to the BamActivityId in the first orchestration. When the message is then received by any downstream orchestration they could just read this context property.
-Ben
I think the issue may lie with constructing the multipart message iTexValidationRequestMessage.
Can you provide some details about the structure of this message.
i.e. number of parts, types of each part, how you send this message-is this a web service message?What does your code look like in the message assignment shape that builds this message.
Hi Greg
Luckily I bookmarked the post
http://www.biztalkgurus.com/forums/t/10412.aspx
What you are saying makes sense – could it be something to do with the XML then that causes it to fail? Namespace or some other construct. I have to say that some of the deeper mysteries of XML are new to me as well
Richard
Making a copy of the message from typed (defined by a schema) to untyped (no schema) message seems to serve no purpose here.
You cannot use distinguished fields or promoted properties on an untyped message. These are defined in the schema and an untyped message has no schema. The xpath function will work on either message as long as the content is Xml.Do you have the reference to the post that recommends using the XmlDocument type message?
You all are correct, BizTalk is not the best tool for this type of message. I ended up building a little SSIS package. And man is it fast! 1.68 million rows in a bit under 30 seconds on non production hardware.
Thanks all
For orchestrations and maps, you need to make sure that the containing assembly references the right assembly defining the schema you want to use. For pipelines/ports, you need to create a custom pipeline, and configure the assembler/disassembler components to use a specific document/envelope/header/footer schema as necessary.
I was able to get this working by modifying the xsl generated from the map and creating a new map using the custom xsl file.
I’m sure there is a way to make the mapper do it correctly, but I’ve wasted too much time already..
Thanks
Scott
Hi Greg
Thanks for the reply.
Onething puzzles me about this though – we have said create a message as a System.Xml.XmlDocument (ApptConfMsg) and we have assigned the incoming message ReceiveApptConfMsg to it ie ApptConfMsg = ReceiveApptConfMsg. SO in effect ApptConfMsg is assigned the value(?) of the incoming message in the message construct shape yet the examples you have shown still use the values / methods in the inbound message. I think I have a knowledge gap here somehow
The XSD for the message looks like this and this is for both messages
<?xml version=”1.0″ encoding=”utf-16″ ?>
– <xs:schema xmlns:ns0=”http://XMLtoSMS.ApptConf_PropertySchema“ xmlns:b=”http://schemas.microsoft.com/BizTalk/2003“ xmlns=”http://XMLtoSMS.Appt_conf“ targetNamespace=”http://XMLtoSMS.Appt_conf“ xmlns:xs=”http://www.w3.org/2001/XMLSchema“><b:schemaInfo root_reference=”Message“ standard=”XML“ xmlns:b=”http://schemas.microsoft.com/BizTalk/2003“ /><b:namespace prefix=”ns0“ uri=”http://XMLtoSMS.ApptConf_PropertySchema“ location=”.\apptconf_propertyschema.xsd“ /></b:imports></xs:appinfo></xs:annotation><b:property distinguished=”true“ xpath=”/*[local-name()=’Message’ and namespace-uri()=’http://XMLtoSMS.Appt_conf’%5D/*%5Blocal-name()=’From’ and namespace-uri()=”]/*[local-name()=’DeviceAddress’ and namespace-uri()=”]“ /><b:property distinguished=”true“ xpath=”/*[local-name()=’Message’ and namespace-uri()=’http://XMLtoSMS.Appt_conf’%5D/*%5Blocal-name()=’From’ and namespace-uri()=”]/*[local-name()=’Name’ and namespace-uri()=”]“ /><b:property distinguished=”true“ xpath=”/*[local-name()=’Message’ and namespace-uri()=’http://XMLtoSMS.Appt_conf’%5D/*%5Blocal-name()=’Reason’ and namespace-uri()=”]“ /><b:property distinguished=”true“ xpath=”/*[local-name()=’Message’ and namespace-uri()=’http://XMLtoSMS.Appt_conf’%5D/*%5Blocal-name()=’Recipients’ and namespace-uri()=”]/*[local-name()=’To’ and namespace-uri()=”]/*[local-name()=’DeviceAddress’ and namespace-uri()=”]“ /><b:property distinguished=”true“ xpath=”/*[local-name()=’Message’ and namespace-uri()=’http://XMLtoSMS.Appt_conf’%5D/*%5Blocal-name()=’Recipients’ and namespace-uri()=”]/*[local-name()=’To’ and namespace-uri()=”]/*[local-name()=’Name’ and namespace-uri()=”]“ /><b:property distinguished=”true“ xpath=”/*[local-name()=’Message’ and namespace-uri()=’http://XMLtoSMS.Appt_conf’%5D/*%5Blocal-name()=’Recipients’ and namespace-uri()=”]/*[local-name()=’To’ and namespace-uri()=”]/*[local-name()=’Category’ and namespace-uri()=”]“ /><b:property distinguished=”true“ xpath=”/*[local-name()=’Message’ and namespace-uri()=’http://XMLtoSMS.Appt_conf’%5D/*%5Blocal-name()=’Recipients’ and namespace-uri()=”]/*[local-name()=’To’ and namespace-uri()=”]/*[local-name()=’MailingAddress’ and namespace-uri()=”]/*[local-name()=’Address1′ and namespace-uri()=”]“ /><b:property distinguished=”true“ xpath=”/*[local-name()=’Message’ and namespace-uri()=’http://XMLtoSMS.Appt_conf’%5D/*%5Blocal-name()=’Recipients’ and namespace-uri()=”]/*[local-name()=’To’ and namespace-uri()=”]/*[local-name()=’MailingAddress’ and namespace-uri()=”]/*[local-name()=’Address2′ and namespace-uri()=”]“ /><b:property distinguished=”true“ xpath=”/*[local-name()=’Message’ and namespace-uri()=’http://XMLtoSMS.Appt_conf’%5D/*%5Blocal-name()=’Recipients’ and namespace-uri()=”]/*[local-name()=’To’ and namespace-uri()=”]/*[local-name()=’MailingAddress’ and namespace-uri()=”]/*[local-name()=’Address3′ and namespace-uri()=”]“ /><b:property distinguished=”true“ xpath=”/*[local-name()=’Message’ and namespace-uri()=’http://XMLtoSMS.Appt_conf’%5D/*%5Blocal-name()=’Recipients’ and namespace-uri()=”]/*[local-name()=’To’ and namespace-uri()=”]/*[local-name()=’MailingAddress’ and namespace-uri()=”]/*[local-name()=’City’ and namespace-uri()=”]“ /><b:property distinguished=”true“ xpath=”/*[local-name()=’Message’ and namespace-uri()=’http://XMLtoSMS.Appt_conf’%5D/*%5Blocal-name()=’Recipients’ and namespace-uri()=”]/*[local-name()=’To’ and namespace-uri()=”]/*[local-name()=’MailingAddress’ and namespace-uri()=”]/*[local-name()=’Region’ and namespace-uri()=”]“ /><b:property distinguished=”true“ xpath=”/*[local-name()=’Message’ and namespace-uri()=’http://XMLtoSMS.Appt_conf’%5D/*%5Blocal-name()=’Recipients’ and namespace-uri()=”]/*[local-name()=’To’ and namespace-uri()=”]/*[local-name()=’MailingAddress’ and namespace-uri()=”]/*[local-name()=’PostalCode’ and namespace-uri()=”]“ /><b:property distinguished=”true“ xpath=”/*[local-name()=’Message’ and namespace-uri()=’http://XMLtoSMS.Appt_conf’%5D/*%5Blocal-name()=’Recipients’ and namespace-uri()=”]/*[local-name()=’To’ and namespace-uri()=”]/*[local-name()=’MailingAddress’ and namespace-uri()=”]/*[local-name()=’Country’ and namespace-uri()=”]“ /><b:property distinguished=”true“ xpath=”/*[local-name()=’Message’ and namespace-uri()=’http://XMLtoSMS.Appt_conf’%5D/*%5Blocal-name()=’Content’ and namespace-uri()=”]“ /></b:properties></xs:appinfo></xs:annotation><xs:element name=”Reason“ type=”xs:string“ /><xs:element name=”DeviceAddress“ type=”xs:string“ /><xs:element name=”Name“ type=”xs:string“ /><xs:element name=”Category“ type=”xs:string“ /><xs:element name=”Address1“ type=”xs:string“ /><xs:element name=”Address2“ type=”xs:string“ /><xs:element name=”Address3“ type=”xs:string“ /><xs:element name=”City“ type=”xs:string“ /><xs:element name=”Region“ type=”xs:string“ /><xs:element name=”PostalCode“ type=”xs:string“ /><xs:element name=”Country“ type=”xs:string“ /></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element><xs:element name=”Content“ type=”xs:string“ /></xs:sequence></xs:complexType></xs:element></xs:schema>This error indicates either:
1. There is no Http receive location with a Uri that is exactly /HTTPRequestResponseSample/BTSHTTPReceive.dll
2. There is a matching receive location but it is not enabled
3. The IIS virtual directory is not running as a user that is a member of your Biztalk Isolated Host Group.The way you set up the user on the virtual directory is determined by your version of IIS. What operating system are you using?
Have you considered using Promoted properties or distinguished fields to extract the data.
For Distinguished Fields:
In your received message schema (Xsd), right click on the node of interest -> Promote -> Show promotions
Select the Distinguished Fields tab and Add the nodes you wish to access (there are some restrictions here i.e. the node can only occur once in any message)In the orchestration you will now have access to this data using dot notation – you can use Intellisense to navigate the distinguished fields
stringVariable = ReceiveApptConfMsg.MyNode;You can also use promoted properties, but this is a bit more labour intensive and only of use if you wish to use the data to route messages. You need to create a property schema. Use the Promoted Properties tab on the Show Promotions dialog and assign nodes to particular properties.
stringVariable = ReceiveApptConfMsg(YourNamespace.YourPropertyName);The third option is to use the xpath function. You do not need to copy the message to a message of type XmlDocument.
stringVariable = xpath(ReceiveApptConfMsg, “string(my xpath expression)”);You can then set about constructing you multipart message and assigning data to the constiuent parts. It would be helpful to know the structure of your multipart message and the message type of all the parts?
Hi Greg
I have got a bit further by managing to copy something I found on an earlier post in this forum. Basically It would seem that I needed to construct an instance of the document based on the message by having 2 messages based on the original XSD.
One of these is bound to the ReceivePort and the other is of Type System.XML.Document I then added a construct shape with a message assignment and the statement
ApptConfMsg = ReceiveApptConfMsg;
wheere ApptConfMsg is the System.XML.Document and ReceiveApptConfMsg is the message type bound to the port that is incoming.
This seems to have sorted out the problems there – now just got XPath problems trying to access the data from the information in the XML file
Can we see your code that you use to extract data from the incoming message and construct your multipart message?
While Guo Ming Li’s will work, you will start to have performance issues as the number of records grows.
For each employee record you will have to scan all the preceding records i.e
1 record = 0 preceding
2 records = 1 preceding
3 records = 1 + 2 preceding
4 records = 1 + 2 + 3 preceding
5 records = 1 + 2 + 3 + 4 precedingThe total number of record checks is calculated by the function n(n-1)/2, so for 1000 records you will need to check 499500 preceding records.
There is an example here http://www.biztalkgurus.com/forums/p/9947/19832.aspx#19832 that uses the Xslt Key – sort of a modified Muenchian grouping pattern.
Alternatively you could use a scripting functoid that uses a global StringCollection variable:
System.Collections.Specialized.StringCollection uniqueIds = new System.Collections.Specialized.StringCollection() ;
public bool IsUniqueId(string id)
{
if (uniqueIds.Contains(id))
return false;
uniqueIds.Add(id);
return true;
}Put this scripting functoid in front of a Value Mapping functoid.
-
AuthorPosts