Java 使用camel通过http发送普通soap

Java 使用camel通过http发送普通soap,java,spring,apache-camel,Java,Spring,Apache Camel,我正在尝试设置一个非常简单的路由,通过http发送SOAP内容,然后显示响应: <route> <from uri="direct:start"/> <setBody> <constant><![CDATA[<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"><SOAP:Header></SOA

我正在尝试设置一个非常简单的路由,通过http发送SOAP内容,然后显示响应:

<route>
    <from uri="direct:start"/>
    <setBody>
        <constant><![CDATA[<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"><SOAP:Header></SOAP:Header><SOAP:Body></SOAP:Body></SOAP:Envelope>]]>
        </constant>
    </setBody>
    <to uri="https://localhost:8443/api"/>
    <log message="${out.body}"/>
</route>

您尚未设置某些标题

尝试修改您的路线,如下所示:


邮递
text/xml;字符集=UTF-8
gzip,放气
]]>

我更改了路由的开头,因为我不知道您如何将消息发送到
direct:start

您没有设置一些标题

尝试修改您的路线,如下所示:


邮递
text/xml;字符集=UTF-8
gzip,放气
]]>

我更改了路由的开头,因为我不知道如果没有SOAPAction http头、WS-Addressing头或SOAP正文内容,您的web服务将无法对服务方法执行任何调度。如果没有SOAPAction http头,WS-Addressing标头或SOAP正文内容您的web服务无法对服务方法执行任何调度。谢谢。我猜我误用了direct:component,从文档来看,我可以从另一条路径调用它。我还学习了我在一些骆驼罐中找到的一个主类来运行应用程序。是的,关于
direct
组件,您是对的,您可以从另一个路由(
)从
direct
)开始调用路由。谢谢。我猜我误用了direct:component,从文档来看,我可以从另一条路径调用它。我还使用了一些骆驼罐中的主类来运行应用程序。是的,关于
direct
组件,您是对的,您可以从另一个路由(
)从
direct
)开始调用路由。
public class App {
    public static void main( String[] args ) {
        ApplicationContext
                ctx = new ClassPathXmlApplicationContext("META-INF/spring/camel-config.xml");
    }
}