0

我正在尝试使用@attachment http 属性

我在这样调用的流程中有一个名为 validate 的 devkit 方法

<http:connector name="httpConnector" doc:name="HTTP\HTTPS">
    <service-overrides
        messageFactory="org.mule.transport.http.HttpMultipartMuleMessageFactory" />
</http:connector>
<flow name="AttachmentTestFlow1" doc:name="AttachmentTestFlow1">        
    <http:inbound-endpoint connector-ref="httpConnector" doc:name="HTTP" exchange-pattern="request-response" host="localhost" port="8100"/>
    <Foo:validate config-ref="TestMessageSizeHappy"  />
</flow>

在 Devkit 中:

@Processor
public Object validate(@Payload InputStream in
    ,@InboundAttachments("*") Map<String, DataHandler> inboundAttachments
    ,@OutboundAttachments Map<String, DataHandler> outboundAttachments
    ) {

但是,当运行我的骡子应用程序时,会抛出:

错误 2013-07-30 09:06:39,225 [main] org.mule.module.launcher.application.DefaultMuleApplication: null org.xml.sax.SAXParseException: cvc-complex-type.2.4.b: 元素的内容' xmlthreatprotection:validate' 不完整。'{" http://www.mulesoft.org/schema/mule/core ":annotations, " http://www.mulesoft.org/schema/mule/xmlthreatprotection ":inbound-attachments}' 之一是预期的。在 org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(未知来源)

在我看来,骡子希望附件以某种方式作为属性放入!当我删除 @attachment 的东西时,我在运行时不会出错。

4

1 回答 1

1

你确定这受 DevKit 支持吗?我在源代码中找不到一个包含练习@InboundAttachments@OutboundAttachments注释的集成测试,而@InboundHeaders@OutboundHeaders都被测试覆盖。

或者,您可以MuleEvent通过它接收和访问附件:

@Processor
@Inject
public Object validate(@Payload InputStream in, MuleEvent muleEvent) {
于 2013-07-30T16:14:25.150 回答