Package javax.xml.soap

Examples of javax.xml.soap.SOAPConnectionFactory


  protected SOAPConnection createSOAPConnection()
  {
    try
    {
      SOAPConnectionFactory scf = SOAPConnectionFactory.newInstance();
      return scf.createConnection();
    }
    catch (UnsupportedOperationException e)
    {
      throw new JRRuntimeException(e);
    }
View Full Code Here


    private SOAPConnection getSoapConnectionInstance()
        throws UnsupportedOperationException,
        SOAPException
    {

        final SOAPConnectionFactory soapConnectionFactory =
            SOAPConnectionFactory.newInstance();
        final SOAPConnection soapConnection =
            soapConnectionFactory.createConnection();

        return soapConnection;
    }
View Full Code Here

   
    @Test
    public void testSWA() throws Exception {
        SOAPFactory soapFac = SOAPFactory.newInstance();
        MessageFactory msgFac = MessageFactory.newInstance();
        SOAPConnectionFactory conFac = SOAPConnectionFactory.newInstance();
        SOAPMessage msg = msgFac.createMessage();
       
        QName sayHi = new QName("http://apache.org/hello_world_rpclit", "sayHiWAttach");
        msg.getSOAPBody().addChildElement(soapFac.createElement(sayHi));
        AttachmentPart ap1 = msg.createAttachmentPart();
        ap1.setContent("Attachment content", "text/plain");
        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

        Element response = null;
        try
        {
           SOAPMessage message = this.createSOAPMessage(request);
           //Make the SAAJ Call now
           SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance();
           SOAPConnection connection = soapConnectionFactory.createConnection();
           SOAPMessage soapResponse = connection.call(message, endpointURL);
          
           SOAPBody soapBody = soapResponse.getSOAPBody();
           boolean hasFault = soapBody.hasFault();
           if(hasFault)
View Full Code Here

        Element response = null;
        try
        {
           SOAPMessage message = this.createSOAPMessage(request);
           //Make the SAAJ Call now
           SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance();
           SOAPConnection connection = soapConnectionFactory.createConnection();
           SOAPMessage soapResponse = connection.call(message, endpointURL);
          
           SOAPBody soapBody = soapResponse.getSOAPBody();
           boolean hasFault = soapBody.hasFault();
           if(hasFault)
View Full Code Here

            soapMessage.saveChanges();

            /**
             * Construct a default SOAP connection factory.
             */
            SOAPConnectionFactory connectionFactory = SOAPConnectionFactory.newInstance();

            /**
             * Get SOAP connection.
             */
            SOAPConnection soapConnection = connectionFactory.createConnection();

            /**
             * Construct endpoint object.
             */
            URLEndpoint endpoint = new URLEndpoint (url);
View Full Code Here

    public TestEnvelope(String name) {
        super(name);
    }

    private SOAPEnvelope getSOAPEnvelope() throws Exception {
        SOAPConnectionFactory scFactory = SOAPConnectionFactory.newInstance();
        SOAPConnection con = scFactory.createConnection();

        MessageFactory factory = MessageFactory.newInstance();
        SOAPMessage message = factory.createMessage();
        SOAPEnvelope envelope = message.getSOAPPart().getEnvelope();
        return envelope;
View Full Code Here

        searchUDDI(args[0], args[1]);
    }

    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

        DelayedStockQuote stockQuote = new DelayedStockQuote();
        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

     @return True if sent and compared.
     */
    public boolean echoUsingSAAJ(String filename) throws Exception {
        String endPointURLString =  "http://localhost:" +opts.getPort() + "/axis/services/urn:EchoAttachmentsService";

        SOAPConnectionFactory soapConnectionFactory =
                javax.xml.soap.SOAPConnectionFactory.newInstance();
        SOAPConnection soapConnection =
                soapConnectionFactory.createConnection();

        MessageFactory messageFactory =
                MessageFactory.newInstance();
        SOAPMessage soapMessage =
                messageFactory.createMessage();
View Full Code Here

TOP

Related Classes of javax.xml.soap.SOAPConnectionFactory

Copyright © 2018 www.massapicom. 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.