FTP command Citrus

99 views Asked by At

enter image description here

<spring:beans 
xmlns="http://www.citrusframework.org/schema/testcase"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:citrus="http://www.citrusframework.org/schema/config"
xmlns:citrus-ftp="http://www.citrusframework.org/schema/ftp/config"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.citrusframework.org/schema/testcase
http://www.citrusframework.org/schema/testcase/citrus-testcase.xsd 
http://www.citrusframework.org/schema/ftp/config
http://www.citrusframework.org/schema/ftp/config/citrus-ftp-config.xsd">
<citrus-ftp:client id="ftpClient"
      host="localhost"
      port="21"
      username="ravi"
      password="admin"
      timeout="10000"/>
<template name="MyFTP">        
        <send endpoint="ftpClient" fork="true">
          <message>
            <payload>
              <ftp:command>
                <ftp:signal>MKD</ftp:signal>
                <ftp:arguments>test</ftp:arguments>
              </ftp:command>
            </payload>
          </message>
        </send>
        <receive endpoint="ftpClient">
  <message>
  <payload>
  <ftp:command-result>
  <ftp:success>true</ftp:success>
  <ftp:reply-code>257</ftp:reply-code>
  <ftp:reply-string>257 "/test" created.</ftp:reply-string>
  </ftp:command-result>
  </payload>
  </message>
</receive>
</template>    

</spring:beans>
      

I am getting FTP command not bound in payload child. I need to execute the FTP commands. can anyone help me with this? I want to test the FTP such as upload download PWD MKD CWD.

1

There are 1 answers

1
Christoph Deppisch On BEST ANSWER

You need to declare the XML namespace of the ftp message schema in the root element spring:beans like

xmlns:ftp="http://www.citrusframework.org/schema/ftp/message"

Please also add the schema location.

http://www.citrusframework.org/schema/ftp/message http://www.citrusframework.org/schema/ftp/citrus-ftp-message.xsd