WMI to create FTP Receive Location
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > BizTalk Server > BizTalk Server Framework > WMI to create FTP Receive Location




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    WMI to create FTP Receive Location  
Dan Cagney


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-09-05 10:51 PM

I'm having an issue creating an FTP Receive Location using WMI.  The locatio
n
is created successfully, and the location even polls the FTP site, but when 
I
check the location's log that logs all of the FTP commands, the second to
last command is LIST *.*, which returns the files I want to retrieve, and
then a QUIT.  There is never a RETR.  If I create the exact same Receive
Location using the BizTalk Explorer, it works correctly.  I have even
compared the CustomCfg of both to make sure they are exact.  Are there extra
properties that need to be set that I'm missing?  Any help would be
appreciated.  I am including the code I used to create the Receive Location.
Thanks,

Dan

Public Function CreateFTPReceiveLocation(ByVal inReceiveLocationName As
String, ByVal inReceivePortName As String, ByVal inHostName As String, ByVal
inServer As String, ByVal inPort As Integer, ByVal inFolder As String, ByVal
inFileMask As String, ByVal inRecLocStatus As ReceiveLocationStatus, ByVal
inUserName As String, ByVal inPassword As String, ByVal inMaxFileSize As
Integer) As Boolean
Try
Dim objReceiveLocationClass As New
ManagementClass("root\MicrosoftBizTalkServer", "MSBTS_ReceiveLocation",
Nothing)
Dim objReceiveLocation As ManagementObject =
objReceiveLocationClass.CreateInstance()

objReceiveLocation("Name") = inReceiveLocationName
objReceiveLocation("ReceivePortName") = inReceivePortName
objReceiveLocation("AdapterName") = "FTP"
objReceiveLocation("HostName") = inHostName
objReceiveLocation("InboundTransportURL") = "ftp://" & inServer
& ":" & inPort & "/" & inFolder & "/" & inFileMask
'objReceiveLocation("CustomCfg") = "<CustomProps><AdapterConfig
vt=""8""><Config xmlns:xsd=""http://www.w3.org/2001/XMLSchema""
xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""><uri>" & "ftp://" &
inServer & ":" & inPort & "/" & inFolder & "/" & inFileMask &
"</uri><serverAddress>" & inServer & "</serverAddress><serverPort>" & inPort
& "</serverPort><userName>" & inUserName & "</userName><password>" &
inPassword & "</password><fileMask>" & inFileMask &
"</fileMask><targetFolder>" & inFolder &
"</targetFolder><representationType>binary</representationType><maximumBatch
Size>0</maximumBatchSize><maximumNumberOfFiles>0</maximumNumberOfFiles><pass
iveMode>False</passiveMode><firewallType>NoFirewall</firewallType><firewallP
ort>21</firewallPort><polli
ngUnitOfMeasure>Seconds</pollingUnitOfMeasure><pollingInterval>60</pollingIn
terval><errorThreshold>10</errorThreshold><maxFileSize>0</maxFileSize></Conf
ig></AdapterConfig></CustomProps>"
objReceiveLocation("PipelineName") =
ConfigurationSettings.AppSettings("PipelineName")

Dim options As New PutOptions
options.Type = PutType.CreateOnly

objReceiveLocation.Put(options)

 ReceiveLocationEnable(inReceiveLocationN
ame, inRecLocStatus)

System.Console.WriteLine("ReceiveLocation - " +
inReceiveLocationName + " - has been created successfully")
Return True
Catch excep As Exception
Throw New Exception("CreateFTPReceiveLocation - " +
inReceiveLocationName + " - failed: " + excep.Message)
System.Console.WriteLine("CreateFTPReceiveLocation - " +
inReceiveLocationName + " - failed: " + excep.Message)
End Try






[ Post a follow-up to this message ]



    Re: WMI to create FTP Receive Location  
KOrnel


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-12-05 12:47 PM

You should export all the settings of the manually created FTP Receive
Location. Check all the values and create the receive location based on the
exported values.

KOrnel








[ Post a follow-up to this message ]



    Re: WMI to create FTP Receive Location  
Dan Cagney


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-14-05 10:53 PM

I have done this, and I still get the same result.  The receive location is
created successfully, but it just doesn't pick up files.  Any other
suggestions?  I really don't want to have to open another MS support ticket
about weird BizTalk issues.

Thanks,
Dan

"KOrnel" wrote:

> You should export all the settings of the manually created FTP Receive
> Location. Check all the values and create the receive location based on th
e
> exported values.
>
> KOrnel
>
>
>
>





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 03:30 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register