在蓝图中设置标题

问题描述

我使用的是 fuse-karaf-7.3.0.fuse-

我有以下工作蓝图。我正在尝试在 POST 上设置一个标题,该标题将发送到外部 API,但该标题未将其发送到 API。

files

我有一个处理器类,如下所示:

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
    xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd                            http://camel.apache.org/schema/blueprint https://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
    
    <bean class="ph.edu.dlsu.esb.CogProcessor" id="CogProcessor" />

    <cm:property-placeholder
        id="changeofgrade.properties" persistent-id="changeofgrade"
        update-strategy="reload">
        <cm:default-properties>
            <cm:property name="client.host" value="//localhost" />
            <cm:property name="client.port" value="8989" />
            <cm:property name="client.path"
                value="/external/grade/updatestudentgrade" />
            <cm:property name="client.protocol" value="http" />
            <cm:property name="changeofgrade.AUC.Token"
                value="bla_bla_bla_yadda_yadda" />
            <cm:property name="server.protocol" value="http" />
            <cm:property name="server.host" value="//localhost" />
            <cm:property name="server.port" value="8188" />
            <cm:property name="server.path" value="/cog/update" />
        </cm:default-properties>
    </cm:property-placeholder>
    <camelContext id="_context1"
        xmlns="http://camel.apache.org/schema/blueprint">
        <route id="_changeofgrade">
            <from id="_from1"
                uri="restlet:http://localhost:8188/changeofgrade/update?restletMethod=POST">
                <description>Receives Change of Grade from BPMS</description>
            </from>
            <log id="_log1" message="Log1">
                <description>The request raw from bpms</description>
            </log>
            <process id="_process1" ref="CogProcessor">
                <description>Sets the Authorization code (mock)</description>
            </process>
            <to id="_to1"
                uri="restlet:http://localhost:8989/external/grade/updatestudentgrade?restletMethod=POST" />
        </route>
    </camelContext>
</blueprint>

我的问题是为什么我看不到 http://localhost:8989/external/grade/updatestudentgrade 请求中的 AUC 标头?它似乎没有设置。

我把处理器放在restlet客户端调用之前。我使用了文档中自定义标头的示例,并且我使用了类似的处理器来设置响应正文,并且除了没有 AUC 标头外,路由运行良好。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...