BizTalk Server Orchestration - HTTP Adapter

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server Orchestration > April 2005 > HTTP 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 HTTP Adapter
Neil Hewitt

2005-04-05, 5:50 pm

I dont quite understand the setting up of a HTTP adapter receive location.
If i have a URI of http://feeds.receivelocation.com/feed?feed_id=45 where i
have a flat file layout - can use the HTTP adapter in a receive port to
retreive this data.

to connect to this location i also require a username & password . i suspect
i dont fully understand the use of the HTTP adapter.

can BizTalk connect to a URL address and receive the data feed using a HTTP
Adapater ?


Saravana Kumar

2005-04-06, 2:55 am

Hello Neil,

HTTP Adapter on the Receive Side (Configured using a Receive port, Receive
Location, which uses BTSHTTPReceive.dll) is used to bring messages into
Biztalk server.

The client application post the message to the Receive port (which is
configured using IIS), say for example...if you are using a .NET client,
you'll create a HTTP Request and post it using HttpWebRequest class to the
URL http://server1/BTS/BTSHttpReceive.dll, which eventually bring the
message inside Biztalk Server. So you can see the HTTP receive adapter is
not doing any polling logic, it just acts as an entry point for messages
coming inside Biztalk via HTTP.

In your case you can implement your logic as an ASP.NET web application,
which return your feed.

You can then go ahead and create a Request-Response Biztalk SendPort using
HTTP adapter and point to the ASP.NET web application which will bring your
feed into Bizalk.

You can configure the authentication(username/password) in the SendPort.

--
Cheers
Saravana
http://saravanakumarmv.blogspot.com


"Neil Hewitt" <NeilHewitt@discussions.microsoft.com> wrote in message
news:E03F1423-8AFF-4D5F-8313-F8957006B1E5@microsoft.com...
>I dont quite understand the setting up of a HTTP adapter receive location.
> If i have a URI of http://feeds.receivelocation.com/feed?feed_id=45 where
> i
> have a flat file layout - can use the HTTP adapter in a receive port to
> retreive this data.
>
> to connect to this location i also require a username & password . i
> suspect
> i dont fully understand the use of the HTTP adapter.
>
> can BizTalk connect to a URL address and receive the data feed using a
> HTTP
> Adapater ?
>
>



Neal Walters

2005-04-06, 5:54 pm

Here is a sample VB/Script that can post an xml file to an http site. You
would have to use the FSO instead of the XML object if you need to submit a
flat file.


Dim xmlHttp
Dim doc
Dim strQuery
Dim strURL
Dim strPostBody
Dim xmlFileName

'allow drag/drop of filename onto this VB/Script
if WScript.Arguments.Count > 0 then
xmlFileName = WScript.Arguments(0)
else
xmlFileName = "D:\MyDir\CC71628_0309052202.xml"
end if

set xmlHttp = CreateObject("Microsoft.xmlHttp")
set doc = CreateObject("MSXML2.DOMDocument")

' Validate the document using the MSXML parser.
doc.load (xmlFileName)

If doc.parseError.errorCode Then
' Do something with the error. Could better error handling here
Wscript.Echo "Parse Error"
'else
' WScript.Echo doc.xml
End If

' Post the template.
'on error resume next

isAsynCall = False

sendData ="data=" & doc.xml

xmlHttp.Open "POST", "http://yoursite/yourApplication/BTSHttpReceive.dll",
isAsynCall
'xmlHttp.setRequestHeader "Content-type", "application/xml"
xmlHttp.setRequestHeader "Content-type","application/x-www-form-urlencoded"
xmlHttp.setRequestHeader "Content-Length",len(sendData)

xmlHttp.send sendData

' Retrieve the results.
'WScript.Echo doc.xml & vbcrlf
WScript.Echo " ResponseText=" & xmlHttp.responseText & _
" Status=" & xmlHttp.status & _
" text=" & xmlHttp.statusText

'Wscript.echo err.number & "desc=" & err.description
WScript.Echo "The end"



Neal Walters
http://Biztalk-Training.com
http://VBScript-Training.com

Neil Hewitt

2005-04-12, 5:53 pm

Thanks Saravana,

but i dont really understand what you said. i might be asking the wrong
questions as i am unfamilair with ASP.NET

Our client will be updating the data feed at a specific URL say
http://feedsreceive/feed?feed_id=45 which has the data in a flat file layout.


what are the steps required for me to get the data from this into a BizTalk
orchestration ?

as you explained i can use a Request-Reponse send port that points to a
ASP.NET web app.

what exactly does the ASP,NET app need to do?

"Saravana Kumar" wrote:

> Hello Neil,
>
> HTTP Adapter on the Receive Side (Configured using a Receive port, Receive
> Location, which uses BTSHTTPReceive.dll) is used to bring messages into
> Biztalk server.
>
> The client application post the message to the Receive port (which is
> configured using IIS), say for example...if you are using a .NET client,
> you'll create a HTTP Request and post it using HttpWebRequest class to the
> URL http://server1/BTS/BTSHttpReceive.dll, which eventually bring the
> message inside Biztalk Server. So you can see the HTTP receive adapter is
> not doing any polling logic, it just acts as an entry point for messages
> coming inside Biztalk via HTTP.
>
> In your case you can implement your logic as an ASP.NET web application,
> which return your feed.
>
> You can then go ahead and create a Request-Response Biztalk SendPort using
> HTTP adapter and point to the ASP.NET web application which will bring your
> feed into Bizalk.
>
> You can configure the authentication(username/password) in the SendPort.
>
> --
> Cheers
> Saravana
> http://saravanakumarmv.blogspot.com
>
>
> "Neil Hewitt" <NeilHewitt@discussions.microsoft.com> wrote in message
> news:E03F1423-8AFF-4D5F-8313-F8957006B1E5@microsoft.com...
>
>
>

Yossi Dahan

2005-04-13, 7:58 am

Neil

Your requirement is a little odd definitely possible.

What you need is an http receive, but you have to initiate the call.
What you need to do is setup a send-receive send port using the http with
the url of your feed.

You will to trigger this send port by submitting a message to it, now this
really depends on the RSS provider - some will accept almost anything, some
will require an empty call, and some won't work with it at all.

where the initiating message will come from is really up to your process,
but the response from the RSS provider, assuming it won't block your call
will be the RSS feed.

Yossi Dahan

"Neil Hewitt" <NeilHewitt@discussions.microsoft.com> wrote in message
news:E03F1423-8AFF-4D5F-8313-F8957006B1E5@microsoft.com...
>I dont quite understand the setting up of a HTTP adapter receive location.
> If i have a URI of http://feeds.receivelocation.com/feed?feed_id=45 where
> i
> have a flat file layout - can use the HTTP adapter in a receive port to
> retreive this data.
>
> to connect to this location i also require a username & password . i
> suspect
> i dont fully understand the use of the HTTP adapter.
>
> can BizTalk connect to a URL address and receive the data feed using a
> HTTP
> Adapater ?
>
>



Neil Hewitt

2005-04-13, 7:58 am

Thanks Yossi,

so if i understand the HTTP adapter for a receive or send port ( in this
case) has no way off connecting to a URL directly without some other
application (as described by Sarvana in a previous post) or by triggering
the send port by submitting a message to it?

is this different from the samples that come with BizTalk 2204 HTTP adapters?

As you say this depends on the RSS provider but what do mean by an empty
call? Within an orchestration a send location has a message defined - what
can i define this message so as to be an inititating message ?

"Yossi Dahan" wrote:

> Neil
>
> Your requirement is a little odd definitely possible.
>
> What you need is an http receive, but you have to initiate the call.
> What you need to do is setup a send-receive send port using the http with
> the url of your feed.
>
> You will to trigger this send port by submitting a message to it, now this
> really depends on the RSS provider - some will accept almost anything, some
> will require an empty call, and some won't work with it at all.
>
> where the initiating message will come from is really up to your process,
> but the response from the RSS provider, assuming it won't block your call
> will be the RSS feed.
>
> Yossi Dahan
>
> "Neil Hewitt" <NeilHewitt@discussions.microsoft.com> wrote in message
> news:E03F1423-8AFF-4D5F-8313-F8957006B1E5@microsoft.com...
>
>
>

Yossi Dahan

2005-04-13, 5:53 pm

Neil hi,

The thing with RSS feeds is that they do not initiate the call to you.
in order to get the data you have to call the url and receive the response.
this is why you have to use a two-way send port to the RSS address to get
the response.

I did not try an orchestration, but I believe if you define a message of
type System.String and use a pass-through pipeline on the send pipeline, at
least some of the RSS providers will return a response.

(I found that some of them do not like these calls)

Yossi Dahan

"Neil Hewitt" <NeilHewitt@discussions.microsoft.com> wrote in message
news:AE3B1352-C512-456A-A84D-8B71C58984FA@microsoft.com...[vbcol=seagreen]
> Thanks Yossi,
>
> so if i understand the HTTP adapter for a receive or send port ( in this
> case) has no way off connecting to a URL directly without some other
> application (as described by Sarvana in a previous post) or by
> triggering
> the send port by submitting a message to it?
>
> is this different from the samples that come with BizTalk 2204 HTTP
> adapters?
>
> As you say this depends on the RSS provider but what do mean by an empty
> call? Within an orchestration a send location has a message defined -
> what
> can i define this message so as to be an inititating message ?
>
> "Yossi Dahan" wrote:
>


Neil Hewitt

2005-04-13, 5:53 pm

Yossi

thanks for the reply.

i tried what you suggested and assigned a ' ' to the system string message.
this i used as the message to the send port which is the HTTP adapter with
the authentication username and password in the properties.

The error that i got was the following.

The "HTTP" adapter is suspending an outbound message going to destination
URL:"http://feeds.clientname.com/feed?feed_id=19". Details:"The remote server
returned an error: (403) Forbidden.".

does this mean that i cannot read this data feed using a send port request
reponse or is there something else that i am missing ?

"Yossi Dahan" wrote:

> Neil hi,
>
> The thing with RSS feeds is that they do not initiate the call to you.
> in order to get the data you have to call the url and receive the response.
> this is why you have to use a two-way send port to the RSS address to get
> the response.
>
> I did not try an orchestration, but I believe if you define a message of
> type System.String and use a pass-through pipeline on the send pipeline, at
> least some of the RSS providers will return a response.
>
> (I found that some of them do not like these calls)
>
> Yossi Dahan
>
> "Neil Hewitt" <NeilHewitt@discussions.microsoft.com> wrote in message
> news:AE3B1352-C512-456A-A84D-8B71C58984FA@microsoft.com...
>
>
>

Yossi Dahan

2005-04-14, 2:49 am

Well, its hard to say.
Two things I'd try first (if you didn't yet)
Can you browse to the Url? are you getting the same error?
try to write a simple http post application (or use an existing one, I'm
sure there are plenty of them)
and try to post a string to the address (try with some "test" string or
something and an empty post)
If you're getting the same error then yes - the server does not allow what
you need to do.
if you have access to the server log it might give more details on the
reason.

Personal note - I am leaving for a two-week vacation, so if this does not
help you I suggest you start a new thread and someone will pick it up.
sorry.

Hope this will all work for you,

Yossi Dahan

"Neil Hewitt" <NeilHewitt@discussions.microsoft.com> wrote in message
news:B8BCEE95-5341-4F59-9D71-0D444C54DD12@microsoft.com...[vbcol=seagreen]
> Yossi
>
> thanks for the reply.
>
> i tried what you suggested and assigned a ' ' to the system string
> message.
> this i used as the message to the send port which is the HTTP adapter with
> the authentication username and password in the properties.
>
> The error that i got was the following.
>
> The "HTTP" adapter is suspending an outbound message going to destination
> URL:"http://feeds.clientname.com/feed?feed_id=19". Details:"The remote
> server
> returned an error: (403) Forbidden.".
>
> does this mean that i cannot read this data feed using a send port request
> reponse or is there something else that i am missing ?
>
> "Yossi Dahan" wrote:
>


Neil Hewitt

2005-04-14, 5:53 pm

How exactly can i go about creating a Request-Response Biztalk SendPort using
HTTP adapter and point to the ASP.NET web application which will bring your
feed into Bizalk.

i myself dont know ASP.net so i will be asking another developer so all the
help that you can provide me so i can pass on would be greeatly appreciated.



"Saravana Kumar" wrote:

> Hello Neil,
>
> HTTP Adapter on the Receive Side (Configured using a Receive port, Receive
> Location, which uses BTSHTTPReceive.dll) is used to bring messages into
> Biztalk server.
>
> The client application post the message to the Receive port (which is
> configured using IIS), say for example...if you are using a .NET client,
> you'll create a HTTP Request and post it using HttpWebRequest class to the
> URL http://server1/BTS/BTSHttpReceive.dll, which eventually bring the
> message inside Biztalk Server. So you can see the HTTP receive adapter is
> not doing any polling logic, it just acts as an entry point for messages
> coming inside Biztalk via HTTP.
>
> In your case you can implement your logic as an ASP.NET web application,
> which return your feed.
>
> You can then go ahead and create a Request-Response Biztalk SendPort using
> HTTP adapter and point to the ASP.NET web application which will bring your
> feed into Bizalk.
>
> You can configure the authentication(username/password) in the SendPort.
>
> --
> Cheers
> Saravana
> http://saravanakumarmv.blogspot.com
>
>
> "Neil Hewitt" <NeilHewitt@discussions.microsoft.com> wrote in message
> news:E03F1423-8AFF-4D5F-8313-F8957006B1E5@microsoft.com...
>
>
>

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com