Update table with WCF-SQL adapter - biztalk

I have created an Orchestration where I am trying to fetch all the rows from the Request table with Created status. I want to update these rows with Completed status.
I wrote a SP to fetch all the rows with Created status and I am able to get these values in my orchestration (I tried sending these values to a flat file and I am able see the values in output file.)
I wrote another SP to update the status to Completed by passing the RequestID. I added Transform control to my orchestration to map RequestID received from select SP to RequestIDparameter in update SP. I compiled and deployed this project, but at runtime I am getting the following error:
There was a failure executing the send pipeline:
"Microsoft.BizTalk.DefaultPipelines.XMLTransmit,
Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" Source: "XML assembler" Send Port:
"LogPort" URI: "C:\Data\Log\%MessageID%.xml" Reason: Root element is
missing.
I guess I doing something wrong in the mapping. But I'm not sure how to do it in the right way. I am using BizTalk 2010, VS 2010 and SQL Server 2008. I would like to know how to do the following:
How to debug BizTalk project.
How to map results for select query with update procedure.

Related

Biztalk Error: This Assembler cannot retrieve a document specification

There was a failure executing the send pipeline:
"Microsoft.BizTalk.DefaultPipelines.XMLTransmit,
Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" Source: "XML assembler" Send Port:
"WcfSendPort_SqlAdapterBinding_TableOp_dbo_User_Custom" URI:
"mssql://host/serverName/databaseTable?" Reason: This Assembler cannot
retrieve a document specification using this type:
"http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/User#Select".
but the schema namespace is "http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/User1"
and the select node is : SelectQuery
after deploying make restart for host instance and nothing changed.
The problem is the message that hit's the Pipeline does not match any Deployed Schemas. So, this error is only a symptom of the real problem, it is not a problem in itself.
First, "SelectQuery" is not a valid WCF SQL Element. Do you mean Select/Query?
Next, it look like the schema was generated twice and you're using the wrong one. I can tell because of "User1".
So, figure out which is the right one, User or User1. Then make sure that is the one that's user where you expect and that it's deployed.

Biztalk 2013r2 wcf-sql adapter composite operation

I am trying to use the wcf-sql adapter to call a stored procedure multiple times with different parameters. I have created the original schema using the wizard and then created the composite schema by hand. I understand what the error is telling me I just do not understand why I am getting the error and/or how to resolve it.
Error: Microsoft.ServiceModel.Channels.Common.MetadataException:
Object [dbo].[DEPT_NUM] of type StoredProcedure does not exist. The
message that is suspended in Biztalk looks like this...
<ns0:DINV_sumDepartmentInventory xmlns:ns0="http://schemas.microsoft.com/Sql/2008/05/TypedProcedures/dbo"><ns0:DEPT_NUM> 4</ns0:DEPT_NUM><ns0:INV_DATE>2016-03-21T00:00:00</ns0:INV_DATE><ns0:USERNAME>Service</ns0:USERNAME></ns0:DINV_sumDepartmentInventory>
This is the portion of the orchestration...
This is the map that is associated with the "transform_3" shape...
This is what the composite schema looks like...
I am expecting the output to more like this...
<ns1:Request xmlns:ns1="http://BigY.PICSInventory.Updated_SQL_Schemas.Composite_SumDepartmentInventory" xmlns:ns0="http://schemas.microsoft.com/Sql/2008/05/TypedProcedures/dbo"><ns0:DINV_sumDepartmentInventory><ns0:DEPT_NUM>4</ns0:DEPT_NUM><ns0:INV_DATE>2016-03-21T00:00:00</ns0:INV_DATE><ns0:USERNAME>Service</ns0:USERNAME></ns0:DINV_sumDepartmentInventory></ns1:Request>
Any ideas what is wrong with the setup or what else I can try?
It looks like the Composite Operation is not composed correctly. It has to be a very specific structure with certain namespaces and Operation.
This Wiki Article explains the process step by step: BizTalk Server: Streamlining WCF SQL and Oracle Messaging-Only and Other Patterns

Biztalk Cannot process EDIFACT file

I'm new in processing EDIFACT files. I want to process a EDIFACT file of type D:01B INTFSTA. I searched for schema in BizTalk server, created orchestration and deployed in BizTalk server. While processing the file I get the following error.
Error encountered during parsing.
Error: 1 (Miscellaneous error)
70: Cannot locate document specification because multiple schemas matched the message type "http://schemas.microsoft.com/BizTalk/EDI/EDIFACT/2006#EFACT_D01B_IFTSTA".
Error: 2 (Miscellaneous error)
71: Transaction Set or Group Control Number Mismatch
Error: 3 (Miscellaneous error)
29: Invalid count specified at interchange, group or message level
.
The sequence number of the suspended message is 1.
There is no other application using the same schema (D:01B INTFSTA).
Please help.
Most likely you have the schema deployed more than once in your BizTalk environment. In the BizTalk console, go to "All Artifacts", select "Schemas" and list alphabetically. There, search for EFACT_D01B_IFTSTA in the Root Name column. You will find that it is deployed in another application most likely.
A good practice around deploying EDI schemas btw, is to update the namespace to include the name of your trading partner. More than 1 of your trading partners may use the schema in different ways or have customizations in it. This approach lets you handle this situation.
The suggested namespace would, for example, be http://schemas.yourcompany.com/partners/yourtradingpartner
Most likely, the schema is not deployed. Check the Schemas node of the All Artifacts Application.
2&3. You test EDIFACT instance is invalid. Did you cut and paste it together? That would cause the mis-matches.
Note, it's a better practice to change the Target Namespace on the EDI schemas to something specific to the app which uses them.

BizTalk 2013 CU2 + ESB : Failed to update resources in the application

Recently upgraded to BizTalk 2013 CU2 and installed ESB.
This has had some side effects as we can no longer deploy without getting a database FK reference error.
Any one seen this before?
Here is the error when we try to deploy a new assembly to the DEV environment.
TITLE: BizTalk Server Administration
Failed to update resources in the application.
ADDITIONAL INFORMATION:
Failed to add resource(s). (mscorlib)
Change requests failed for some resources. (Microsoft.BizTalk.ApplicationDeployment.Engine)
BizTalkAssemblyResourceManager failed to complete end type change request. (Microsoft.BizTalk.ResourceManagers)
Removal of the assembly failed. Make sure that all items in the assembly you are trying to remove fulfill the following conditions:
Pipelines, maps, and schemas are not being used by Send Ports or Receive Locations in the same or referenced application(s).
Roles have no enlisted parties.
Database Error:
The DELETE statement conflicted with the REFERENCE constraint
bts_receiveport_transform_foreign_transformid. The conflict occurred
in database "BizTalkMgmtDb", table "dbo.bts_receiveport_transform",
column 'uidTransformGUID'. The DELETE statement conflicted with the
REFERENCE constraint "fk_bt_mapspec_bts_item". The conflict occurred
in database "BizTalkMgmtDb", table "dbo.bt_MapSpec", column 'itemid'.
The DELETE statement conflicted with the REFERENCE constraint
"bts_receiveport_transform_foreign_transformid". The conflict occurred
in database "BizTalkMgmtDb", table "dbo.bts_receiveport_transform",
column 'uidTransformGUID'. The statement has been terminated. The
statement has been terminated. The statement has been terminated.
(mscorlib)
I ran a SQL trace and found that this is the SP that breaks when it tries to delete from table dbo.bt_MapSpec.
exec dpl_DeleteAssembly
#Guid=N'00000000-0000-0000-0000-000000000000',#Name=N'theassemblynamegoeshere',#VersionMajor=1,#VersionMinor=0,#VersionBuild=0,#VersionRevision=0,#PublicKeyToken=N'89e32fae0caf808e',#Culture=N'neutral',#Type=N'2',#NoSchemasVerify=0

Pool Multiple Messages with BizTalk 2006 SQL Adapter

I have a StoredProcedure that returns a simple table containing several records:
DECLARE #STEPS_TABLE AS TABLE (OrchestrationID uniqueidentifier, [Message] nvarchar(1000));
-- LOADING THE VALUES HERE
SELECT * FROM #STEPS_TABLE As Step FOR XML AUTO, XMLDATA, ELEMENTS
I used the SQL Transport Schema Generation Wizard to create my schema and could configure the port correctly. If I use this schema on my orchestration, it works perfectly. BizTalk starts one instance of the orchestration everytime the #STEPS_TABLE has more than 1 record.
Reading Microsoft technical documentation, they recommend to get several messages in one call and then use the XML pipeline to disassemble the multi-row BizTalk message into a single-row BizTalk message.
I haven't used the XML pipeline before, so I tried the provided steps but couldn't get it to work.
Could somebody provide me a link to a "how to" (didn't find anything until now, after several hours of searching) or give me some hints to succeed.
Thanks in advance.
... some hours later I could figure it out myself. So if anybody comes across the same issue as me, here you have some guidelines to make it work on your environment.
At the end I followed a different walkthrough from Microsoft and avoided the pipeline recommendation altogether. The documentation I found is called "Disassembling Result Sets Using the SQL Adapter" and does exactly what i was looking for. You can just follow the whole walkthrough from Microsoft but avoid the creation of the send port and make some little adjustment on the receive port.
After following the technical document you will end up with two schemas, I will call them message and envelope (contains several messages) for the sake of this excercise. In your orchestration you can create a receiving port that maps to the message and then when you configure it as a SQL Port and you link it to your stored procedure (or select statement), you only have to change the Document Root Element Name to the envelope root name; the XML Receive pipeline (provided by default in BizTalk 2006) will do the magic of disassembling the messages contained in the envelope and instantiating an orchestration for each message.
The Microsoft "Disassembling Result Sets Using the SQL Adapter" walkthrough can be found under:
http://msdn.microsoft.com/en-us/library/aa562098(v=bts.20).aspx
Mission accomplished :)

Resources