【发布时间】:2018-02-14 18:56:36
【问题描述】:
我的应用程序上下文中有一条骆驼路线定义为
<camelContext xmlns="http://camel.apache.org/schema/spring"
trace="true" id="camel">
<route id="wsProxyRedirection">
<from uri="cxf:bean:cdcPocProxyWebServiceStartPoint" />
<choice>
<when>
<xpath>//soapenv:Envelope/soapenv:Body/hel:sayHello/toWhom = 'normal'</xpath>
<to uri="jms:queue:normalQueue" />
</when>
<when>
<xpath>//soapenv:Envelope/soapenv:Body/hel:sayHello/toWhom = 'urgent'</xpath>
<to uri="jms:queue:urgentQueue" />
</when>
<when>
<xpath>//soapenv:Envelope/soapenv:Body/hel:sayHello/toWhom = 'veryUrgent'</xpath>
<to uri="jms:queue:veryUrgentQueue" />
</when>
</choice>
</route>
</camelContext>
我发送的请求是:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hel="http://cxf.apache.org/wsse/handler/helloworld">
<soapenv:Header/>
<soapenv:Body>
<hel:sayHello>
<toWhom>normal</toWhom>
</hel:sayHello>
</soapenv:Body>
</soapenv:Envelope>
但我得到的回应是:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Error during type conversion from type: java.lang.String to the required type: org.w3c.dom.Document with value test due org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
这只是一个简单的选择 POC,但我无法让它工作......我必须在我的 xpath 条件中更改什么?
谢谢
【问题讨论】:
标签: java xpath soap apache-camel cxf