Package javax.xml.soap

Examples of javax.xml.soap.SOAPConnectionFactory.createConnection()


                "Japanese : \u3088\u3046\u3053\u305d");
    }

    public void testSynchronization() throws Exception {
        SOAPConnectionFactory scFactory = SOAPConnectionFactory.newInstance();
        SOAPConnection con = scFactory.createConnection();
        MessageFactory factory = MessageFactory.newInstance();
        SOAPMessage message = factory.createMessage();
        String requestEncoding = "UTF-16";
        message.setProperty(SOAPMessage.CHARACTER_SET_ENCODING, requestEncoding);
        SOAPEnvelope envelope = message.getSOAPPart().getEnvelope();
View Full Code Here


      AttachmentPart ap2 = msg.createAttachmentPart();
      ap2.setContent("Attachment content - Part 2", "text/plain");
      msg.addAttachmentPart(ap2);
      msg.saveChanges();

      SOAPConnection con = conFac.createConnection();

      final String serviceURL = "http://" + getServerHost() + ":8080/saaj-soap-connection";

      URL endpoint = new URL(serviceURL);
      SOAPMessage response = con.call(msg, endpoint);
View Full Code Here

     *             if unable to create connection
     */
    private static SOAPConnection createConnection() throws SOAPException {
        SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory
                .newInstance();
        SOAPConnection connection = soapConnectionFactory.createConnection();
        return connection;
    }

    /**
     * Closes the SOAP connection
View Full Code Here

     
      MessageFactory msgFactory = MessageFactory.newInstance();
      SOAPMessage soapMessage = msgFactory.createMessage(null, new ByteArrayInputStream(reqEnv.getBytes()));
     
      SOAPConnectionFactory conFactory = SOAPConnectionFactory.newInstance();
      SOAPConnection con = conFactory.createConnection();
      SOAPMessage resMessage = con.call(soapMessage, "http://" + getServerHost() + ":8080/jaxrpc-jbws1125");
      SOAPElement soapElement = (SOAPElement)resMessage.getSOAPBody().getChildElements().next();
      assertEquals("noParamPartResponse", soapElement.getElementName().getLocalName());
     
   }
View Full Code Here

      //Debugging code
      ByteArrayOutputStream outStream = new ByteArrayOutputStream();
      message.writeTo(outStream);
      SOAPConnectionFactory connectionFactory = SOAPConnectionFactory
          .newInstance();
      SOAPConnection connection = connectionFactory.createConnection();

      // this can either be a SOAPException or SOAPMessage
      HttpResponseBean responseBean = new HttpResponseBean();
      Object response;
View Full Code Here

        msg.addAttachmentPart(ap1);
        AttachmentPart ap2 = msg.createAttachmentPart();
        ap2.setContent("Attachment content - Part 2", "text/plain");
        msg.addAttachmentPart(ap2);
       
        SOAPConnection con = conFac.createConnection();
        URL endpoint = new URL("http://localhost:9008/SOAPServiceProviderRPCLit/SoapPortProviderRPCLit1");
        SOAPMessage response = con.call(msg, endpoint);
        QName sayHiResp = new QName("http://apache.org/hello_world_rpclit", "sayHiResponse");
        assertNotNull(response.getSOAPBody().getChildElements(sayHiResp));
        assertEquals(2, response.countAttachments());
View Full Code Here

        super(name);
    }
   
    public void testStringAttachment() throws Exception {
      SOAPConnectionFactory scFactory = SOAPConnectionFactory.newInstance();
      SOAPConnection con = scFactory.createConnection();
     
      MessageFactory factory = MessageFactory.newInstance();
      SOAPMessage message = factory.createMessage();
      AttachmentPart attachment = message.createAttachmentPart();
      String stringContent = "Update address for Sunny Skies " +
View Full Code Here

      assertTrue(message.countAttachments()==0);
    }
   
    public void testMultipleAttachments() throws Exception {
        SOAPConnectionFactory scFactory = SOAPConnectionFactory.newInstance();
        SOAPConnection con = scFactory.createConnection();

        MessageFactory factory = MessageFactory.newInstance();
        SOAPMessage msg = factory.createMessage();
        java.net.URL url1 = new java.net.URL("http://slashdot.org/slashdot.xml");
        java.net.URL url2 = new java.net.URL("http://www.apache.org/LICENSE.txt");
View Full Code Here

    }

    public static void searchUDDI(String name, String url) throws Exception {
        // Create the connection and the message factory.
        SOAPConnectionFactory scf = SOAPConnectionFactory.newInstance();
        SOAPConnection connection = scf.createConnection();
        MessageFactory msgFactory = MessageFactory.newInstance();

        // Create a message
        SOAPMessage msg = msgFactory.createMessage();
View Full Code Here

        System.out.print("The last price for SUNW is " + stockQuote.getStockQuote("SUNW"));
    }

    public String getStockQuote(String tickerSymbol) throws Exception {
        SOAPConnectionFactory scFactory = SOAPConnectionFactory.newInstance();
        SOAPConnection con = scFactory.createConnection();

        MessageFactory factory = MessageFactory.newInstance();
        SOAPMessage message = factory.createMessage();

        SOAPPart soapPart = message.getSOAPPart();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.