BizTalk Server Framework - PropertySchema existence

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server Framework > July 2005 > PropertySchema existence





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 PropertySchema existence
eXavier

2005-06-01, 5:52 pm

Hi all,
I experience problem when promoting message properties from custom adapter.

I developed my adapter based on SDK samples. It is .NET class library
project type. To be able to deploy adapter's property schema I had to create
also Biztalk project with the schema. If schema is deployed, promoting from
adapter works fine, but if the schema is not deployed I receive error from
IBTTransportBatch.SubmitMessage(): "The parameter is incorrect.". (Code
snippet follows bellow.)

The error brings not much information, so I would like to check if property
schema exists before I try to promote properties. If the schema does not
exist I would just Write() properties into message context (without
promotion). The question is: How could I find out if property schema exists
for given property ?

Thanks a lot
eXavier



Here's code snippet :

IBaseMessagePart part = this.messageFactory.CreateMessagePart();
part.Data = GetMyStream();
IBaseMessage message = this.messageFactory.CreateMessage();
message.AddPart(MESSAGE_BODY_PART_NAME, part, true);

SystemMessageContext context = new SystemMessageContext(message.Context);
context.InboundTransportLocation = this.receiveLocation.uri;
context.InboundTransportType = this.transportType;

string subject = email.Subject as string;
if (subject != null) {
message.Context.Promote("Subject", this.propertyNamespace, subject);
}

StandardReceiveBatchHandler batch = new
StandardReceiveBatchHandler(this.transportProxy, null);
batch.SubmitMessage(message, email.noteid); <<<<< throws Exception
BatchResult batchResult = batch.Done(null);



2005-06-06, 7:57 am

Hi,

If you want to get that degree of insight, you can use the BizTalkOM Objekt
model. It is well documented by the online help. However, please not that in
order to be able to use that, the user account you are acting with must be
member of the BizTalk Administrators group.

Sincerely

Joerg Fischer
MVP

"eXavier" <fhns@centrum.cz> schrieb im Newsbeitrag
news:O4Jdc0qZFHA.1148@tk2msftngp13.phx.gbl...
> Hi all,
> I experience problem when promoting message properties from custom
> adapter.
>
> I developed my adapter based on SDK samples. It is .NET class library
> project type. To be able to deploy adapter's property schema I had to
> create
> also Biztalk project with the schema. If schema is deployed, promoting
> from
> adapter works fine, but if the schema is not deployed I receive error from
> IBTTransportBatch.SubmitMessage(): "The parameter is incorrect.". (Code
> snippet follows bellow.)
>
> The error brings not much information, so I would like to check if
> property
> schema exists before I try to promote properties. If the schema does not
> exist I would just Write() properties into message context (without
> promotion). The question is: How could I find out if property schema
> exists
> for given property ?
>
> Thanks a lot
> eXavier
>
>
>
> Here's code snippet :
>
> IBaseMessagePart part = this.messageFactory.CreateMessagePart();
> part.Data = GetMyStream();
> IBaseMessage message = this.messageFactory.CreateMessage();
> message.AddPart(MESSAGE_BODY_PART_NAME, part, true);
>
> SystemMessageContext context = new SystemMessageContext(message.Context);
> context.InboundTransportLocation = this.receiveLocation.uri;
> context.InboundTransportType = this.transportType;
>
> string subject = email.Subject as string;
> if (subject != null) {
> message.Context.Promote("Subject", this.propertyNamespace, subject);
> }
>
> StandardReceiveBatchHandler batch = new
> StandardReceiveBatchHandler(this.transportProxy, null);
> batch.SubmitMessage(message, email.noteid); <<<<< throws Exception
> BatchResult batchResult = batch.Done(null);
>
>
>



Paul Somers [MVP+BizTalk]

2005-06-06, 7:57 am

You can use the ExplorerOM library, the method you are looking for is:

Microsoft.BizTalk.ExplorerOM.BtsCatalogExplorer _explorer = new
BtsCatalogExplorer();
// Connect the explorer

_explorer.ConnectionString = connectionString; // Very important to set the
connection string to the management db.

_explorer.Schemas[name];

This will return the schema for your desired assembly, to check that it
exists, if it return null, then its not deployed.

To check if your assembly with the schema is deployed, try:
_explorer.Assemblies[name]

<Joerg Fischer> wrote in message
news:exl7mUoaFHA.3048@TK2MSFTNGP12.phx.gbl...
> Hi,
>
> If you want to get that degree of insight, you can use the BizTalkOM
> Objekt model. It is well documented by the online help. However, please
> not that in order to be able to use that, the user account you are acting
> with must be member of the BizTalk Administrators group.
>
> Sincerely
>
> Joerg Fischer
> MVP
>
> "eXavier" <fhns@centrum.cz> schrieb im Newsbeitrag
> news:O4Jdc0qZFHA.1148@tk2msftngp13.phx.gbl...
>
>



eXavier

2005-06-08, 7:47 am

Thanks for your response, but I really don't want to incorporate connection
string to managment database into an adapter. Is using BizTalkOM the only
way how to figure out if the property can be promoted ?

eXavier

"Paul Somers [MVP+BizTalk]" <paul@somers.com> wrote in message
news:%23LDc4eoaFHA.2128@TK2MSFTNGP14.phx.gbl...
> You can use the ExplorerOM library, the method you are looking for is:
>
> Microsoft.BizTalk.ExplorerOM.BtsCatalogExplorer _explorer = new
> BtsCatalogExplorer();
> // Connect the explorer
>
> _explorer.ConnectionString = connectionString; // Very important to set

the
> connection string to the management db.
>
> _explorer.Schemas[name];
>
> This will return the schema for your desired assembly, to check that it
> exists, if it return null, then its not deployed.
>
> To check if your assembly with the schema is deployed, try:
> _explorer.Assemblies[name]
>
> <Joerg Fischer> wrote in message
> news:exl7mUoaFHA.3048@TK2MSFTNGP12.phx.gbl...
acting[vbcol=seagreen]
not[vbcol=seagreen]
SystemMessageContext(message.Context);[vbcol=seagreen]
>
>



Yossi Dahan

2005-06-30, 7:48 am

A simple try catch will do the trick for you, won't it?
Try it the first time, if you fail keep an indication in memory so you don't
have to keep trying.

Yossi Dahan



"eXavier" <fhns@centrum.cz> wrote in message
news:e1e915BbFHA.3400@tk2msftngp13.phx.gbl...
> Thanks for your response, but I really don't want to incorporate
> connection
> string to managment database into an adapter. Is using BizTalkOM the only
> way how to figure out if the property can be promoted ?
>
> eXavier
>
> "Paul Somers [MVP+BizTalk]" <paul@somers.com> wrote in message
> news:%23LDc4eoaFHA.2128@TK2MSFTNGP14.phx.gbl...
> the
> acting
> not
> SystemMessageContext(message.Context);
>
>



Paul

2005-07-04, 7:48 am

If you are using the right user, then integrated security is all you need
for connection sting.

"eXavier" <fhns@centrum.cz> wrote in message
news:e1e915BbFHA.3400@tk2msftngp13.phx.gbl...
> Thanks for your response, but I really don't want to incorporate
> connection
> string to managment database into an adapter. Is using BizTalkOM the only
> way how to figure out if the property can be promoted ?
>
> eXavier
>
> "Paul Somers [MVP+BizTalk]" <paul@somers.com> wrote in message
> news:%23LDc4eoaFHA.2128@TK2MSFTNGP14.phx.gbl...
> the
> acting
> not
> SystemMessageContext(message.Context);
>
>



eXavier

2005-07-28, 2:48 am

Not true in our scenario - biztalk database is on dedicated (clustered) DB
server which hosts several installation of biztalk databases, so there are
databases
App1BiztalkMgmtDb, App2BiztalkMgmtDb, ...



"Paul" <paul@somers.com> wrote in message
news:erRu69IgFHA.2700@TK2MSFTNGP15.phx.gbl...
> If you are using the right user, then integrated security is all you need
> for connection sting.
>
> "eXavier" <fhns@centrum.cz> wrote in message
> news:e1e915BbFHA.3400@tk2msftngp13.phx.gbl...
only[vbcol=seagreen]
set[vbcol=seagreen]
it[vbcol=seagreen]
please[vbcol=seagreen]
library[vbcol=seagreen]
to[vbcol=seagreen]
promoting[vbcol=seagreen]
error[vbcol=seagreen]
>
>



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com