17.5. Spring으로 CXF 엔드 포인트를 구성


아래 표시된 Spring 구성 파일을 사용하여 CXF 엔드 포인트를 구성할 수 있으며, endpoint를 camelContext 태그에 포함할 수도 있습니다. 서비스 끝점을 호출할 때 operationNameoperationNamespace 헤더를 명시적으로 설정하여 호출하는 작업을 명시적으로 표시할 수 있습니다.

<beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:cxf="http://camel.apache.org/schema/cxf"
        xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd
        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
     <cxf:cxfEndpoint id="routerEndpoint" address="http://localhost:9003/CamelContext/RouterPort"
            serviceClass="org.apache.hello_world_soap_http.GreeterImpl"/>
     <cxf:cxfEndpoint id="serviceEndpoint" address="http://localhost:9000/SoapContext/SoapPort"
            wsdlURL="testutils/hello_world.wsdl"
            serviceClass="org.apache.hello_world_soap_http.Greeter"
            endpointName="s:SoapPort"
            serviceName="s:SOAPService"
        xmlns:s="http://apache.org/hello_world_soap_http" />
     <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
       <route>
         <from uri="cxf:bean:routerEndpoint" />
         <to uri="cxf:bean:serviceEndpoint" />
       </route>
    </camelContext>
  </beans>
Copy to Clipboard Toggle word wrap

루트 빈 요소에 지정된>-<-WS schemaLocation 속성을 포함해야 합니다. 이를 통해 CXF는 파일의 유효성을 검증할 수 있으며 필수입니다. 또한 < cxf:cxfEndpoint/ > 태그 끝에 네임스페이스 선언도 기록해 둡니다. 결합된 {namespace}localName 구문이 현재 이 태그의 속성 값에 대해 지원되지 않기 때문에 이러한 선언이 필요합니다.

cxf:cxfEndpoint 요소는 많은 추가 특성을 지원합니다.

Expand
이름현재의

PortName

이 서비스가 구현되고 있는 엔드포인트 이름은 wsdl:port@name 에 매핑됩니다. ns:PORT_NAME 형식에서 ns 는 이 범위에서 유효한 네임스페이스 접두사입니다.

serviceName

이 서비스가 구현하는 서비스 이름은 wsdl:service@name 에 매핑됩니다. ns:SERVICE_NAME 형식에서 ns 는 이 범위에서 유효한 네임스페이스 접두사입니다.

wsdlURL

WSDL의 위치입니다. classpath, 파일 시스템에 있거나 원격으로 호스팅될 수 있습니다.

bindingId

사용할 서비스 모델의 bindingId 입니다.

address

서비스 게시 주소입니다.

bus

GDB-WS 엔드포인트에서 사용할 버스 이름입니다.

serviceClass

SEI(Service Endpoint Interface) 클래스의 클래스 이름입니다. 이 클래스에는 주석이 있거나 주석이 없을 수 있습니다.

또한 여러 자식 요소를 지원합니다.

Expand
이름현재의

cxf:inInterceptors

이 끝점에 대해 들어오는 인터셉터입니다. <ECDHE& gt; 또는 & lt; ref> 목록입니다.

cxf:inFaultInterceptors

이 엔드포인트에 대해 들어오는 오류 인터셉터입니다. <ECDHE& gt; 또는 & lt; ref> 목록입니다.

cxf:outInterceptors

이 끝점에 대한 발신 인터셉터입니다. <ECDHE& gt; 또는 & lt; ref> 목록입니다.

cxf:outFaultInterceptors

이 엔드포인트에 대한 발신 오류 인터셉터입니다. <ECDHE& gt; 또는 & lt; ref> 목록입니다.

CXF:properties

CloudEvent-WS 엔드포인트에 제공해야 하는 속성 맵입니다. 아래를 참조하십시오.

CXF:handlers

192.0.2.-WS 엔드포인트에 제공해야 하는 handler 목록입니다. 아래를 참조하십시오.

cxf:dataBinding

끝점에서 사용할 DataBinding 을 지정할 수 있습니다. Spring <ovn class="MyDataBinding"/ > 구문을 사용하여 제공할 수 있습니다.

CXF:binding

이 끝점에서 사용할 BindingFactory 를 지정할 수 있습니다. Spring <ovn class="MyBindingFactory"/ > 구문을 사용하여 제공할 수 있습니다.

CXF:features

이 끝점의 인터셉터를 보유하는 기능입니다. 빈 또는 ref 목록

cxf:schemaLocations

사용할 끝점의 스키마 위치입니다. schemaLocations 목록

cxf:serviceFactory

이 끝점에서 사용할 서비스 팩토리입니다. Spring <ovn class="MyServiceFactory"/ > 구문을 사용하여 제공할 수 있습니다.

CXFECDHE -WS 구성 페이지에서 인터셉터, 속성 및 처리기를 제공하는 방법을 보여주는 고급 예제를 찾을 수 있습니다.

참고

cxf:properties를 사용하여 spring 구성 파일에서 camel-cxf 끝점의 dataFormat 및 setDefaultBus 속성을 설정할 수 있습니다.

<cxf:cxfEndpoint id="testEndpoint" address="http://localhost:9000/router"
     serviceClass="org.apache.camel.component.cxf.HelloService"
     endpointName="s:PortName"
     serviceName="s:ServiceName"
     xmlns:s="http://www.example.com/test">
     <cxf:properties>
       <entry key="dataFormat" value="RAW"/>
       <entry key="setDefaultBus" value="true"/>
     </cxf:properties>
   </cxf:cxfEndpoint>
Copy to Clipboard Toggle word wrap
참고

SpringBoot에서는 Spring XML 파일을 사용하여 camel-cxf 를 구성하고 다음 예제와 유사한 코드를 사용하여 XML 구성 빈을 생성할 수 있습니다.

@ImportResource({
		"classpath:spring-configuration.xml"
})
Copy to Clipboard Toggle word wrap

그러나 구성된 Java 코드(다른 예와 같이) 구성된 빈을 사용하는 것이 SpringBoot에서 가장 좋습니다.

맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat