BizTalk Server General - Manual Invokation of orchestration from remote machine.

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server General > November 2004 > Manual Invokation of orchestration from remote machine.





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 Manual Invokation of orchestration from remote machine.
Ashish Shukla

2004-09-29, 8:03 pm

Hi BizTalk Gurus

I have a requirement where I need to invoke orchestration through code. I
found the SubmitDirect adapter in SDK was perfect for me. I will be invoking
orchestration through a web application. Web server is hosted on a different
machine and BizTalk server is on different machine. If I use the dll provided
in the SDK on my web application, how will it know which BizTalk server to
connect to and where. Please advice me what I need to do to get this working.
Is registering the TransportProxyUtils.dll(supplied with SubmitDirect adapter
sample), on web server enough.

Thanks
Ashish Shukla
Gilles [MSFT]

2004-09-29, 8:03 pm

Hello,

>I have a requirement where I need to invoke orchestration through code. I
>found the SubmitDirect adapter in SDK was perfect for me. I will be invoking
>orchestration through a web application. Web server is hosted on a different
>machine and BizTalk server is on different machine. If I use the dll provided
>in the SDK on my web application, how will it know which BizTalk server to
>connect to and where. Please advice me what I need to do to get this working.
>Is registering the TransportProxyUtils.dll(supplied with SubmitDirect adapter
>sample), on web server enough.


The direct submit allows you to submit mesasges to the message box directly. As a result,
an orchestartion with the right subscription will be activated.

Is there any reason why you cannot send a message from your web application to a port (perhaps an HTTP port)?
This is really simple, in fact simpler that the submit direct: you define an HTTP receive port (and an optional pipeline).
In your web application, use the .NET object HttpWebRequest or equivalent (WebClient) to post a message.
That would work for any machine, remote or not. I believe this solution is superior to yours, at least with the limited amount
of information I have gleaned from your post.

The Biztalk tutorial has already such a sample application that you could reuse in your web application.
Make sure you download the tutorial (free):

http://www.microsoft.com/downloads/...&displaylang=en

After installing it, look under <bts install directory>\SDK\Tutorial\Lessons\BAS\HttpPost.
If you cannot install it for some reason, I have copied the code below:

byte[] buffer = null;
Stream f = null; // File stream
Stream s = null; // Http Request stream

// Initialize the web request
WebClient cli=new WebClient();

// <-- Put the proper credentials here, if any are needed -->
cli.Credentials=CredentialCache.DefaultCredentials;

// Loop through the files and post them to the passed in URL
buffer = new byte[1024];

// <-- Make sure f is a stream to the data you want to send -->
// <-- Maybe a string reader or a file -->
f=File.OpenRead(<file> );

// <-- Replace url below with the actual URL of the receive location -->
// <-- This perhaps comes from web.config -->
s=cli.OpenWrite(url,"POST");
while(f.Position<f.Length)
{
int bytes=f.Read(buffer,0,1024);
s.Write(buffer,0,bytes);
}
s.Close();
s = null;
f.Close();
f = null;

You can even use other methods in WebClient to facilitate the upload process (UploadData for instance).

Thanks,
-Gilles.

Ashish Shukla

2004-09-30, 10:40 am

Hi Gilles

Thanks a lot for your reply. I will try out what you have suggested.

Thanks and Regards
Ashish Shukla


Ashish Shukla

2004-10-04, 5:52 pm

Hi Gilles

I tried what you had suggested. I have a orchestration with a port using
http adapter and I send xml document to that url and everything is fine. I
have another question. We need to use BTSHTTPReceive.dll. Do we need to have
the virtual directory with the above mentioned dll on the same machine where
biztalk is installed or this dll can be put on any web server. If yes please
direct me to the documentation.

THanks and Regards
Ashish Shukla




"Gilles [MSFT]" wrote:

> Hello,
>
>
> The direct submit allows you to submit mesasges to the message box directly. As a result,
> an orchestartion with the right subscription will be activated.
>
> Is there any reason why you cannot send a message from your web application to a port (perhaps an HTTP port)?
> This is really simple, in fact simpler that the submit direct: you define an HTTP receive port (and an optional pipeline).
> In your web application, use the .NET object HttpWebRequest or equivalent (WebClient) to post a message.
> That would work for any machine, remote or not. I believe this solution is superior to yours, at least with the limited amount
> of information I have gleaned from your post.
>
> The Biztalk tutorial has already such a sample application that you could reuse in your web application.
> Make sure you download the tutorial (free):
>
> http://www.microsoft.com/downloads/...&displaylang=en
>
> After installing it, look under <bts install directory>\SDK\Tutorial\Lessons\BAS\HttpPost.
> If you cannot install it for some reason, I have copied the code below:
>
> byte[] buffer = null;
> Stream f = null; // File stream
> Stream s = null; // Http Request stream
>
> // Initialize the web request
> WebClient cli=new WebClient();
>
> // <-- Put the proper credentials here, if any are needed -->
> cli.Credentials=CredentialCache.DefaultCredentials;
>
> // Loop through the files and post them to the passed in URL
> buffer = new byte[1024];
>
> // <-- Make sure f is a stream to the data you want to send -->
> // <-- Maybe a string reader or a file -->
> f=File.OpenRead(<file> );
>
> // <-- Replace url below with the actual URL of the receive location -->
> // <-- This perhaps comes from web.config -->
> s=cli.OpenWrite(url,"POST");
> while(f.Position<f.Length)
> {
> int bytes=f.Read(buffer,0,1024);
> s.Write(buffer,0,bytes);
> }
> s.Close();
> s = null;
> f.Close();
> f = null;
>
> You can even use other methods in WebClient to facilitate the upload process (UploadData for instance).
>
> Thanks,
> -Gilles.
>
>

Gilles [MSFT]

2004-10-04, 5:52 pm

Hello,

[...]

>I tried what you had suggested. I have a orchestration with a port using
>http adapter and I send xml document to that url and everything is fine. I
>have another question. We need to use BTSHTTPReceive.dll. Do we need to have
>the virtual directory with the above mentioned dll on the same machine where
>biztalk is installed or this dll can be put on any web server. If yes please
>direct me to the documentation.


BTSHttpReceive.dll is the piece that allows BizTalk to receive messages from HTTP. IN other words, it listens to
incoming HTTP connections and figures out which message should be sent to which port.

Internally, BTSHttpReceive needs to submit a message to BizTalk and its uses a mecanism that is similar to the
"submitdirect" example you first investigated. It sounds like you have only one BizTalk machine so in this case, yes,
BTSHttpReceive has to be on the same machine as BizTalk.

Thanks,
-Gilles.

Ashish Shukla

2004-10-05, 5:54 pm

Hi Gilles

Thanks for the help.

Thanks and Regards
Ashish Shukla



"Gilles [MSFT]" wrote:

> Hello,
>
> [...]
>
>
> BTSHttpReceive.dll is the piece that allows BizTalk to receive messages from HTTP. IN other words, it listens to
> incoming HTTP connections and figures out which message should be sent to which port.
>
> Internally, BTSHttpReceive needs to submit a message to BizTalk and its uses a mecanism that is similar to the
> "submitdirect" example you first investigated. It sounds like you have only one BizTalk machine so in this case, yes,
> BTSHttpReceive has to be on the same machine as BizTalk.
>
> Thanks,
> -Gilles.
>
>

Vish

2004-11-09, 5:49 pm

Hi,

I have a question regarding the orchestration as a webservice. I tried
exposing the orchestration as web services and used the webservice publishing
wizard. The wizard created the webservice which is in turn calling the
orchestration. This webservice is referred as server proxy so i guess we will
need a client proxy to call this webservice which in turn calls the
orchestration. Now since the orchestration can directly consume a SOAP
message why should we add extra layer of proxies for the same process ? Is it
not advantageous to make a http or a soap call to the orchestration on the
biztalk server directly ? The only concern is security but we can use SSL or
multi header SOAP message. Let me know. Thanks!


"Ashish Shukla" wrote:
[vbcol=seagreen]
> Hi Gilles
>
> Thanks for the help.
>
> Thanks and Regards
> Ashish Shukla
>
>
>
> "Gilles [MSFT]" wrote:
>
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com