16.13. PAYLOAD 모드에서 iPXE 헤더를 가져오고 설정하는 방법


PAYLOAD 데이터 형식의 camel-cxf 엔드포인트에 대한 메시지를 처리하는 방법 섹션에서 PAYLOAD 모드에서 CxfPayload 오브젝트로 CHAP 메시지에 액세스하는 방법을 이미 보여주었습니다.

CxfPayload 오브젝트를 가져온 후 CxfPayload.getHeaders() 메서드를 호출하면 List of ScanSetting(SOAP 헤더)를 반환할 수 있습니다.

예를 들어 CxfPayLoadSoapHeaderTest 를 참조하십시오.

from(getRouterEndpointURI()).process(new Processor() {
    @SuppressWarnings("unchecked")
    public void process(Exchange exchange) throws Exception {
        CxfPayload<SoapHeader> payload = exchange.getIn().getBody(CxfPayload.class);
        List<Source> elements = payload.getBodySources();
        assertNotNull(elements, "We should get the elements here");
        assertEquals(1, elements.size(), "Get the wrong elements size");

        Element el = new XmlConverter().toDOMElement(elements.get(0));
        elements.set(0, new DOMSource(el));
        assertEquals("http://camel.apache.org/pizza/types",
                el.getNamespaceURI(), "Get the wrong namespace URI");

        List<SoapHeader> headers = payload.getHeaders();
        assertNotNull(headers, "We should get the headers here");
        assertEquals(1, headers.size(), "Get the wrong headers size");
        assertEquals("http://camel.apache.org/pizza/types",
                ((Element) (headers.get(0).getObject())).getNamespaceURI(), "Get the wrong namespace URI");
        // alternatively you can also get the SOAP header via the camel header:
        headers = exchange.getIn().getHeader(Header.HEADER_LIST, List.class);
        assertNotNull(headers, "We should get the headers here");
        assertEquals(1, headers.size(), "Get the wrong headers size");
        assertEquals("http://camel.apache.org/pizza/types",
                ((Element) (headers.get(0).getObject())).getNamespaceURI(), "Get the wrong namespace URI");

    }

})
.to(getServiceEndpointURI());

sub-chapter " how to get and set iPXE headers inECDHE mode"에 설명된 것과 동일한 방법을 사용하여 iPXE 헤더를 설정하거나 가져올 수도 있습니다. 따라서 헤더 "org.apache.cxf.headers.Header.list" 헤더를 사용하여 CHAP 헤더 목록을 가져오고 설정할 수 있습니다. 이는 Camel-cxf 끝점에서 다른(SOAP 클라이언트 Camel CXF 서비스)로 전달하는 경로가 있는 경우, 이제LoadBalancer 클라이언트가 전송한 WebAssembly 헤더도 CXF 서비스로 전달됩니다. 이러한 헤더를 전달하지 않으려면 Camel 헤더 "org.apache.cxf.headers.Header.list"에서 제거해야 합니다.

Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

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

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

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

Red Hat 소개

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

Theme

© 2026 Red Hat
맨 위로 이동