Petals Getting started - day 3 - Expose a FTP Service in SOAP

Hi again Petals Padawan. Glad to see you're still on board !
For your 3rd day, you will connect Petals to an FTP server, and expose the created FTP service as a SOAP web-service, outside Petals ESB.

Last tested with
  • Petals ESB 3.1
  • Petals Studio 1.1.0
  • Petals SE RMI 1.1.1
  • Petals BC SOAP 4.0.2
  • Petals Webconsole 2.0.3
  • Tomcat 6.0.29
  • JDK 6 update 20

Added in this tutorial :

  • Petals BC FTP 3.2.1
  • soapUI 3.6

Deploy a FTP Service Unit

Install and Deploy BC-FTP

Configure and deploy a FTP Service-Unit for [ftp.petalslink.com]

  1. Start Petals ESB.
  2. Launch Petals Studio.
  3. File => New => Service Unit Project: Service Unit - Select the kind of service to create.
  4. Select: Provide / FTP / Current_Version => Next: FTP Service-Unit - Defines the JBI properties of the service to import.
    1. Service Name: FtpTutorial
  5. Next => Next: FTP Service-Unit - Define the specific properties for this version of the component.
    1. Server: ftp.petalslink.com
    2. Port: 21
    3. User: petals
    4. Password: demo
    5. Folder: /
      <folder> attribute is written as optionnal in Studio, but it is not. It will be optional in BC-FTP v3, so as soon as it is published, you will not need to specify the folder attribute for the tutorial
    6. Transfer Type: auto
    7. Connection Mode: active
  6. Finish.
  7. Give a look at the generated jbi.xml. You see the component configuration.
    You should have a jbi.xml like that :
    jbi.xml
    <jbi:provides
    interface-name="generatedNs:FtpInterface"
    service-name="generatedNs:FtpTutorial"
    endpoint-name="FtpTutorialEndpoint">
    
    <\!-\- CDK specific elements -->
    <petalsCDK:timeout>30000</petalsCDK:timeout>
    <petalsCDK:validate-wsdl>true</petalsCDK:validate-wsdl>
    <petalsCDK:forward-security-subject>false</petalsCDK:forward-security-subject>
    <petalsCDK:forward-message-properties>false</petalsCDK:forward-message-properties>
    <petalsCDK:forward-attachments>false</petalsCDK:forward-attachments>
    <petalsCDK:wsdl>FtpService.wsdl</petalsCDK:wsdl>
    
    <\!-\- Component specific elements -->
    <ftp:server>ftp.petalslink.com</ftp:server>
    <ftp:port>21</ftp:port>
    <ftp:user>petals</ftp:user>
    <ftp:password>demo</ftp:password>
    <ftp:folder>/</ftp:folder>
    <ftp:transfer-type>auto</ftp:transfer-type>
    <ftp:connection-mode>active</ftp:connection-mode>
    </jbi:provides>
    
    
  1. Give a look at the generated FtpService.wsdl. You see all operations available on the service.
  2. On the left "Petals projects" tree, right click on the Service-Unit Project : "su-FtpTutorial-provide" => Petals => Fast Export for Petals.
    Known bug for Studio v1.1.0 !
    Please check jbi.xml and FtpService !
    "interface-name" attribute in jbi.xml and "portType name" in the WSDL should have the same value. If not, please correct FtpService.wsdl :
    1. SELECT:
      <wsdl:portType name="Ftp">
    2. REPLACE BY:
      <wsdl:portType name="FtpInterface">

    ALTERNATIVE SOLUTION:
    Open the WSDL file in Studio, go on "general" tab, Clic "Helpers" on the Up-Right => Clic "Update the service end-point in the WSDL".

    This is a known bug in Petals Studio 1.1.0. It should be corrected in version 1.1.1

  3. Copy-Paste the generated sa-FTP-FtpTutorial-provide.zip to Petals ESB ./install/ folder to deploy it.
  4. Check that the SA deployed successfully in Petals ESB traces.

Test and monitor in Webconsole

Send DIR Operation on root folder

  1. Start the Webconsole
  2. Server:0 => Text panel => Send
  3. Select
    1. Endpoint: FtpTutorialEndpoint
    2. Operation: dir
    3. MEP: InOut
  4. Submit

Change destination folder

  1. Got to ftp://ftp.petalslink.com in your web or ftp browser, using previous login. You see there is an "Integration" folder. Let's go there.
  2. Go to Petals Studio
  3. Edit FtpTutorial jbi.xml
  4. Change <folder>/</folder> to <folder>Integration</folder>
  5. Uninstall the previous SA
  6. Fast export for Petals ESB

Redeploy the component

  1. Go in Webconsole/Server:0/Administration/Service-Assemblies
  2. Uninstall the previous FtpTutorial SA (Stop=>Shutdown=>Uninstall)
    As for installing, you can use three methods:
    • Webconsole. Stop=>Shutdown=>Uninstall (alternatives if needed: "force undeploy" or "clear all")
    • Autoloader: Remove the corresponding .ZIP package from ./petals-platform-xxx/installed/
    • Command Line: hu or hotundeploy

Expose the FTP in SOAP

Proxify the FTP operations with SOAP (15min)

Test with SOAP UI

Download SOAPUI and install it. SOAP UI is a client to send and receive SOAP messages.
Create a SOAPUIproject with the proxified FTP (10min)
Test the FTP with SOAPUI (10min)
Webconsole technical monitoring (5min)

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.