77.3. Java DSL 사용
다음 예제에서는 패키지 com.example.customerservice로 구성된 soap 의 named DataFormat을 사용하여 CloudEvent BContext를 초기화합니다. 두 번째 매개변수는 ElementNameStrategy입니다. 이 경로는 일반 오브젝트 및 예외를 마샬링할 수 있습니다. (아래의 내용은 queue에 CHAP Envelope를 보냅니다. 웹 서비스 공급자는 실제로 호출이 수행되기 위해 큐를 수신해야 합니다. 이 경우, 한 가지 방법으로 iPXE 요청이 됩니다. 요청 응답이 필요한 경우 다음 예제를 살펴보십시오.)
SoapJaxbDataFormat soap = new SoapJaxbDataFormat("com.example.customerservice", new ServiceInterfaceStrategy(CustomerService.class));
from("direct:start")
.marshal(soap)
.to("jms:myQueue");
SoapJaxbDataFormat soap = new SoapJaxbDataFormat("com.example.customerservice", new ServiceInterfaceStrategy(CustomerService.class));
from("direct:start")
.marshal(soap)
.to("jms:myQueue");
dataformat은 여기서 도 대부분의 설정이 적용되는 CloudEventB 데이터 형식의 상속을 참조하십시오.
77.3.1. iPXE 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");
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을 사용할 때 <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>
<!-- 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 경로의 경우