@Override public String getText(SOAPElement element) { return element.getValue(); }
@Override public String getText(SOAPElement element) { return element.getValue(); }
@Override public String getText(SOAPElement element) { return element.getValue(); }
public String getValue() { return delegateElement.getValue(); }
public String getValue() { return delegateHeader.getValue(); }
public String getValue() { return delegateElement.getValue(); }
public String getValue() { return delegateElement.getValue(); }
/** * Gets the text contained in the specified SOAP element. * * @param element Element to parse * @return Contained text */ public static String getText(SOAPElement element) { String value = element.getValue(); return (value == null) ? "" : value.trim(); }
@Override public AttachmentPart getAttachment(SOAPElement element) throws SOAPException { String ref = element.getAttribute("href"); if (ref.length() == 0) { ref = element.getValue(); if (ref == null || ref.length() == 0) return null; } return getAttachmentByRef(ref); }
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 String getFaultNode() { if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI())) throw new UnsupportedOperationException(BundleUtils.getMessage(bundle, "NOT_SUPPORT_NODE")); if (faultnode == null) { findNodeElement(); if (faultnode == null) return null; } return faultnode.getValue(); }
/** Gets the fault code for this SOAPFault object. */ public String getFaultCode() { if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI())) { if (faultcode == null) findFaultCodeElement(); return faultcode.getValue(); } else { if (faultcode == null) findCodeElement(); return getChildValueElement(faultcode).getValue(); } }
/** * Sets the callback endpoint address specified by the WSA header in the current work context. * * @param element the WSA header * @param workContext the current work context */ @SuppressWarnings("unchecked") private void setReturnAddress(SOAPElement element, WorkContext workContext) { Iterator<SOAPElement> addresses = (Iterator<SOAPElement>) element.getChildElements(WSA_ADDRESS); if (addresses.hasNext()) { String address = addresses.next().getValue(); if (WSA_ANONYMOUS.equals(address)) { throw new ProtocolException("Invalid Callback Address: " + WSA_ANONYMOUS); } if (address != null) { workContext.setHeader(CallbackConstants.ENDPOINT_ADDRESS, address); } } }
public Iterator getFaultReasonTexts() throws SOAPException { if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI())) throw new UnsupportedOperationException(BundleUtils.getMessage(bundle, "NOT_SUPPORT_REASON")); if (faultstring == null) { findReasonElement(); if (faultstring == null) return Collections.EMPTY_LIST.iterator(); } ArrayList<String> texts = new ArrayList<String>(); Iterator it = faultstring.getChildElements(Constants.SOAP12_TEXT); while (it.hasNext()) { SOAPElement textElement = (SOAPElement)it.next(); texts.add(textElement.getValue()); } if (texts.isEmpty()) throw new SOAPException(BundleUtils.getMessage(bundle, "NO_TEXT_ELEMENTS_FOUND")); return texts.iterator(); }
/** Gets the fault actor for this SOAPFault object. */ public String getFaultActor() { if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI())) { if (faultactor == null) { findFaultActorElement(); if (faultactor == null) return null; } return faultactor.getValue(); } else return getFaultRole(); }
/* * soapXMLtoEndpoint sends the soapXMLFileLocation to the endpointURL */ public void soapXMLtoEndpoint(String endpointURL, String soapXMLFileLocation) throws SOAPException { SOAPConnection connection = SOAPConnectionFactory.newInstance().createConnection(); SOAPMessage response = connection.call(xmlStringToSOAPMessage(soapXMLFileLocation), endpointURL); connection.close(); SOAPBody responseBody = response.getSOAPBody(); SOAPBodyElement responseElement = (SOAPBodyElement) responseBody.getChildElements().next(); SOAPElement returnElement = (SOAPElement) responseElement.getChildElements().next(); if (responseBody.getFault() != null) { System.out.println("fault != null"); System.out.println(returnElement.getValue() + " " + responseBody.getFault().getFaultString()); } else { serverResponse = returnElement.getValue(); System.out.println(serverResponse); System.out.println("\nfault == null, got the response properly.\n"); } }
@Override public SOAPElement addChildElement(SOAPElement arg0) throws SOAPException { String uri = arg0.getNamespaceURI(); if(uri == null) return null; String value = arg0.getValue(); if(value == null) value = arg0.getNodeValue(); if(value == null) return null; headers.add(new RpcHeader(uri, arg0.getLocalName(), value)); return arg0; }
public Iterator getFaultSubcodes() { if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI())) throw new UnsupportedOperationException(BundleUtils.getMessage(bundle, "NOT_SUPPORT_SUBCODE")); ArrayList<QName> subcodes = new ArrayList<QName>(); SOAPElement baseCodeElement = faultcode; SOAPElement subcodeElement; for (subcodeElement = getChildSubcodeElement(baseCodeElement); subcodeElement != null; subcodeElement = getChildSubcodeElement(baseCodeElement)) { SOAPElement valueElement = getChildValueElement(subcodeElement); QName subcode = QNameBuilder.buildQName(valueElement, valueElement.getValue()); subcodes.add(subcode); baseCodeElement = subcodeElement; } // this iterator should not support the remove method return Collections.unmodifiableList(subcodes).iterator(); }
public QName getFaultCodeAsQName() { if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI())) { if (faultcode == null) findFaultCodeElement(); return QNameBuilder.buildQName(faultcode, faultcode.getValue()); } else { if (faultcode == null) findCodeElement(); SOAPElement valueElement = getChildValueElement(faultcode); return QNameBuilder.buildQName(valueElement, valueElement.getValue()); } }
public String getFaultReasonText(Locale locale) throws SOAPException { if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI())) throw new UnsupportedOperationException(BundleUtils.getMessage(bundle, "NOT_SUPPORT_REASON")); if (locale == null) return null; if (faultstring == null) { findReasonElement(); if (faultstring == null) return null; } SOAPElement textElement = getTextElement(locale); return textElement != null ? textElement.getValue() : null; }