|
Home > Archive > BizTalk Server General > July 2005 > Passing in properties using the Submit adapter
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Passing in properties using the Submit adapter
|
|
| George 2005-07-29, 5:55 pm |
| This is the scenario:
I have a web service that recieves a Flat File, a user id (A guid
passed in as a string) and a database index value (an int). I am
using the Submit Adapter (Request/Response) from the SDK samples to
submit the Flat File to BTS 2004 using the
Flat File Disasembler in a custom pipeline which then feeds an
orchestration. I then fill in addditional information
from SQL Server into the message. This works ok. My problem now is how
to get the Customer ID and the index value into
BTS so that I can use them in the orchestration. So far, I have
altered the the submit adapter's MessageHelper class to pass in the
UserID:
// Create a new message
msg = mf.CreateMessage();
part = mf.CreateMessagePart();
part.Data = sw.BaseStream;
ctx = msg.Context;
msg.AddPart("body", part, true);
// Added Code to promote UserID.
ctx.Promote( "UserID", @"http://www.w3.org/2001/XMLSchema", "User
ID GUID" );
And have created a property xsd:
<?xml version="1.0" encoding="utf-16"?>
<xs:schema
xmlns="http://Microsoft.Samples.BizTalk.ProcessRequest.UserPropertySchema"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
targetNamespace="http://Microsoft.Samples.BizTalk.ProcessRequest.UserPropertySchema"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:annotation>
<xs:appinfo>
<b:schemaInfo schema_type="property"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003" />
</xs:appinfo>
</xs:annotation>
<xs:element name="UserID" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo
propertyGuid="266d557b-91c7-4a79-af34-9c8616de2afd"
propSchFieldBase="MessageContextPropertyBase" />
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:schema>
This at least allows me to call ctx.Promote( ... ) without an error.
The problem now is that the orchestrations that were being called when
I submited only the Flat File are no longer being called.
I havn't been using BTS long, (about 4 months), but I assume that
passing in meta data along with the flat file is pretty easy, but I
cannot find any specific information on the web or in the
Biztalk unleashed book on how to do this.
If you know of a web site/blog/book that explains this, could you
please point me in it's direction, or if I am going in the wrong
direction in tring to pass in additional informatioon like this, could
you please point me in the right direction.
Any help would be appreciated.
thanks.
| |
| Scott Colestock 2005-07-29, 5:55 pm |
| If you have additional information to pass from the web service, could you
wrap the inbound message in an envelope that contains this information?
That way, you could be using the standard web-publishing infrastructure
rather than the submit adapter.
Scott Colestock
www.traceofthought.net
"George" <usenet101@mindspring.com> wrote in message
news:p8uke1p3ogbh4oj87l1td87cmvsti1kejg@
4ax.com...
> This is the scenario:
>
> I have a web service that recieves a Flat File, a user id (A guid
> passed in as a string) and a database index value (an int). I am
> using the Submit Adapter (Request/Response) from the SDK samples to
> submit the Flat File to BTS 2004 using the
> Flat File Disasembler in a custom pipeline which then feeds an
> orchestration. I then fill in addditional information
> from SQL Server into the message. This works ok. My problem now is how
> to get the Customer ID and the index value into
> BTS so that I can use them in the orchestration. So far, I have
> altered the the submit adapter's MessageHelper class to pass in the
> UserID:
>
>
> // Create a new message
> msg = mf.CreateMessage();
> part = mf.CreateMessagePart();
> part.Data = sw.BaseStream;
> ctx = msg.Context;
> msg.AddPart("body", part, true);
>
> // Added Code to promote UserID.
> ctx.Promote( "UserID", @"http://www.w3.org/2001/XMLSchema", "User
> ID GUID" );
>
>
> And have created a property xsd:
>
>
> <?xml version="1.0" encoding="utf-16"?>
> <xs:schema
> xmlns="http://Microsoft.Samples.BizTalk.ProcessRequest.UserPropertySchema"
> xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
> targetNamespace="http://Microsoft.Samples.BizTalk.ProcessRequest.UserPropertySchema"
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
> <xs:annotation>
> <xs:appinfo>
> <b:schemaInfo schema_type="property"
> xmlns:b="http://schemas.microsoft.com/BizTalk/2003" />
> </xs:appinfo>
> </xs:annotation>
> <xs:element name="UserID" type="xs:string">
> <xs:annotation>
> <xs:appinfo>
> <b:fieldInfo
> propertyGuid="266d557b-91c7-4a79-af34-9c8616de2afd"
> propSchFieldBase="MessageContextPropertyBase" />
> </xs:appinfo>
> </xs:annotation>
> </xs:element>
> </xs:schema>
>
> This at least allows me to call ctx.Promote( ... ) without an error.
>
> The problem now is that the orchestrations that were being called when
> I submited only the Flat File are no longer being called.
>
>
> I havn't been using BTS long, (about 4 months), but I assume that
> passing in meta data along with the flat file is pretty easy, but I
> cannot find any specific information on the web or in the
> Biztalk unleashed book on how to do this.
>
> If you know of a web site/blog/book that explains this, could you
> please point me in it's direction, or if I am going in the wrong
> direction in tring to pass in additional informatioon like this, could
> you please point me in the right direction.
>
> Any help would be appreciated.
>
> thanks.
| |
| Tomas Restrepo \(MVP\) 2005-07-30, 2:48 am |
| George,
>
> I have a web service that recieves a Flat File, a user id (A guid
> passed in as a string) and a database index value (an int). I am
> using the Submit Adapter (Request/Response) from the SDK samples to
> submit the Flat File to BTS 2004 using the
> Flat File Disasembler in a custom pipeline which then feeds an
> orchestration. I then fill in addditional information
> from SQL Server into the message. This works ok. My problem now is how
> to get the Customer ID and the index value into
> BTS so that I can use them in the orchestration. So far, I have
> altered the the submit adapter's MessageHelper class to pass in the
> UserID:
>
>
> // Create a new message
> msg = mf.CreateMessage();
> part = mf.CreateMessagePart();
> part.Data = sw.BaseStream;
> ctx = msg.Context;
> msg.AddPart("body", part, true);
>
> // Added Code to promote UserID.
> ctx.Promote( "UserID", @"http://www.w3.org/2001/XMLSchema", "User
> ID GUID" );
Besides Scott excellent response, I might add that you seem to have the code
wrong. The Promote() call should pass the namespace the property is defined
in; you're passing the XSD namespace instead!
Have you tried:
ctx.Promote( "UserID",
"http://Microsoft.Samples.BizTalk.ProcessRequest.UserPropertySchema", "User
ID GUID" );
instead?
--
Tomas Restrepo
tomasr@mvps.org
http://www.winterdom.com/
|
|
|
|
|