0

在此处输入图像描述

<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>
      

我收到的 FTP 命令未绑定在有效负载子项中。我需要执行 FTP 命令。谁能帮我这个?我想测试FTP,例如上传下载PWD MKD CWD。

4

1 回答 1

0

您需要在根元素 spring:beans 中声明 ftp 消息模式的 XML 命名空间,例如

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

还请添加架构位置。

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

于 2021-03-25T21:38:35.527 回答