/** * Gets the value of the soap:role attribute (or soap:actor for SOAP 1.1). * * <p> * If the attribute is omitted, the value defaults to {@link SOAPVersion#implicitRole}. * * @param soapVersion * The caller specifies the SOAP version that the pipeline is working against. * Often each {@link Header} implementation already knows the SOAP version * anyway, but this allows some {@link Header}s to avoid keeping it. * That's why this redundant parameter is passed in. * @return * never null. This string need not be interned. */ public String getRole(SOAPVersion soapVersion){ if(header != null){ return header.getRole(soapVersion); } throw new UnsupportedOperationException(); }
final boolean isInCurrentRole(Header header, WSBinding binding) { // TODO: binding will be null for protocol messages // TODO: returning true assumes that protocol messages are // TODO: always in current role, this may not to be fixed. if (binding == null) return true; return ((SOAPBinding)binding).getRoles().contains(header.getRole(soapVersion)); }
final boolean isInCurrentRole(Header header, WSBinding binding) { // TODO: binding will be null for protocol messages // TODO: returning true assumes that protocol messages are // TODO: always in current role, this may not to be fixed. if (binding == null) return true; return ((SOAPBinding)binding).getRoles().contains(header.getRole(soapVersion)); }
final boolean isInCurrentRole(Header header, WSBinding binding) { // TODO: binding will be null for protocol messages // TODO: returning true assumes that protocol messages are // TODO: always in current role, this may not to be fixed. if (binding == null) return true; return ((SOAPBinding)binding).getRoles().contains(header.getRole(soapVersion)); }
public static Header getFirstHeader(MessageHeaders headers, QName name, boolean markUnderstood, SOAPVersion sv) { if (sv == null) { throw new IllegalArgumentException(AddressingMessages.NULL_SOAP_VERSION()); } Iterator<Header> iter = headers.getHeaders(name.getNamespaceURI(), name.getLocalPart(), markUnderstood); while (iter.hasNext()) { Header h = iter.next(); if (h.getRole(sv).equals(sv.implicitRole)) { return h; } } return null; }
public static Header getFirstHeader(MessageHeaders headers, QName name, boolean markUnderstood, SOAPVersion sv) { if (sv == null) { throw new IllegalArgumentException(AddressingMessages.NULL_SOAP_VERSION()); } Iterator<Header> iter = headers.getHeaders(name.getNamespaceURI(), name.getLocalPart(), markUnderstood); while (iter.hasNext()) { Header h = iter.next(); if (h.getRole(sv).equals(sv.implicitRole)) { return h; } } return null; }
public static Header getFirstHeader(MessageHeaders headers, QName name, boolean markUnderstood, SOAPVersion sv) { if (sv == null) { throw new IllegalArgumentException(AddressingMessages.NULL_SOAP_VERSION()); } Iterator<Header> iter = headers.getHeaders(name.getNamespaceURI(), name.getLocalPart(), markUnderstood); while (iter.hasNext()) { Header h = iter.next(); if (h.getRole(sv).equals(sv.implicitRole)) { return h; } } return null; }
/** * Gets the value of the soap:role attribute (or soap:actor for SOAP 1.1). * * <p> * If the attribute is omitted, the value defaults to {@link SOAPVersion#implicitRole}. * * @param soapVersion * The caller specifies the SOAP version that the pipeline is working against. * Often each {@link Header} implementation already knows the SOAP version * anyway, but this allows some {@link Header}s to avoid keeping it. * That's why this redundant parameter is passed in. * @return * never null. This string need not be interned. */ public @NotNull String getRole(@NotNull SOAPVersion soapVersion){ return this.wrappedHeader.getRole(soapVersion); }
public Object[] getHeaders(QName header, JAXBContext jaxbContext, boolean allRoles) { SOAPVersion soapVersion = binding.getSOAPVersion(); List<Object> beanList = new ArrayList<Object>(); try { Iterator<Header> itr = packet.getMessage().getHeaders().getHeaders(header,false); if(allRoles) { while(itr.hasNext()) { beanList.add(itr.next().readAsJAXB(jaxbContext.createUnmarshaller())); } } else { while(itr.hasNext()) { Header soapHeader = itr.next(); //Check if the role is one of the roles on this Binding String role = soapHeader.getRole(soapVersion); if(getRoles().contains(role)) { beanList.add(soapHeader.readAsJAXB(jaxbContext.createUnmarshaller())); } } } return beanList.toArray(); } catch(Exception e) { throw new WebServiceException(e); } }
public Object[] getHeaders(QName header, JAXBContext jaxbContext, boolean allRoles) { SOAPVersion soapVersion = binding.getSOAPVersion(); List<Object> beanList = new ArrayList<Object>(); try { Iterator<Header> itr = packet.getMessage().getHeaders().getHeaders(header,false); if(allRoles) { while(itr.hasNext()) { beanList.add(itr.next().readAsJAXB(jaxbContext.createUnmarshaller())); } } else { while(itr.hasNext()) { Header soapHeader = itr.next(); //Check if the role is one of the roles on this Binding String role = soapHeader.getRole(soapVersion); if(getRoles().contains(role)) { beanList.add(soapHeader.readAsJAXB(jaxbContext.createUnmarshaller())); } } } return beanList.toArray(); } catch(Exception e) { throw new WebServiceException(e); } }
public Object[] getHeaders(QName header, JAXBContext jaxbContext, boolean allRoles) { SOAPVersion soapVersion = binding.getSOAPVersion(); List<Object> beanList = new ArrayList<Object>(); try { Iterator<Header> itr = packet.getMessage().getHeaders().getHeaders(header,false); if(allRoles) { while(itr.hasNext()) { beanList.add(itr.next().readAsJAXB(jaxbContext.createUnmarshaller())); } } else { while(itr.hasNext()) { Header soapHeader = itr.next(); //Check if the role is one of the roles on this Binding String role = soapHeader.getRole(soapVersion); if(getRoles().contains(role)) { beanList.add(soapHeader.readAsJAXB(jaxbContext.createUnmarshaller())); } } } return beanList.toArray(); } catch(Exception e) { throw new WebServiceException(e); } }