Package javax.xml.soap

Examples of javax.xml.soap.SOAPConnection.call()


                ByteArrayOutputStream buffer = new ByteArrayOutputStream();
                inMessage.writeTo(buffer);
                log.debug(new String(buffer.toByteArray()));
            }
           
            SOAPMessage response = connection.call(inMessage, soapEndpoint);
            if (response != null) {
                marshaler.toNMS(out, response);
                return true;
            } else {
                return false;
View Full Code Here


                .addTextNode(name);

        URLEndpoint endpoint = new URLEndpoint(url);
        msg.saveChanges();

        SOAPMessage reply = connection.call(msg, endpoint);
        //System.out.println("Received reply from: " + endpoint);
        //reply.writeTo(System.out);
        connection.close();
    }
}
View Full Code Here

        Name name = envelope.createName("symbol");
        SOAPElement symbol = gltp.addChildElement(name);
        symbol.addTextNode(tickerSymbol);

        URLEndpoint endpoint = new URLEndpoint("http://66.28.98.121:9090/soap");
        SOAPMessage response = con.call(message, endpoint);
        con.close();

        SOAPPart sp = response.getSOAPPart();
        SOAPEnvelope se = sp.getEnvelope();
        SOAPBody sb = se.getBody();
View Full Code Here

                element.addAttribute(requestEnvelope.createName
                                     ("href"), "cid:" + attachment.getContentId());
            }
        }
        javax.xml.soap.SOAPMessage returnedSOAPMessage =
                soapConnection.call(soapMessage, endPointURLString);
        Iterator iterator = returnedSOAPMessage.getAttachments();
        if (!iterator.hasNext()) {
            //The wrong type of object that what was expected.
            System.out.println("Received problem response from server");
            throw new AxisFault("", "Received problem response from server", null, null);
View Full Code Here

        Name name = envelope.createName("arg0");
        SOAPElement symbol = bodyElement.addChildElement(name);
        symbol.addTextNode("Hello");

        URLEndpoint endpoint = new URLEndpoint("http://localhost:8080/jws/FaultTest.jws");
        SOAPMessage response = con.call(message, endpoint);
        SOAPBody respBody = response.getSOAPPart().getEnvelope().getBody();
        assertTrue(respBody.hasFault());
    }

    public static void main(String args[]) throws Exception {
View Full Code Here

      mimeHeaders.addHeader("Content-Type", "text/xml; charset=UTF-8");
      SOAPMessage reqMsg = factory.createMessage(mimeHeaders, new ByteArrayInputStream(reqEnv.getBytes("UTF-8")));

      SOAPConnection con = SOAPConnectionFactory.newInstance().createConnection();
      String targetAddress = "http://" + getServerHost() + ":8080/jaxrpc-jbws812";
      SOAPMessage resMsg = con.call(reqMsg, targetAddress);
     
      SOAPEnvelope resEnv = resMsg.getSOAPPart().getEnvelope();
      Name name = resEnv.createName("echoSimpleResponse", "ns1", "http://org.jboss.test.ws/jbws812");
      SOAPElement soapElement = (SOAPElement)resMsg.getSOAPBody().getChildElements(name).next();
      soapElement = (SOAPElement)soapElement.getChildElements(resEnv.createName("result")).next();
View Full Code Here

      mimeHeaders.addHeader("SOAPAction", SOAP_ACTION);

      SOAPMessage reqMsg = msgFactory.createMessage(mimeHeaders, new ByteArrayInputStream(reqEnv.getBytes()));

      URL epURL = new URL("http://" + getServerHost() + ":8080/jaxrpc-jbws425");
      SOAPMessage resMsg = con.call(reqMsg, epURL);

      SOAPElement soapElement = (SOAPElement)resMsg.getSOAPBody().getChildElements().next();
      soapElement = (SOAPElement)soapElement.getChildElements().next();
      String soapAction = soapElement.getValue();
      assertEquals(SOAP_ACTION, soapAction);
View Full Code Here

      MessageFactory msgFactory = MessageFactory.newInstance();
      SOAPMessage soapMessage = msgFactory.createMessage(null, new ByteArrayInputStream(getMessage().getBytes()));

      SOAPConnectionFactory conFactory = SOAPConnectionFactory.newInstance();
      SOAPConnection con = conFactory.createConnection();
      SOAPMessage resMessage = con.call(soapMessage, getEndpointAddress());

      SOAPElement soapElement = (SOAPElement)resMessage.getSOAPBody().getChildElements().next();
      assertEquals("echoMessageResponse", soapElement.getElementName().getLocalName());
   }
View Full Code Here

      MessageFactory factory = MessageFactory.newInstance();
      SOAPMessage reqMsg = factory.createMessage(null, new ByteArrayInputStream(reqEnv.getBytes()));

      SOAPConnection con = SOAPConnectionFactory.newInstance().createConnection();
      String targetAddress = "http://" + getServerHost() + ":8080/jaxrpc-samples-exception/ExceptionBean";
      SOAPMessage resMsg = con.call(reqMsg, targetAddress);

      SOAPFault soapFault = resMsg.getSOAPBody().getFault();
      assertNotNull("Expected SOAPFault", soapFault);

      String faultString = soapFault.getFaultString();
View Full Code Here

      Document doc = builder.parse(new ByteArrayInputStream(MessageTestService.request.getBytes()));
      reqMsg.getSOAPBody().addDocument(doc);

      SOAPConnectionFactory conFactory = SOAPConnectionFactory.newInstance();
      SOAPConnection con = conFactory.createConnection();
      SOAPMessage resMsg = con.call(reqMsg, new URL(TARGET_ENDPOINT));

      SOAPBody soapBody = resMsg.getSOAPBody();
      SOAPElement soapElement = (SOAPElement)soapBody.getChildElements().next();

      validateResponse(soapElement);
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.