简体   繁体   English

在 apache karaf 上使用 apache 骆驼蓝图的 Soap 请求失败

[英]Soap request using apache camel blueprint on apache karaf fails

I'm trying to send a soap request with camel blueprint and by now I got this blueprint.xml我正在尝试使用骆驼蓝图发送肥皂请求,现在我得到了这个 blueprint.xml

<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="
   http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
   http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">

<bean id="serviceBean" class="osgiBlueprintSoap.Service"/>

<cxfEndpoint id="serviceEndpoint" 
    address="{http://some.url/services/}SomeService"
    wsdlUrl="{http://some.url/services/}SomeService?wsdl"
    serviceName="{http://some.url/services/}SomeService"
    portName="{http://some.url/services/}SomeServiceSoapPort">
    <properties>
        <entry key="dataFormat" value="MESSAGE"/>
    </properties>
</cxfEndpoint>  

<camelContext xmlns="http://camel.apache.org/schema/blueprint">
  <route id="timerToLog">
    <from uri="timer:foo?period=5000"/>
    <to uri="cxf:serviceBean:serviceEndpoint"/>
    <to uri="file:C:/output?fileName=db.txt"/>
  </route>
</camelContext>

The class Service is just an empty class right now.类 Service 现在只是一个空类。

After deploying it on karaf I get this error将它部署到 karaf 上后,我收到此错误

org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'cxfEndpoint'. One of '{"http://www.osgi.org/xmlns/blueprint/v1.0.0":service, "http://www.osgi.org/xmlns/blueprint/v1.0.0":reference-list, "http://www.osgi.org/xmlns/blueprint/v1.0.0":bean, "http://www.osgi.org/xmlns/blueprint/v1.0.0":reference, WC[##other:"http://www.osgi.org/xmlns/blueprint/v1.0.0"]}" is expected.

Can anyone tell me what is wrong with that xml and what I can do to be able to send this request?谁能告诉我那个 xml 有什么问题以及我能做些什么才能发送这个请求?

XML parser runs into error since it won't know what cxfEndpoint is. XML 解析器遇到错误,因为它不知道cxfEndpoint是什么。 You must have correct XML namespace defined for your route to work like this:您必须为路由定义正确的 XML 命名空间,才能像这样工作:

xmlns:camelcxf="http://camel.apache.org/schema/blueprint/cxf"

and then make reference to cxfEndpoint like this "camelcxf:cxfEndpoint".然后像“camelcxf:cxfEndpoint”一样引用 cxfEndpoint。

You can see more complete Blueprint CXF example similar to your question in Camel source here .您可以在此处查看与 Camel 源中的问题类似的更完整的 Blueprint CXF 示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM