Java Code Examples for javax.xml.soap.MessageFactory

The following examples show how to use javax.xml.soap.MessageFactory. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@Override
protected  MessageFactory newMessageFactory(String protocol)
    throws SOAPException {
    if (SOAPConstants.SOAP_1_1_PROTOCOL.equals(protocol)) {
          return new com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl();
    } else if (SOAPConstants.SOAP_1_2_PROTOCOL.equals(protocol)) {
          return new com.sun.xml.internal.messaging.saaj.soap.ver1_2.SOAPMessageFactory1_2Impl();
    } else if (SOAPConstants.DYNAMIC_SOAP_PROTOCOL.equals(protocol)) {
          return new com.sun.xml.internal.messaging.saaj.soap.dynamic.SOAPMessageFactoryDynamicImpl();
    } else {
        log.log(
            Level.SEVERE,
            "SAAJ0569.soap.unknown.protocol",
            new Object[] {protocol, "MessageFactory"});
        throw new SOAPException("Unknown Protocol: " + protocol +
                                    "  specified for creating MessageFactory");
    }
}
 
Example 2
Source Project: hottub   Source File: SAAJMetaFactoryImpl.java    License: GNU General Public License v2.0 6 votes vote down vote up
protected  MessageFactory newMessageFactory(String protocol)
    throws SOAPException {
    if (SOAPConstants.SOAP_1_1_PROTOCOL.equals(protocol)) {
          return new com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl();
    } else if (SOAPConstants.SOAP_1_2_PROTOCOL.equals(protocol)) {
          return new com.sun.xml.internal.messaging.saaj.soap.ver1_2.SOAPMessageFactory1_2Impl();
    } else if (SOAPConstants.DYNAMIC_SOAP_PROTOCOL.equals(protocol)) {
          return new com.sun.xml.internal.messaging.saaj.soap.dynamic.SOAPMessageFactoryDynamicImpl();
    } else {
        log.log(
            Level.SEVERE,
            "SAAJ0569.soap.unknown.protocol",
            new Object[] {protocol, "MessageFactory"});
        throw new SOAPException("Unknown Protocol: " + protocol +
                                    "  specified for creating MessageFactory");
    }
}
 
Example 3
protected  MessageFactory newMessageFactory(String protocol)
    throws SOAPException {
    if (SOAPConstants.SOAP_1_1_PROTOCOL.equals(protocol)) {
          return new com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl();
    } else if (SOAPConstants.SOAP_1_2_PROTOCOL.equals(protocol)) {
          return new com.sun.xml.internal.messaging.saaj.soap.ver1_2.SOAPMessageFactory1_2Impl();
    } else if (SOAPConstants.DYNAMIC_SOAP_PROTOCOL.equals(protocol)) {
          return new com.sun.xml.internal.messaging.saaj.soap.dynamic.SOAPMessageFactoryDynamicImpl();
    } else {
        log.log(
            Level.SEVERE,
            "SAAJ0569.soap.unknown.protocol",
            new Object[] {protocol, "MessageFactory"});
        throw new SOAPException("Unknown Protocol: " + protocol +
                                    "  specified for creating MessageFactory");
    }
}
 
Example 4
protected  MessageFactory newMessageFactory(String protocol)
    throws SOAPException {
    if (SOAPConstants.SOAP_1_1_PROTOCOL.equals(protocol)) {
          return new com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl();
    } else if (SOAPConstants.SOAP_1_2_PROTOCOL.equals(protocol)) {
          return new com.sun.xml.internal.messaging.saaj.soap.ver1_2.SOAPMessageFactory1_2Impl();
    } else if (SOAPConstants.DYNAMIC_SOAP_PROTOCOL.equals(protocol)) {
          return new com.sun.xml.internal.messaging.saaj.soap.dynamic.SOAPMessageFactoryDynamicImpl();
    } else {
        log.log(
            Level.SEVERE,
            "SAAJ0569.soap.unknown.protocol",
            new Object[] {protocol, "MessageFactory"});
        throw new SOAPException("Unknown Protocol: " + protocol +
                                    "  specified for creating MessageFactory");
    }
}
 
Example 5
Source Project: onvif   Source File: DeviceDiscovery.java    License: Apache License 2.0 6 votes vote down vote up
private static Collection<String> parseSoapResponseForUrls(byte[] data)
    throws SOAPException, IOException {
  // System.out.println(new String(data));
  final Collection<String> urls = new ArrayList<>();
  MessageFactory factory = MessageFactory.newInstance(WS_DISCOVERY_SOAP_VERSION);
  final MimeHeaders headers = new MimeHeaders();
  headers.addHeader("Content-type", WS_DISCOVERY_CONTENT_TYPE);
  SOAPMessage message = factory.createMessage(headers, new ByteArrayInputStream(data));
  SOAPBody body = message.getSOAPBody();
  for (Node node : getNodeMatching(body, ".*:XAddrs")) {
    if (node.getTextContent().length() > 0) {
      urls.addAll(Arrays.asList(node.getTextContent().split(" ")));
    }
  }
  return urls;
}
 
Example 6
protected  MessageFactory newMessageFactory(String protocol)
    throws SOAPException {
    if (SOAPConstants.SOAP_1_1_PROTOCOL.equals(protocol)) {
          return new com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl();
    } else if (SOAPConstants.SOAP_1_2_PROTOCOL.equals(protocol)) {
          return new com.sun.xml.internal.messaging.saaj.soap.ver1_2.SOAPMessageFactory1_2Impl();
    } else if (SOAPConstants.DYNAMIC_SOAP_PROTOCOL.equals(protocol)) {
          return new com.sun.xml.internal.messaging.saaj.soap.dynamic.SOAPMessageFactoryDynamicImpl();
    } else {
        log.log(
            Level.SEVERE,
            "SAAJ0569.soap.unknown.protocol",
            new Object[] {protocol, "MessageFactory"});
        throw new SOAPException("Unknown Protocol: " + protocol +
                                    "  specified for creating MessageFactory");
    }
}
 
Example 7
protected  MessageFactory newMessageFactory(String protocol)
    throws SOAPException {
    if (SOAPConstants.SOAP_1_1_PROTOCOL.equals(protocol)) {
          return new com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl();
    } else if (SOAPConstants.SOAP_1_2_PROTOCOL.equals(protocol)) {
          return new com.sun.xml.internal.messaging.saaj.soap.ver1_2.SOAPMessageFactory1_2Impl();
    } else if (SOAPConstants.DYNAMIC_SOAP_PROTOCOL.equals(protocol)) {
          return new com.sun.xml.internal.messaging.saaj.soap.dynamic.SOAPMessageFactoryDynamicImpl();
    } else {
        log.log(
            Level.SEVERE,
            "SAAJ0569.soap.unknown.protocol",
            new Object[] {protocol, "MessageFactory"});
        throw new SOAPException("Unknown Protocol: " + protocol +
                                    "  specified for creating MessageFactory");
    }
}
 
Example 8
Source Project: openjdk-jdk9   Source File: XmlTest.java    License: GNU General Public License v2.0 6 votes vote down vote up
private SOAPMessage createMessage(MessageFactory mf) throws SOAPException, IOException {
    SOAPMessage msg = mf.createMessage();
    SOAPEnvelope envelope = msg.getSOAPPart().getEnvelope();
    Name name = envelope.createName("hello", "ex", "http://example.com");
    envelope.getBody().addChildElement(name).addTextNode("THERE!");

    String s = "<root><hello>THERE!</hello></root>";

    AttachmentPart ap = msg.createAttachmentPart(
            new StreamSource(new ByteArrayInputStream(s.getBytes())),
            "text/xml"
    );
    msg.addAttachmentPart(ap);
    msg.saveChanges();

    return msg;
}
 
Example 9
private static SOAPMessage createSoapMessage() throws SOAPException, UnsupportedEncodingException {
    String xml = "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">"
                +"<SOAP-ENV:Body/></SOAP-ENV:Envelope>";
    MessageFactory mFactory = MessageFactory.newInstance();
    SOAPMessage msg = mFactory.createMessage();
    msg.getSOAPPart().setContent(new StreamSource(new ByteArrayInputStream(xml.getBytes("utf-8"))));
    return msg;
}
 
Example 10
private static SOAPMessage createSoapMessage() throws SOAPException, UnsupportedEncodingException {
    String xml = "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">"
                +"<SOAP-ENV:Body/></SOAP-ENV:Envelope>";
    MessageFactory mFactory = MessageFactory.newInstance();
    SOAPMessage msg = mFactory.createMessage();
    msg.getSOAPPart().setContent(new StreamSource(new ByteArrayInputStream(xml.getBytes("utf-8"))));
    return msg;
}
 
Example 11
Source Project: TencentKona-8   Source File: MailTest.java    License: GNU General Public License v2.0 5 votes vote down vote up
void addSoapAttachement() {
    try {
        MessageFactory messageFactory = MessageFactory.newInstance();
        SOAPMessage message = messageFactory.createMessage();
        AttachmentPart a = message.createAttachmentPart();
        a.setContentType("binary/octet-stream");
        message.addAttachmentPart(a);
    } catch (SOAPException e) {
        e.printStackTrace();
    }
}
 
Example 12
Source Project: jdk8u60   Source File: MailTest.java    License: GNU General Public License v2.0 5 votes vote down vote up
void addSoapAttachement() {
    try {
        MessageFactory messageFactory = MessageFactory.newInstance();
        SOAPMessage message = messageFactory.createMessage();
        AttachmentPart a = message.createAttachmentPart();
        a.setContentType("binary/octet-stream");
        message.addAttachmentPart(a);
    } catch (SOAPException e) {
        e.printStackTrace();
    }
}
 
Example 13
Source Project: hottub   Source File: MailTest.java    License: GNU General Public License v2.0 5 votes vote down vote up
void addSoapAttachement() {
    try {
        MessageFactory messageFactory = MessageFactory.newInstance();
        SOAPMessage message = messageFactory.createMessage();
        AttachmentPart a = message.createAttachmentPart();
        a.setContentType("binary/octet-stream");
        message.addAttachmentPart(a);
    } catch (SOAPException e) {
        e.printStackTrace();
    }
}
 
Example 14
Source Project: steady   Source File: AbstractSecurityTest.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Creates a {@link SoapMessage} from the contents of a document.
 * @param doc the document containing the SOAP content.
 */
protected SoapMessage getSoapMessageForDom(Document doc) throws SOAPException {
    SOAPMessage saajMsg = MessageFactory.newInstance().createMessage();
    SOAPPart part = saajMsg.getSOAPPart();
    part.setContent(new DOMSource(doc));
    saajMsg.saveChanges();

    SoapMessage msg = new SoapMessage(new MessageImpl());
    Exchange ex = new ExchangeImpl();
    ex.setInMessage(msg);
    msg.setContent(SOAPMessage.class, saajMsg);
    return msg;
}
 
Example 15
private static SOAPMessage createSoapMessage() throws SOAPException, UnsupportedEncodingException {
    String xml = "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">"
                +"<SOAP-ENV:Body/></SOAP-ENV:Envelope>";
    MessageFactory mFactory = MessageFactory.newInstance();
    SOAPMessage msg = mFactory.createMessage();
    msg.getSOAPPart().setContent(new StreamSource(new ByteArrayInputStream(xml.getBytes("utf-8"))));
    return msg;
}
 
Example 16
Source Project: steady   Source File: AbstractSecurityTest.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Creates a {@link SoapMessage} from the contents of a document.
 * @param doc the document containing the SOAP content.
 */
protected SoapMessage getSoapMessageForDom(Document doc) throws SOAPException {
    SOAPMessage saajMsg = MessageFactory.newInstance().createMessage();
    SOAPPart part = saajMsg.getSOAPPart();
    part.setContent(new DOMSource(doc));
    saajMsg.saveChanges();

    SoapMessage msg = new SoapMessage(new MessageImpl());
    Exchange ex = new ExchangeImpl();
    ex.setInMessage(msg);
    msg.setContent(SOAPMessage.class, saajMsg);
    return msg;
}
 
Example 17
Source Project: mdw   Source File: DocumentWebServiceAdapter.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Create the SOAP request object based on the document variable value.
 */
protected SOAPMessage createSoapRequest(Object requestObj) throws ActivityException {
    try {
        MessageFactory messageFactory = getSoapMessageFactory();
        SOAPMessage soapMessage = messageFactory.createMessage();
        Map<Name,String> soapReqHeaders = getSoapRequestHeaders();
        if (soapReqHeaders != null) {
            SOAPHeader header = soapMessage.getSOAPHeader();
            for (Name name : soapReqHeaders.keySet()) {
                header.addHeaderElement(name).setTextContent(soapReqHeaders.get(name));
            }
        }

        SOAPBody soapBody = soapMessage.getSOAPBody();

        Document requestDoc = null;
        if (requestObj instanceof String) {
            requestDoc = DomHelper.toDomDocument((String)requestObj);
            soapBody.addDocument(requestDoc);
        }
        else {
            Variable reqVar = getProcessDefinition().getVariable(getAttributeValue(REQUEST_VARIABLE));
            XmlDocumentTranslator docRefTrans = (XmlDocumentTranslator)getPackage().getTranslator(reqVar.getType());
            requestDoc = docRefTrans.toDomDocument(requestObj);
            Document copiedDocument = DomHelper.copyDomDocument(requestDoc);
            soapBody.addDocument(copiedDocument);
        }

        return soapMessage;
    }
    catch (Exception ex) {
        throw new ActivityException(ex.getMessage(), ex);
    }
}
 
Example 18
Source Project: steady   Source File: AbstractSecurityTest.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Creates a {@link SoapMessage} from the contents of a document.
 * @param doc the document containing the SOAP content.
 */
protected SoapMessage getSoapMessageForDom(Document doc) throws SOAPException {
    SOAPMessage saajMsg = MessageFactory.newInstance().createMessage();
    SOAPPart part = saajMsg.getSOAPPart();
    part.setContent(new DOMSource(doc));
    saajMsg.saveChanges();

    SoapMessage msg = new SoapMessage(new MessageImpl());
    Exchange ex = new ExchangeImpl();
    ex.setInMessage(msg);
    msg.setContent(SOAPMessage.class, saajMsg);
    return msg;
}
 
Example 19
Source Project: jdk8u-jdk   Source File: MailTest.java    License: GNU General Public License v2.0 5 votes vote down vote up
void addSoapAttachement() {
    try {
        MessageFactory messageFactory = MessageFactory.newInstance();
        SOAPMessage message = messageFactory.createMessage();
        AttachmentPart a = message.createAttachmentPart();
        a.setContentType("binary/octet-stream");
        message.addAttachmentPart(a);
    } catch (SOAPException e) {
        e.printStackTrace();
    }
}
 
Example 20
public Long addValueToValuesList(Long valueListId, String value) {
	LOG.info("[Archer] Adding value '"+value+"' to value list id "+valueListId);
	// Adding items to value lists is not supported via REST API, so we need to revert to SOAP API
	// TODO Simplify this method?
	// TODO Make this method more fail-safe (like checking for the correct response element)?
	Long result = null;
	try {
		MessageFactory messageFactory = MessageFactory.newInstance();
        SOAPMessage message = messageFactory.createMessage();
        SOAPPart soapPart = message.getSOAPPart();
        SOAPEnvelope envelope = soapPart.getEnvelope();
        SOAPBody body = envelope.getBody();
        SOAPElement bodyElement = body.addChildElement(envelope.createName("CreateValuesListValue", "", "http://archer-tech.com/webservices/"));
        bodyElement.addChildElement("sessionToken").addTextNode(tokenProviderRest.getToken());
        bodyElement.addChildElement("valuesListId").addTextNode(valueListId+"");
        bodyElement.addChildElement("valuesListValueName").addTextNode(value);
        message.saveChanges();
 
        SOAPMessage response = executeRequest(HttpMethod.POST, 
        		getBaseResource().path("/ws/field.asmx")
        		.request()
        		.header("SOAPAction", "\"http://archer-tech.com/webservices/CreateValuesListValue\"")
        		.accept("text/xml"),
        		Entity.entity(message, "text/xml"), SOAPMessage.class);
        @SuppressWarnings("unchecked")
		Iterator<Object> it = response.getSOAPBody().getChildElements();
        while (it.hasNext()){
        	Object o = it.next();
        	if ( o instanceof SOAPElement ) {	
        		result = new Long(((SOAPElement)o).getTextContent());
        	}
          }
        System.out.println(response);
	} catch (SOAPException e) {
		throw new RuntimeException("Error executing SOAP request", e);
	}
	return result;
}
 
Example 21
Source Project: openjdk-jdk8u   Source File: MailTest.java    License: GNU General Public License v2.0 5 votes vote down vote up
void addSoapAttachement() {
    try {
        MessageFactory messageFactory = MessageFactory.newInstance();
        SOAPMessage message = messageFactory.createMessage();
        AttachmentPart a = message.createAttachmentPart();
        a.setContentType("binary/octet-stream");
        message.addAttachmentPart(a);
    } catch (SOAPException e) {
        e.printStackTrace();
    }
}
 
Example 22
private static SOAPMessage createSoapMessage() throws SOAPException, UnsupportedEncodingException {
    String xml = "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">"
                +"<SOAP-ENV:Body/></SOAP-ENV:Envelope>";
    MessageFactory mFactory = MessageFactory.newInstance();
    SOAPMessage msg = mFactory.createMessage();
    msg.getSOAPPart().setContent(new StreamSource(new ByteArrayInputStream(xml.getBytes("utf-8"))));
    return msg;
}
 
Example 23
private static SOAPMessage createSoapMessage() throws SOAPException, UnsupportedEncodingException {
    String xml = "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">"
                +"<SOAP-ENV:Body/></SOAP-ENV:Envelope>";
    MessageFactory mFactory = MessageFactory.newInstance();
    SOAPMessage msg = mFactory.createMessage();
    msg.getSOAPPart().setContent(new StreamSource(new ByteArrayInputStream(xml.getBytes("utf-8"))));
    return msg;
}
 
Example 24
void addSoapAttachement() {
    try {
        MessageFactory messageFactory = MessageFactory.newInstance();
        SOAPMessage message = messageFactory.createMessage();
        AttachmentPart a = message.createAttachmentPart();
        a.setContentType("binary/octet-stream");
        message.addAttachmentPart(a);
    } catch (SOAPException e) {
        e.printStackTrace();
    }
}
 
Example 25
Source Project: mdw   Source File: MdwRpcWebServiceAdapter.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Populate the SOAP request message.
 */
protected SOAPMessage createSoapRequest(Object requestObj) throws ActivityException {
    try {
        MessageFactory messageFactory = getSoapMessageFactory();
        SOAPMessage soapMessage = messageFactory.createMessage();
        Map<Name,String> soapReqHeaders = getSoapRequestHeaders();
        if (soapReqHeaders != null) {
            SOAPHeader header = soapMessage.getSOAPHeader();
            for (Name name : soapReqHeaders.keySet()) {
                header.addHeaderElement(name).setTextContent(soapReqHeaders.get(name));
            }
        }

        SOAPBody soapBody = soapMessage.getSOAPBody();

        Document requestDoc = null;
        if (requestObj instanceof String) {
            requestDoc = DomHelper.toDomDocument((String)requestObj);
        }
        else {
            Variable reqVar = getProcessDefinition().getVariable(getAttributeValue(REQUEST_VARIABLE));
            XmlDocumentTranslator docRefTrans = (XmlDocumentTranslator)getPackage().getTranslator(reqVar.getType());
            requestDoc = docRefTrans.toDomDocument(requestObj);
        }

        SOAPBodyElement bodyElem = soapBody.addBodyElement(getOperation());
        String requestLabel = getRequestLabelPartName();
        if (requestLabel != null) {
            SOAPElement serviceNameElem = bodyElem.addChildElement(requestLabel);
            serviceNameElem.addTextNode(getRequestLabel());
        }
        SOAPElement requestDetailsElem = bodyElem.addChildElement(getRequestPartName());
        requestDetailsElem.addTextNode("<![CDATA[" + DomHelper.toXml(requestDoc) + "]]>");

        return soapMessage;
    }
    catch (Exception ex) {
        throw new ActivityException(ex.getMessage(), ex);
    }
}
 
Example 26
private static SOAPMessage createSoapMessage() throws SOAPException, UnsupportedEncodingException {
    String xml = "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">"
                +"<SOAP-ENV:Body/></SOAP-ENV:Envelope>";
    MessageFactory mFactory = MessageFactory.newInstance();
    SOAPMessage msg = mFactory.createMessage();
    msg.getSOAPPart().setContent(new StreamSource(new ByteArrayInputStream(xml.getBytes("utf-8"))));
    return msg;
}
 
Example 27
Source Project: openjdk-jdk9   Source File: MailTest.java    License: GNU General Public License v2.0 5 votes vote down vote up
void addSoapAttachement() {
    try {
        MessageFactory messageFactory = MessageFactory.newInstance();
        SOAPMessage message = messageFactory.createMessage();
        AttachmentPart a = message.createAttachmentPart();
        a.setContentType("binary/octet-stream");
        message.addAttachmentPart(a);
    } catch (SOAPException e) {
        e.printStackTrace();
    }
}
 
Example 28
Source Project: openjdk-jdk9   Source File: XmlTest.java    License: GNU General Public License v2.0 5 votes vote down vote up
public void test() throws Exception {

        File file = new File("message.xml");
        file.deleteOnExit();

        MessageFactory mf = MessageFactory.newInstance();
        SOAPMessage msg = createMessage(mf);

        // Save the soap message to file
        try (FileOutputStream sentFile = new FileOutputStream(file)) {
            msg.writeTo(sentFile);
        }

        // See if we get the image object back
        try (FileInputStream fin = new FileInputStream(file)) {
            SOAPMessage newMsg = mf.createMessage(msg.getMimeHeaders(), fin);

            newMsg.writeTo(new ByteArrayOutputStream());

            Iterator<?> i = newMsg.getAttachments();
            while (i.hasNext()) {
                AttachmentPart att = (AttachmentPart) i.next();
                Object obj = att.getContent();
                if (!(obj instanceof StreamSource)) {
                    fail("Got incorrect attachment type [" + obj.getClass() + "], " +
                         "expected [javax.xml.transform.stream.StreamSource]");
                }
            }
        }

    }
 
Example 29
Source Project: openjdk-jdk9   Source File: SAAJFactoryTest.java    License: GNU General Public License v2.0 5 votes vote down vote up
protected void test(String[] args) {
    if (args.length < 5) throw new IllegalArgumentException("Incorrect test setup. Required 5 arguments: \n" +
            "   1. expected factory class (if any)\n" +
            "   2. expected \n" +
            "   3. scenario name\n" +
            "   4. jdk/conf configured provider class name\n" +
            "   5. service loader provider class name");

    scenario = args[2]; // scenario name
    prepare(args[3], args[4]); // jdk/conf class, service loader class

    try {
        MessageFactory factory = factory();
        assertTrue(factory != null, "No factory found.");
        String className = factory.getClass().getName();
        assertTrue(args[0].equals(className), "Incorrect factory: [" + className +
                "], Expected: [" + args[0] + "]");

    } catch (Throwable throwable) {
        String expectedExceptionClass = args[1];
        String throwableClass = throwable.getClass().getName();
        boolean correctException = throwableClass.equals(expectedExceptionClass);
        if (!correctException) {
            throwable.printStackTrace();
        }
        assertTrue(correctException, "Got unexpected exception: [" +
                throwableClass + "], expected: [" + expectedExceptionClass + "]");
    } finally {
        cleanResource(providersFile);
        cleanResource(providersDir);

        // unsafe; not running:
        // cleanResource(jdkFile);
    }
}
 
Example 30
Source Project: jdk8u60   Source File: SOAPBindingImpl.java    License: GNU General Public License v2.0 4 votes vote down vote up
public MessageFactory getMessageFactory() {
    return soapVersion.getMessageFactory();
}