Mombu the Microsoft Forum sponsored links

Go Back   Mombu the Microsoft Forum > Microsoft > Dynamic port binding
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 7th May 18:48
sb򚋬v+ˢ{&貇r
External User
 
Posts: 1
Default Dynamic port binding


Can someone help me to create the dynamic http send port with dynamic basic authentication username and password and dynamic url queryparameters

thx. in advance
  Reply With Quote


  sponsored links


2 7th May 18:48
azhang
External User
 
Posts: 1
Default Dynamic port binding


Since with dynamic port, you do not have UI property configurations, you
have to supply these information on the message context properties yourself.

The context properties are:
AuthenticationScheme -> "Basic"
Username YourName
Password YourPass

The namespace for the context properties is:
"http://schemas.microsoft.com/BizTalk/2003/http-properties"

For outbound URL manipulation, you can adjust this property by append the
querystrings to the end.
OutboundTransportLocation. ->
Namespace for this context property is :
"http://schemas.microsoft.com/BizTalk/2003/system-properties"

There are three ways of doing it:
1. Prompt these from XML messages. Althought this is simpler, giving the
security information will be clear text, it is NOT recommended.
2. Create a custome pipeline component, and in the Execute() call write the
information onto the context.
inMsg.Context.Write("AuthenticationScheme",
"http://schemas.microsoft.com/BizTalk/2003/http-properties", "Basic");
...
It is fairly straigtforward.
3. Go thru an orchestration and adjust the context properties. However, it
is not as performent as No. 2.

Hope this helps. Thanks!

- Allen Zhang (MSFT)

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------


basic authentication username and password and dynamic url queryparameters?

thx. in advance
  Reply With Quote
3 7th May 18:48
sb򚋬v+ˢ{&貇r
External User
 
Posts: 1
Default Dynamic port binding


I've to use the parties with this send port. Since I cannot use the dynamic send port, do you think I can use the static send port and still add the dynamic query string to the url.
  Reply With Quote
4 7th May 18:48
azhang
External User
 
Posts: 1
Default Dynamic port binding


With static ports, you can create a custom pipeline components and modify
the OutboundTransportLocation location property to add additional
querystring as needed, the adapter will pick up the updated setting. So
answer is yes.

- Allen Zhang (MSFT)

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------


dynamic send port, do you think I can use the static send port and still
add the dynamic query string to the url.
  Reply With Quote
5 7th May 18:49
azhang
External User
 
Posts: 1
Default Dynamic port binding


You won't be dealing with the predefined pipeline anymore. It will be a
custom pipeline that contains all the existing pipeline compnents in
BTAHL72X plus your custom pipeline components at the end.

There is a sample custom pipeline component in
SDK\Sample\Pipeline\CustomComponent\FixMsg. Depending where you get your
dynamic query string data, it could be very simple or a little bit more
complex.

If you already have the value (from design time or hard coded), all you
need to do is just update the OutboundTransportLocation (OTL) in the
Excute() call and that will be it.

OR

If the query string is being extracted (prompted) from say a XML data file,
then you have two options. Because all of the default pipeline components
process the data in streaming fashion so that large message will not occupy
large memory footprint. With that design, you will only know all prompted
properties once the stream has been complete pulled. There are two ways you
can go about doing this:

1. Pull the stream of inmsg completely in your component, then you will be
able to access all of the prompted properties on the inmsg. Then you can
set your OTL context property. Note: you will need to wrap the stream in
your own seekable stream so that down level can access the data in your
outmsg. Also if you will be dealing with large messages with high load, you
could run into perf issue or even Out of Memory.

2. Perserve the streaming processing. In Excecute(), listen for
AfterLastRead event on the stream.

InMessage = inmsg;
messagePart = inmsg.BodyPart;

if( messagePart != null )
{
Stream DataStream =
messagePart.GetOriginalDataStream();
evts = DataStream as IProvideReadStreamEvents;
// This is in the Microsoft.BizTalk.Streaming.dll in the GAC, you
may have to copy
}
// it out
to add to reference.

if( evts != null)
{
evts.AfterLastReadEvent += new
AfterLastReadEventHandler(OnLastRead);
}
Else // Someone has replaced and pull the original
stream, you should have all of the properties now.

In OnLastRead, you can set the OTL based on some other context properties.

In your scenario, 2 is recommended.

- Allen Zhang (MSFT)

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------


pipeline using the predefined pipeline, i.e in my case "BTAHL72X.." flat
file pipeline. I just want to change the "OutboundTransportLocation" and
the http basic authentication's username and the password based on some
variables/messages. thx. in advance.
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666