0
我发送请求的servlet,类似的的OutputStream /的SOAPMessage要HTTP邮政与Apache骆驼
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
// Decode incoming SOAP message
InputStream in = req.getInputStream();
...
以下处理数据是发布流我的客户端代码与Servlet
SOAPMessage soapMessage = messageFactory.createMessage();
...
OutputStream out = httpUrlConnection.getOutputStream();
soapMessage.writeTo(out);
现在我想开发http客户端在Apache的骆驼后像下面
from("timer:foo?period=5s")
.process( new Processor() {
public void process(Exchange exchange) throws Exception {
...
exchange.getOut().setHeader(Exchange.HTTP_METHOD,"POST");
exchange.getOut().setBody(soapMessage);
} })
.to("jetty:http://localhost:8180/app/sendStream");
编辑: 我试图运行上面的代码并面临以下错误
org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: com.sun.xml.internal.messaging.saaj.soap.ver1_1.Message1_1Impl to the required type: java.io.InputStream with value [email protected]42a6d5a
at org.apache.camel.impl.converter.BaseTypeConverterRegistry.mandatoryConvertTo(BaseTypeConverterRegistry.java:177)
at org.apache.camel.component.jetty.JettyHttpProducer.processInternal(JettyHttpProducer.java:166)
你至今尝试过什么?你有没有把你的肥皂信息放进交换机构并试图发送它?你面临什么问题? –
发布更新,我发现没有类型的转换器可用 – ImranRazaKhan