311.4. Java DSL 사용


다음 예제에서는 com.example.customerservice 패키지로 구성된 DataFormat of soap 을 사용하여 JAXBContext 를 초기화합니다. 두 번째 매개변수는 ElementNameStrategy입니다. 경로는 일반 오브젝트와 예외를 마샬링할 수 있습니다. (아래에서 SOAP Envelope를 대기열로 보냅니다. 웹 서비스 공급자는 실제로 SOAP 호출이 발생하기 위해 큐를 수신 대기해야 합니다. 이 경우 SOAP 요청의 한 가지 방법이 됩니다. 요청 응답이 필요한 경우 다음 예제를 살펴봐야 합니다.)

SoapJaxbDataFormat soap = new SoapJaxbDataFormat("com.example.customerservice", new ServiceInterfaceStrategy(CustomerService.class));
from("direct:start")
  .marshal(soap)
  .to("jms:myQueue");
작은 정보

또한 SOAP dataformat에서 JAXB 데이터 형식을 상속하기 때문에 대부분의 설정도 여기에도 적용됨을 참조하십시오.

311.4.1. SOAP 1.2 사용

Camel 2.11에서 사용 가능

SoapJaxbDataFormat soap = new SoapJaxbDataFormat("com.example.customerservice", new ServiceInterfaceStrategy(CustomerService.class));
soap.setVersion("1.2");
from("direct:start")
  .marshal(soap)
  .to("jms:myQueue");

XML DSL을 사용할 때 version 속성이 있으면 <soapjaxb> 요소에 설정할 수 있습니다.

    <!-- Defining a ServiceInterfaceStrategy for retrieving the element name when marshalling -->
    <bean id="myNameStrategy" class="org.apache.camel.dataformat.soap.name.ServiceInterfaceStrategy">
        <constructor-arg value="com.example.customerservice.CustomerService"/>
    <constructor-arg value="true"/>
    </bean>

Camel 경로의 경우

<route>
  <from uri="direct:start"/>
  <marshal>
    <soapjaxb contentPath="com.example.customerservice" version="1.2" elementNameStrategyRef="myNameStrategy"/>
  </marshal>
  <to uri="jms:myQueue"/>
</route>
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

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

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

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

Red Hat 소개

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

Theme

© 2026 Red Hat
맨 위로 이동