Passing in properties using the Submit adapter
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > BizTalk Server > BizTalk Server General > Passing in properties using the Submit adapter




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Passing in properties using the Submit adapter  
George


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-29-05 10: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.UserPropert
ySchema"
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.





[ Post a follow-up to this message ]



    Re: Passing in properties using the Submit adapter  
Scott Colestock


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-29-05 10: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.UserPrope
rtySchema"
> 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.







[ Post a follow-up to this message ]



    Re: Passing in properties using the Submit adapter  
Tomas Restrepo \(MVP\)


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-30-05 07: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/







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:09 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register