簡體   English   中英

在 apache karaf 上使用 apache 駱駝藍圖的 Soap 請求失敗

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

我正在嘗試使用駱駝藍圖發送肥皂請求,現在我得到了這個 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>

類 Service 現在只是一個空類。

將它部署到 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.

誰能告訴我那個 xml 有什么問題以及我能做些什么才能發送這個請求?

XML 解析器遇到錯誤,因為它不知道cxfEndpoint是什么。 您必須為路由定義正確的 XML 命名空間,才能像這樣工作:

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

然后像“camelcxf:cxfEndpoint”一樣引用 cxfEndpoint。

您可以在此處查看與 Camel 源中的問題類似的更完整的 Blueprint CXF 示例。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM