|
Home > Archive > BizTalk Server General > April 2004 > Dynamic use of FTP 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 |
Dynamic use of FTP Adapter
|
|
| Christof 2004-04-25, 10:35 am |
| Hi Samyu!
Have good news for you :-) Please do following:
- construct a dynamic send port
- connect your send shape to it
- before sending a message to it, drop an expression shape
- enter following to achieve your goals: (just a sample, you'll need to
adjust)
//configure your dynamic FTP port:
orchprtSndMyMessagePort(Microsoft.XLANGs.BaseTypes.Address) =
ftp://myserver/mydirectory/myfilename.xml;
//set context on the message you want to send:
msgMyMessage(FTP.UserName) = "myFTPUsername";
msgMyMessage(FTP.Password) = "myFTPPassword";
msgMyMessage(BTS.RetryCount) = 20;
msgMyMessage(BTS.RetryInterval) = 2;
So far the dynamic use of the FTP adapter. There's no way you can grasp the
return value of the FTP operation. That kind of things is completely hidden
by the adapter itself. HOWEVER: to achieve your final goal (being: just
knowing whether it succeeded): there's a switch on the level of your
orchestration's send port, called: "DeliveryNotification". Set this to
"Transmitted". This will ensure that your orchestration stops working,
until the adapter has succesfully transmitted the message. If the message
fails, an exception will be thrown "XLang.DeliveryFailureException" (Not
sure... just a guess.). You can catch this one if you like.
Kind regards,
Christof
"Samyu" <anonymous@discussions.microsoft.com> wrote in message
news:CCC24F94-6974-40FB-8671-5D16EE315E0C@microsoft.com...
> Christof
>
> Thanks for your help. First of all, I would like to know how to configure
FTP Adpater.
> I know that we can give user name and password at design time by clicking
on properties.
>
> But in my case, depending on a condition the ftp path, user name and
password would vary.
> Hence I used to store thse information in DB and fetch it and do the
necessart ftp.
> How will I achieve this?
>
> After successful completion of ftping the files, I need to know the
status.
>
> Depending on its success or failure, I need to send additional files for
the same.
>
> Thanks in advance
| |
|
| Christof
Thanks a lot for your guidance
I will try out a sample, can you please correct if I end up with any issues..
| |
| Samyu 2004-04-26, 11:37 am |
| Hi christof
I tried your sample
How will I give the following
//set context on the message you want to send:
msgMyMessage(FTP.UserName) = "myFTPUsername";
msgMyMessage(FTP.Password) = "myFTPPassword";
msgMyMessage(BTS.RetryCount) = 20;
msgMyMessage(BTS.RetryInterval) = 2;
I understand that msgMyMessage is a message whose message operation type property is set to a
valid schema. But assuming msgMyMessage do not have these details (FTP username, etc.,),
as I need to fetch the same from DB, how will I assign to message variables and use it?
I am not very clear about this. Please explain.
| |
| Samyu 2004-04-26, 11:37 am |
| Christof
I will be getting a flat file schema to this send port which may not have hold any ftp details.
Also, while configuring a direct binding in send port, whcih option should I select such as
Correlation, directiong to other orchestration etc.,?
Thanks in advance
| |
| Christof 2004-04-26, 1:37 pm |
| Enter this in the construct message shape for your outbound message.
The FTP.UserName etc are part of the FTP adapter's context. This kind of
context can be set regardless of the type of message you send. Just try it,
then come back to me :-)
The strings "myFTPUsername" and "myFTPPassword" for example can be variables
as well. (Just call a .NET component wich fetches those from a database.)
Kind regards,
Christof
"Samyu" <anonymous@discussions.microsoft.com> wrote in message
news:13592348-F88A-4F96-8273-312AA16BB502@microsoft.com...
> Hi christof
>
> I tried your sample
>
> How will I give the following
>
> //set context on the message you want to send:
> msgMyMessage(FTP.UserName) = "myFTPUsername";
> msgMyMessage(FTP.Password) = "myFTPPassword";
> msgMyMessage(BTS.RetryCount) = 20;
> msgMyMessage(BTS.RetryInterval) = 2;
>
> I understand that msgMyMessage is a message whose message operation type
property is set to a
> valid schema. But assuming msgMyMessage do not have these details (FTP
username, etc.,),
> as I need to fetch the same from DB, how will I assign to message
variables and use it?
>
> I am not very clear about this. Please explain.
>
| |
| Christof 2004-04-26, 2:35 pm |
| I'm sorry... must have missed something. Where did you need direct binding
for please?
Aren't you going to use the dynamic port type?
Direct binding enables to do publish subscribe between orchestrations. Is
this what you need?
Kind regards,
Christof
"Samyu" <anonymous@discussions.microsoft.com> wrote in message
news:318C7A49-7ACF-46C3-8A12-B735DC5ED65C@microsoft.com...
> Christof
>
> I will be getting a flat file schema to this send port which may not have
hold any ftp details.
> Also, while configuring a direct binding in send port, whcih option should
I select such as
> Correlation, directiong to other orchestration etc.,?
>
> Thanks in advance
| |
| Samyu 2004-04-27, 12:35 am |
| Christof
Sorry if I am not clear..after successfully BTS creating the flat file, it has to be ftp'd using FTP Adapter
This adpter would get the necessary details (Username, ftppath, ftpserver, ip, password etc.,) from a DB.
Once it is received it would ftp the files to that location and not to any orchestration.
Thanks
Samyu
| |
| Christof 2004-04-27, 9:36 am |
| Please Samyu...
Reread my posting on how to set the password, username, ftp location at
*runtime*.
I think you didn't understand me. By no means you need to use direct
binding.
Kind regards,
Christof
"Samyu" <anonymous@discussions.microsoft.com> wrote in message
news:68040615-54DC-49F3-987C-031F942D6D0E@microsoft.com...
> Christof
>
> Sorry if I am not clear..after successfully BTS creating the flat file, it
has to be ftp'd using FTP Adapter
> This adpter would get the necessary details (Username, ftppath, ftpserver,
ip, password etc.,) from a DB.
> Once it is received it would ftp the files to that location and not to any
orchestration.
>
> Thanks
> Samyu
| |
| Samyu 2004-04-29, 10:36 am |
| Christof
I tried the fiollowing to send an XML file to a FTP location
1) Created the follwing schema
<Vendors><alcoholicVendor name="Alcoholic"><Attribute type="Drink" value="10"></alcoholicVendor></Vendors>
2) Created a Receive Port as Static One-way port and created a receive location as below:
Set its Transport Type as FILE and Address URI as a folder location and Receive Pipeline as
Microsoft.BizTalk.DefaultPipelines.PassThruReceive (Microsoft.BizTalk.DefaultPipelines.PassThruReceive, Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
3) Created a Send Port and set its Transport Type as FTP and gave the FTP location at its Address URI
Gave Send Pipeline as Microsoft.BizTalk.KwTpm.StsDefaultPipelines.StsSendPipeline (Microsoft.BizTalk.KwTpm.StsDefaultPipelines.StsSendPipeline, Microsoft.BizTalk.KwTpm.StsDefaultPipelines, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
Rebuild the project
Deployed the project
I placed a sample XML in the receive folder.
It is not getting picked up by the BizTalk process. I am getting error in the Eventviewer as some or parts of the message could not be taken etc.,
Thanks
| |
| Samyu 2004-04-29, 11:36 am |
| Christof
I am getting the following error:
There was a failure executing the receive pipeline: "Microsoft.BizTalk.DefaultPipelines.XMLReceive" Source: "XML disassembler" Receive Location: "D:\RP 1.1\Working samples\FTPTest\Input\*.xml" Reason: The disassembler cannot retrieve the document specific
ation by using this type: "Vendors". Either the schema is not deployed correctly, or more than one schema is deployed for the same message type.
| |
| Christof 2004-04-29, 6:36 pm |
| You probably have more then one schema deployed with both at the same time:
the same target namespace (tns)
the same roottag name (rtn)
Two solutions to this:
- remove all schema's until each schema has unique combination of tns and
rtn
- create custom pipeline and put explicit reference in it to the schema you
want to use
Kind regards,
Christof
"Samyu" <anonymous@discussions.microsoft.com> wrote in message
news:C46A4130-925F-40C8-BE59-30C4BB3DF3A1@microsoft.com...
> Christof
>
> I am getting the following error:
>
> There was a failure executing the receive pipeline:
"Microsoft.BizTalk.DefaultPipelines.XMLReceive" Source: "XML disassembler"
Receive Location: "D:\RP 1.1\Working samples\FTPTest\Input\*.xml" Reason:
The disassembler cannot retrieve the document specification by using this
type: "Vendors". Either the schema is not deployed correctly, or more than
one schema is deployed for the same message type.
| |
|
| Christof
I found where the problem was. It was with the input XML file. Well, I am able to successfully FTP the files, if I do in a STATIC WAY.
When I tried dynamic , I am able to set the Address type as you had given.
But when I gave UserName and Password in the MessageAssignment Shape inside ConstructMessage, I am getting the following error:
FTP_Out: message has not been initialized in construct statement
Use of unconstructed message 'FTP_Out'
I have done the following:
1) Created a simple schema
2) Created an orchestration with Receive shape connected to a Receive Port
3) Placed a ConstructShape and placed the code which you sent inside a Message assignment
When I do a Build, I am getting the above mentioned error
| |
| Christof 2004-04-30, 6:43 pm |
| Did you assign the incoming message to the outgoing first?
Regards,
Christof
"Samyu" <anonymous@discussions.microsoft.com> wrote in message
news:2410DBBE-CF81-4E5A-9579-B30B0D3CE64B@microsoft.com...
> Christof
>
> I found where the problem was. It was with the input XML file. Well, I am
able to successfully FTP the files, if I do in a STATIC WAY.
>
> When I tried dynamic , I am able to set the Address type as you had given.
> But when I gave UserName and Password in the MessageAssignment Shape
inside ConstructMessage, I am getting the following error:
>
> FTP_Out: message has not been initialized in construct statement
> Use of unconstructed message 'FTP_Out'
>
> I have done the following:
>
> 1) Created a simple schema
> 2) Created an orchestration with Receive shape connected to a Receive Port
> 3) Placed a ConstructShape and placed the code which you sent inside a
Message assignment
>
> When I do a Build, I am getting the above mentioned error
>
>
|
|
|
|
|