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 void setMimeHeaders(MimeHeaders headers) { if (headers == null) throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "MIMEHEADERS_CANNOT_BE_NULL")); this.mimeHeaders = headers; }
private void assertEnvNamespace() { if (envNamespace == null) throw new UnsupportedOperationException(BundleUtils.getMessage(bundle, "ENVELOPE_NAMESPACE_NOT_SPECIFIED")); } }
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)); }
/** * Sends the given message to the specified endpoint. This method is logically * non blocking. */ public SOAPMessage callOneWay(SOAPMessage reqMessage, Object endpoint) throws SOAPException { if (reqMessage == null) throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "SOAPMESSAGE_CANNOT_BE_NULL")); return callInternal(reqMessage, endpoint, true); }
public DataHandler getDataHandler() throws SOAPException { if (dataHandler == null) throw new SOAPException(BundleUtils.getMessage(bundle, "NO_DATA_HANDLER_ON_ATTACHMENT")); return dataHandler; }
private void assertSOAPParent() { org.w3c.dom.Node domParent = domNode.getParentNode(); if (domParent != null && soapParent == null) throw new WSException(BundleUtils.getMessage(bundle, "NO_SOAP_PARENT", new Object[]{ this })); if (domParent != null && soapParent != null && domParent != soapParent.domNode) throw new WSException(BundleUtils.getMessage(bundle, "NOT_IDENTICAL_WITH_DOM_PARENT", new Object[]{ this })); }
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); }
public SOAPHeaderElement addUpgradeHeaderElement(String[] supportedSoapUris) throws SOAPException { if (supportedSoapUris == null) throw new SOAPException(BundleUtils.getMessage(bundle, "LIST_OF_SUPPORTED_URIS_CANNOT_BE_NULL")); return addUpgradeHeaderElement(Arrays.asList(supportedSoapUris).iterator()); }
public SOAPHeaderElement addUpgradeHeaderElement(String supportedSoapUri) throws SOAPException { if (supportedSoapUri == null) throw new SOAPException(BundleUtils.getMessage(bundle, "SUPPORTED_URI_CANNOT_BE_NULL")); return addUpgradeHeaderElement(Collections.singletonList(supportedSoapUri).iterator()); }
public org.w3c.dom.Node getLastChild() { NodeImpl child = null; org.w3c.dom.Node domChild = domNode.getLastChild(); if (domChild != null) { child = (NodeImpl)soapChildren.get(soapChildren.size() - 1); if (domChild != child.domNode) throw new WSException(BundleUtils.getMessage(bundle, "INCONSISTENT_NODE")); } return child; }
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 SOAPHeaderElement addHeaderElement(QName qname) throws SOAPException { if (qname == null || qname.getNamespaceURI().length() == 0 || qname.getPrefix().length() == 0) throw new SOAPException(BundleUtils.getMessage(bundle, "INVALID_SOAPHEADERELEMENT_NAME", qname)); SOAPHeaderElementImpl headerElement = new SOAPHeaderElementImpl(qname); addChildElement(headerElement); return headerElement; }
public void setDataHandler(DataHandler dataHandler) { if (dataHandler == null) throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "NULL_DATA_HANDLER")); this.dataHandler = dataHandler; setContentType(dataHandler.getContentType()); }