我正在使用CXF端点进行soap web服务。当我的驼峰上下文启动时,检查Web服务是否正在运行。我想改变它,就像当我的路由呼叫CXF端点时,它应该检查我的服务是否正在运行?有任何建议来满足我的要求吗?
CXF Endpoint:
<cxf:cxfEndpoint id="accountBalanceServiceEndpoint"
address="{{wsdlUrlTest}}"
wsdlURL="{{wsdlUrlTest}}?wsdl"
serviceName="s:AccountBalanceService"
endpointName="s:AccountBalancePort"
xmlns:s="http://soap.test.pqr.abc.com/">
<cxf:properties>
<entry key="dataFormat" value="MESSAGE"/>
</cxf:properties>
</cxf:cxfEndpoint>
Route:
<route id="SoapService" startupOrder="40">
<from uri="direct:SoapService" />
<setHeader headerName="operationNamespace">
<constant>http://soap.test.pqr.abc.com/</constant>
</setHeader>
<setHeader headerName="operationName">
<constant>getContacts</constant>
</setHeader>
<setBody>
<simple>
<![CDATA[
<soapenv:Envelope
xmlns:q0="http://soap.test.pqr.abc.com/"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
>
<soapenv:Body>
<q0:getContacts>
<arg0>
<custId>12345</custId>
</arg0>
</q0:getContacts>
</soapenv:Body>
</soapenv:Envelope>
]]>
</simple>
</setBody>
<to uri="cxf:bean:accountBalanceServiceEndpoint?defaultOperationName=getContacts" />
</route>
在路由启动时,CXF不会检查您正在调用的服务的可用性。 CXF只会在发出请求时建立Http(s)连接。我怀疑您遇到的问题是从您正在调用的服务的端点发现WSDL,在这种情况下,它可能会在CXFEndpoint
实例化时建立连接以下载WSDL和模式。
首先下载WSDL和模式并从文件脱机加载而不是使用serviceUrl?WSDL
可能对您有所帮助。