Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Can 2 different Updategrams use the same SQL Solicit-Respose
- This topic has 6 replies, 1 voice, and was last updated 8 years, 3 months ago by
community-content.
-
AuthorPosts
-
-
May 31, 2006 at 4:10 AM #14770
Hello,
I have a schemaA that comes into orchestrationA & then i tranform it to updategramA, pass it to SQL solicit response port (specify later) get the response back and send it to an output folder. This is working fine.
I have 3 physical ports, ReceivePortIN, SQL2Way & SendPortOutThen i needed to do the same thing, this time its schemaB into orchestrationB, transform to UpdategramB etc, etc. same exact flow only difference is that updateframA & updategramB insert data into different tables but they are in the same database.
I wanted to see if i could use the same 3 physical ports i already created.
THe problem seems to come in with the SQL2Way port. My handlers are XMLReceive & XMLTransmit. orchestrationB errors out becuse it is expecting the RespRoot from updategramA I think. SO I’m just confused on how i should be approaching this.Would I need 2 different physical SQL2Way ports (when i do that it works), but since its the same db it seems kinda redundent to setup more SQL ports. I will eventually need OrchestrationC & D so that would be 4 SQL2Way ports 🙁 Is there a way 2 just use 1 SQL port. The problem has to do with the TargetNamespace it asks for when configuring the physical SQL port I think. Am i missing something?
I also get confused when creating the updategrams via the generated items. It also asks for a target namespace there, but it generates the actual schema name for you \”Insert<tablename>Service\” so if your doing this for the 1st tiem you don’t know the name it was gona give it. I have seen examples (Scott Woo;s) where it looks like he has you put in the target namespace but without the schema name
i.e.Target namespace: http://SQLOrchestrationOneWaySendSample
Port Type: Send port
Request root element name: ReqRootName
Response root element name: RespRootNamebut all the other schema i create without the wizard have a target namespace that includes the schema name
like..
http://SQLOrchestrationOneWaySendSample.SchemaBSo this has me really confused & seems inconsistent to me.
Can anyone set me straight please. I hope I am being clear.
So do i just need to create a different physical port for each of my updategrams?
And why does Scott’s sample not have a schema name (i think he generates a sp call instead of updategram but the wizards just about the same)
Thanks in advance for any pointers.
-
May 31, 2006 at 5:54 PM #14771
Thank you for the response. I thought it made good sense so I changed the updategrams to have the same target namespace (for example http://Project1), then i changed the SQL port TargetNamespace to the same. Undeployed – ReDeployed But now i get an error message that states…
This Assembler cannot retrieve a document specification using this type: \”http://Project1#ReqRoot
I have been to W3C web site and though i have an ok grasp of namespaces, so could you try to give me a little more info please.
Just in general terms so i can recreate it if i need to.So now i have 2 schemas SchemaA & schemaB, their namespaces are different (http://Project1.SchemaA & http://Project1.SchemaB). But i changed both updategrams to just have the same namespace – just (http://Project1), this is how I was interpreting your response.
Will I need to go back and change things in the orchestration view of the orchestrations or something? Or am just totally executing your advice incorrectly?
Thanks again. I been working b=with BizTlak for 3 months now & every time i think I’m getting it, i run into another road block.
I will recreate another project if need be to dummy down my actual project if need be.
Aother quick question if I can – should i even bother getting the response back from the SQL port for an updategram. Eventually i will try to work in error handling, so all I really care about is knowing somehow if the insert failed. any advice on that?
k thanks again for all your help.
-
May 31, 2006 at 8:44 PM #14772
OH – yes both my updategram schema have ReqRoot & RespRoot.
Here is 1 of them…
<?xml version=\”1.0\” encoding=\”utf-16\”?>
<xs:schema xmlns:tns=\”myCompany.myProject.UpdSchema\” xmlns:updg=\”urn:schemas-microsoft-com:xml-updategram\” xmlns:b=\”http://schemas.microsoft.com/BizTalk/2003\” attributeFormDefault=\”qualified\” elementFormDefault=\”qualified\” targetNamespace=\”myCompany.myProject.UpdSchema\” xmlns:xs=\”http://www.w3.org/2001/XMLSchema\”>
<xs:import schemaLocation=\”.\\updgidentity.xsd\” namespace=\”urn:schemas-microsoft-com:xml-updategram\” />
<xs:annotation>
<xs:appinfo>
<b:references>
<b:reference targetNamespace=\”urn:schemas-microsoft-com:xml-updategram\” />
</b:references>
</xs:appinfo>
</xs:annotation>
<xs:element name=\”ReqRoot\”>
<xs:complexType>
<xs:sequence minOccurs=\”1\” maxOccurs=\”1\”>
<xs:element xmlns:updategram=\”urn:schemas-microsoft-com:xml-updategram\” updategram:Prefix=\”updg\” minOccurs=\”1\” maxOccurs=\”1\” name=\”sync\”>
<xs:complexType>
<xs:sequence minOccurs=\”1\” maxOccurs=\”1\”>
<xs:element updategram:Prefix=\”updg\” minOccurs=\”1\” maxOccurs=\”1\” name=\”after\”>
<xs:complexType>
<xs:sequence minOccurs=\”1\” maxOccurs=\”1\”>
<xs:element minOccurs=\”1\” maxOccurs=\”1\” name=\”T_Message\”>
<xs:complexType>
<xs:attribute ref=\”updategram:at-identity\” />
<xs:attribute name=\”Job_ID\” type=\”xs:long\” />
<xs:attribute name=\”MessageType_ID\” type=\”xs:long\” />
<xs:attribute name=\”Direction_IND\” type=\”xs:string\” />
<xs:attribute name=\”Creation_DT\” type=\”xs:string\” />
</xs:complexType>
</xs:element>
<xs:element minOccurs=\”1\” maxOccurs=\”unbounded\” name=\”C_Lot\”>
<xs:complexType>
<xs:attribute ref=\”updategram:at-identity\” />
<xs:attribute name=\”Message_ID\” type=\”xs:string\” />
<xs:attribute name=\”IsBulkLot_Flag\” type=\”xs:string\” />
<xs:attribute name=\”LotType_NM\” type=\”xs:string\” />
<xs:attribute name=\”Depot_CD\” type=\”xs:string\” />
<xs:attribute name=\”DestDepot_CD\” type=\”xs:string\” />
<xs:attribute name=\”Lot_CD\” type=\”xs:string\” />
<xs:attribute name=\”Label_CD\” type=\”xs:string\” />
<xs:attribute name=\”Status_TXT\” type=\”xs:string\” />
<xs:attribute name=\”Expiration_DT\” type=\”xs:string\” />
<xs:attribute name=\”Total_CNT\” type=\”xs:int\” />
<xs:attribute name=\”Trans_CNT\” type=\”xs:int\” />
</xs:complexType>
</xs:element>
<xs:element minOccurs=\”0\” maxOccurs=\”unbounded\” name=\”C_LotItem\”>
<xs:complexType>
<xs:attribute name=\”Lot_ID\” type=\”xs:string\” />
<xs:attribute name=\”Depot_CD\” type=\”xs:string\” />
<xs:attribute name=\”DestDepot_CD\” type=\”xs:string\” />
<xs:attribute name=\”Item_NO\” type=\”xs:string\” />
<xs:attribute name=\”ItemType_CD\” type=\”xs:string\” />
<xs:attribute name=\”Status_TXT\” type=\”xs:string\” />
<xs:attribute name=\”Expiration_DT\” type=\”xs:string\” />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name=\”nullvalue\” type=\”xs:string\” />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name=\”RespRoot\”>
<xs:complexType>
<xs:sequence>
<xs:element name=\”Success\” type=\”xs:anyType\” />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>So I am fine with 1 schema then but I’m just not sure how to implement that. The schema has the tables I want to insert into. Right now my second schema has different tables so if i went with only 1 schema i don’t get how i would define the tables – plus i using a map to map each schema comming in to the updategram schema, so once again I dont get how i could do that with just 1 schema. So I am willing to change things, should i try urn or should i delete RespRoot from 1 schema & change ReqRoot of one of them?
Know of any resources or samples that show this or something similar.
I have read most of BizTalk 2004 unleashed, and done much research and I have yet to see good explanations around the multipart messages and all that stuff that gets automatically created when you use the generated items (ie. Orchestration with port types and multi-part messages defined). Ic overed so much material I am probablly forgetting some of it.
I either see too simple of samples or too advanced samples. I having difficulties finding intermediate samples that actually walk you through the steps to recreate them.
Thanks!!!
-
May 31, 2006 at 9:22 PM #14773
Errr sorry – not sure what i did there.
But anyway you get the picture of my schema.
So should i try to change to urn – or change on root note name and delete the respRoot from one of them.I would be fine with just 1 updategram schema, but when different tables are defined ine the 2 I have, i don’t understand how i can have just one. I also run maps in my orchestrations to map the incomming xml doc to the updategrams. So i don’t get how to just use one.
Any examples or resources you know of that show something similar to this, or show how to use the same SQL port for different updategrams, or do i just make more parts to my updatgram & make it even bigger. Right now my updategram schema has 2 parts the ReqRoot & The RespRoot, do i just add like a ReqRoot2 – that type of thing?
Thank you
-
June 1, 2006 at 2:47 AM #14774
Yay – I got it working 🙂
Thanks sooooo much greg.forsythe!!!
It wasnt until i reread your second response that I really understood what I needed to do. So it’s kinda like a C# namespace where you can have parts of it in different files. I like the 1 schema approach as well – that is what i ended up doing. I am new to XML & Biztalk so I’m just learning the XML as needed and concentration more on the BizTalk. The muli-part messages in general have been giving me a little bit of a hard time.
Next up for my project is to research error handling & send an email to a dist list if the orchestration fails. I was able to write a custom functoid that reads config data from an external config file, that was kinda cool. The SSO solution for storing config data seemed moe difficult for me & I’m running short on time.
Well thanks again – you have been a great help!!!
-
May 31, 2006 at 10:08 AM #14775
Yes you can use the same SQL Port to send different updategrams.
All the updategram schemas must have the same namespace and the same return root node name.
I have found it easiest to have a single schema for all updategrams going to a the same SQL Port. This requires a bit of manual intervention, using the often maligned development tool Notepad.[code:1:bd9c7ae2df]<Schema targetnamespace=\"urn:domain.com:SQLPurchaseOrderService:v1>
insertpurchaseorder
<updg:sync>…
updatepurchaseorder
<updg:sync>…
result
Success[/code:1:bd9c7ae2df]The target namespace is an arbitary string. The default in Biztalk is to use a Url (http://….) but my preference is for a urn (see above). You will need to visit [url]http://www.w3.org[/url] for the rules on Xml namespaces
-
May 31, 2006 at 7:45 PM #14776
Do both your schemas have the same root node.
If this is the case you will have to change the root node of one schema.
You cannot have two schema with the same root node and namespace deployed.
Also only one of your schema files can have the response node declared.
This is why I prefer one schema, the xsd rules prevent you from duplicating nodes.The response to the updategram is always one node <Success>. All errors are reported by throwing an exception.
The main reason for receiving the response is to know when this call to SQL has completed. And you need to remove this message from the message box by consuming it.
-
-
-
-
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.