简体   繁体   中英

Cxf Endpoint getting up with start of camel context. How I can avoid this?

I am using CXF endpoint for soap web service. And when my camel context starts it check whether web service is running or not. I want to change it like when my route call the CXF endpoint at that time it should check whether my service is running or not? Any suggestions for fulfilling my requirement?

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 doesn't check the availability of the service you are invoking when the route is starting up. CXF will only establish Http(s)Connection when the request is made. I am suspecting you are running into issues with discovering WSDL from the endpoint of service you are invoking in which case, it may establish a connection to download the WSDL and schemas when CXFEndpoint is instantiated.

Downloading the WSDL and schemas first and load it from file offline instead of using serviceUrl?WSDL may help you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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