[ 
https://issues.apache.org/jira/browse/CXF-2149?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Daniel Kulp reassigned CXF-2149:
--------------------------------

    Assignee: Daniel Kulp

> java.lang.ArrayStoreException getting headers in handler
> --------------------------------------------------------
>
>                 Key: CXF-2149
>                 URL: https://issues.apache.org/jira/browse/CXF-2149
>             Project: CXF
>          Issue Type: Bug
>         Environment: JDK 1.6, Ubuntu Linux 8.10
>            Reporter: Jose Antonio
>            Assignee: Daniel Kulp
>
> When calling 
> Object[] getHeaders(QName name, JAXBContext context, boolean allRoles)
> In a header, I get an ArrayStoreException. Looking at the code, I've found 
> this at 
> org.apache.cxf.jaxws.handler.soap.SOAPMessageContextImpl.getHeaders(SOAPMessageContextImpl.java:106):
> public Object[] getHeaders(QName name, JAXBContext context, boolean allRoles) 
> {
>         SOAPMessage msg = getMessage();
>         SOAPHeader header;
>         try {
>             header = msg.getSOAPPart().getEnvelope().getHeader();
>             if (header == null || !header.hasChildNodes()) {
>                 return new Object[0];
>             }
>             List<Object> ret = new ArrayList<Object>();
>             Iterator<SOAPHeaderElement> it = 
> CastUtils.cast(header.examineAllHeaderElements());
>             while (it.hasNext()) {
>                 SOAPHeaderElement she = it.next();
>                 if ((allRoles
>                     || roles.contains(she.getActor())) 
>                     && name.equals(she.getElementQName())) {
>                     
>                     ret.add(context.createUnmarshaller().unmarshal(she));
>                     
>                 }
>             }
>             return ret.toArray(new SOAPHeaderElement[ret.size()]);
>         } catch (SOAPException e) {
>             throw new WebServiceException(e);
>         } catch (JAXBException e) {
>             throw new WebServiceException(e);
>         } 
>     }
> ret is a list of objects that gets populated with unmarshalled elements. In 
> the return statement it tries to cast it to an array of SOAPHeaderElement, 
> but the elements inside are not SOAPHeaderElement so it throws the 
> aforementioned exception.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to