JBoss EAP 6.2에 하나의 WebService가 설치되어 있습니다. SOAP 헤더를 가져 오려면 문제가 나타납니다. 예외가 발생org.apache.cxf.binding.soap.SoapHeader를 org.apache.cxf.binding.soap.SoapHeader로 캐스팅 할 수 없습니다.
코드 :
ArrayList<SoapHeader> hl = (ArrayList<SoapHeader>) wsctx.getMessageContext().get("org.apache.cxf.headers.Header.list");
String username = "";
String password = "";
for (int i = 0; i < hl.size(); i++) { //for(SoapHeader header : hl) gives this same exception
SoapHeader header = hl.get(i);
//here is fetching data from this header. Not important to this case.
}
나는 정말 꽤 아니라는 것을 알고 있지만,이 방법 percisely 제기 헤더 및 예외 가져 오는에 정말 관심이 :
hl.get(i)
을 그리고 예외 메시지는 다음과 같습니다.
org.apache.cxf.binding.soap.SoapHeader cannot be cast to org.apache.cxf.binding.soap.SoapHeader
처음에는 잘못된 Maven 버전을 생각했습니다. 님의 POM 파일이므로 :
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-bindings-soap</artifactId>
<version>2.4.2</version>
</dependency>
하지만 잘 작동한다고 생각합니다.
그래서 내 질문 : 그것을 피하는 방법? 누구든지 나를 도울 수 있습니까? 감사합니다
. https://access.redhat.com/site/articles/112673을 살펴 보았지만 지정된 JBoss WS_CXF 만 있습니다. 어쩌면 내가 원래 아파치의 라이브러리 대신 사용해야합니까? –
네가 맞아.하지만 진짜 해결책은 다른 라이브러리 jboss-cxf-server를 사용하는 것이다. 단서 주셔서 감사합니다! –