private RemoteConnection getRemotingConnection(Object endpoint) { if (endpoint == null) throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ENDPOINT_CANNOT_BE_NULL")); return remotingConnection; }
public void setObjectValue(Object objValue) { throw new IllegalStateException(BundleUtils.getMessage(bundle, "OBJECT_VALUE_NOT_AVAILABLE")); } }
public SOAPElementWriter(OutputStream stream, String charsetName) { try { this.out = new PrintWriter(new OutputStreamWriter(stream, charsetName)); this.charsetName = charsetName; } catch (UnsupportedEncodingException e) { throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "UNSUPPORTED_ENCODING", charsetName)); } }
public static Use valueOf(String encodingStyle) { if (Constants.URI_LITERAL_ENC.equals(encodingStyle) || LITERAL.use.equals(encodingStyle)) return LITERAL; if (Constants.URI_SOAP11_ENC.equals(encodingStyle) || ENCODED.use.equals(encodingStyle)) return ENCODED; throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "UNSUPPORTED_ENCODING_STYLE", encodingStyle)); }
/** * Sends the given message to the specified endpoint and blocks until it has * returned the response. */ @Override public SOAPMessage call(SOAPMessage reqMessage, Object endpoint) throws SOAPException { if (reqMessage == null) throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "SOAPMESSAGE_CANNOT_BE_NULL")); return callInternal(reqMessage, endpoint, false); }
private void handleSourceAccessException(IOException ex) { if (source instanceof StreamSource && streamSourceAccessMarker != null) { log.error(BundleUtils.getMessage(bundle, "STREAMSOURCE_WAS_PREVIOUSLY_ACCESSED"), streamSourceAccessMarker); } WSException.rethrow(ex); }
public MessageFactoryImpl(String protocol) throws SOAPException { if (SOAPConstants.SOAP_1_1_PROTOCOL.equals(protocol) || SOAPConstants.DEFAULT_SOAP_PROTOCOL.equals(protocol)) envNamespace = SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE; else if (SOAPConstants.SOAP_1_2_PROTOCOL.equals(protocol)) envNamespace = SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE; else if (SOAPConstants.DYNAMIC_SOAP_PROTOCOL.equals(protocol)) dynamic = true; else throw new SOAPException(BundleUtils.getMessage(bundle, "UNKNOWN_PROTOCOL", protocol)); }
public Element createElementNS(String namespaceURI, String qualifiedName) throws DOMException { int loc = qualifiedName.indexOf(":"); if (loc == -1) return new SOAPElementImpl(qualifiedName, null, namespaceURI); if (loc == qualifiedName.length() - 1) throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "INVALID_QUALIFIED_NAME")); return new SOAPElementImpl(qualifiedName.substring(loc + 1), qualifiedName.substring(0, loc), namespaceURI); }
/** * Text nodes are not supported. */ public SOAPElement addTextNode(String value) throws SOAPException { if (value.trim().length() > 0) throw new SOAPException(BundleUtils.getMessage(bundle, "CANNOT_ADD_TEXT_NODE_TO_SOAPENVELOPE")); return super.addTextNode(value); }
private static SOAPHeaderElementImpl convertToHeaderElement(Node node) { if (!(node instanceof SOAPElementImpl)) throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "SOAPELEMENT_EXPECTED")); SOAPElementImpl element = (SOAPElementImpl)node; // convert to SOAPHeaderElement element.detachNode(); return new SOAPHeaderElementImpl(element); } }
public Iterator getAttachments(MimeHeaders headers) { if (headers == null) throw new WSException(BundleUtils.getMessage(bundle, "MIMEHEADERS_CANNOT_BE_NULL")); return new MimeMatchingAttachmentsIterator(headers, attachments); }
public String getFaultRole() { if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI())) throw new UnsupportedOperationException(BundleUtils.getMessage(bundle, "NOT_SUPPORT_ROLE")); if (faultactor == null) { findRoleElement(); if (faultactor == null) return null; } return faultactor.getValue(); }
public void setRole(String roleURI) { final SOAPElement header = getParentElement(); final String headerURI = header.getNamespaceURI(); if (Constants.NS_SOAP11_ENV.equals(headerURI)) throw new UnsupportedOperationException(BundleUtils.getMessage(bundle, "SOAP11_NOT_SUPPORT_ROLE")); setAttributeNS(headerURI, header.getPrefix() + ":" + Constants.SOAP12_ATTR_ROLE, roleURI); }
public void setFaultRole(String uri) throws SOAPException { if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI())) throw new UnsupportedOperationException(BundleUtils.getMessage(bundle, "NOT_SUPPORT_ROLE")); if (faultactor == null) { findRoleElement(); if (faultactor == null) faultactor = addQualifiedFaultElement("Role"); } faultactor.setValue(uri); }
public SOAPHeaderElement addNotUnderstoodHeaderElement(QName qname) throws SOAPException { if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI())) throw new UnsupportedOperationException(BundleUtils.getMessage(bundle, "SOAP11_NOT_SUPPORT_NOTUNDERSTOOD")); // create NotUnderstood header block QName notUnderstoodName = new QName(getNamespaceURI(), "NotUnderstood", getPrefix()); SOAPHeaderElement notUnderstoodElement = addHeaderElement(notUnderstoodName); // set qname attribute SAAJUtils.setQualifiedAttributeValue(notUnderstoodElement, "qname", qname); return notUnderstoodElement; }
public SOAPHeader addHeader() throws SOAPException { SOAPHeader header = getHeader(); if (header != null) throw new SOAPException(BundleUtils.getMessage(bundle, "SOAPENVELOPE_ALREADY_HAS_A_HEADER_ELEMENT")); header = new SOAPHeaderImpl(getPrefix(), getNamespaceURI()); return (SOAPHeader)addChildElement(header); }
/** Creates a new SOAPHeaderElement object initialized with the specified name and adds it to this SOAPHeader object. */ public SOAPHeaderElement addHeaderElement(Name name) throws SOAPException { if (name == null) throw new SOAPException(BundleUtils.getMessage(bundle, "INVALID_SOAPHEADERELEMENT_NAME", name)); return addHeaderElement(new NameImpl(name.getLocalName(), name.getPrefix(), name.getURI()).toQName()); }
public SOAPFault addFault(QName faultCode, String faultString, Locale locale) throws SOAPException { if (hasFault()) throw new SOAPException(BundleUtils.getMessage(bundle, "AT_MOST_ONE_SOAPFAULT")); SOAPFaultImpl soapFault = new SOAPFaultImpl(getPrefix(), getNamespaceURI()); soapFault.setFaultCode(faultCode); soapFault.setFaultString(faultString, locale); addChildElement(soapFault); return soapFault; }
public SOAPFault addFault() throws SOAPException { if (hasFault()) throw new SOAPException(BundleUtils.getMessage(bundle, "AT_MOST_ONE_SOAPFAULT")); SOAPFaultImpl soapFault = new SOAPFaultImpl(getPrefix(), getNamespaceURI()); soapFault = (SOAPFaultImpl)addChildElement(soapFault); soapFault.setFaultCode(soapFault.getDefaultFaultCode()); return soapFault; }
public SOAPFault addFault(Name faultCode, String faultString) throws SOAPException { if (hasFault()) throw new SOAPException(BundleUtils.getMessage(bundle, "AT_MOST_ONE_SOAPFAULT")); SOAPFaultImpl soapFault = new SOAPFaultImpl(getPrefix(), getNamespaceURI()); soapFault = (SOAPFaultImpl)addChildElement(soapFault); soapFault.setFaultCode(faultCode); soapFault.setFaultString(faultString); return soapFault; }