SOAPConnection soapConnection = soapConnectionFactory.createConnection();
SOAPConnection soapConnection = soapConnectionFactory.createConnection();
SOAPConnection soapConnection = soapConnectionFactory.createConnection();
SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance(); SOAPConnection connection = soapConnectionFactory.createConnection(); java.net.URL endpoint = new URL("url"); SOAPMessage message = xmlStringParser.getSoapMessageFromString(XMLString); SOAPMessage response = connection.call(message, endpoint);
public SOAPConnection createConnection() throws SOAPException { return getSOAPConnectionFactory().createConnection(); }
public SOAPConnection createConnection() throws SOAPException { return getSOAPConnectionFactory().createConnection(); }
public SOAPConnection createConnection() throws SOAPException { return getSOAPConnectionFactory().createConnection(); }
public SOAPConnection createConnection() throws SOAPException { return getSOAPConnectionFactory().createConnection(); }
@Override public void accept(RadioEvents events) { this.events = events; try { SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance(); soapConnection = soapConnectionFactory.createConnection(); connected = true; events.connected(); } catch (SOAPException e) { logger.warn("accept() failed", e); } }
@Override public void connect(String uri, RadioEvents events) { url = uri; this.events = events; try { SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance(); soapConnection = soapConnectionFactory.createConnection(); connected = true; events.connected(); } catch (SOAPException e) { logger.warn("connect() failed", e); } }
MessageFactory msgFactory = MessageFactory.newInstance(); SOAPMessage message = msgFactory.createMessage(); String loginPassword = "user:password"; message.getMimeHeaders().addHeader("Authorization", "Basic " + new String(Base64.encode(loginPassword.getBytes()))); SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance(); SOAPConnection soapConnection = soapConnectionFactory.createConnection(); // Send SOAP Message to SOAP Server String url = "http://servername/name1"; SOAPMessage soapResponse = soapConnection.call(message, url);
import javax.xml.soap.*; public String callTestService(String soapRequestXml, String url) throws Exception { // Create SOAP Connection SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance(); SOAPConnection soapConnection = soapConnectionFactory.createConnection(); SOAPMessage soapRequest = MessageFactory.newInstance().createMessage(new MimeHeaders(), new ByteArrayInputStream(soapRequestXml.getBytes())); // Send SOAP Message to SOAP Server SOAPMessage soapResponse = soapConnection.call(soapRequest, url); ByteArrayOutputStream soapResponseBaos = new ByteArrayOutputStream(); soapResponse.writeTo(soapResponseBaos); String soapResponseXml = soapResponseBaos.toString(); return soapResponseXml; }
byte[] encoded = Files.readAllBytes(Paths.get("C:\\Users\\timofb\\Documents\\test.txt")); String soapXml = new String(encoded, StandardCharsets.UTF_8); SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance(); java.net.URL endpoint = new URL("http://" + ip + "/cs-repository/services/xds-iti41"); SOAPConnection connection = soapConnectionFactory.createConnection(); MessageFactory factory = MessageFactory.newInstance(); SOAPMessage message = factory.createMessage(new MimeHeaders(), new ByteArrayInputStream(encoded)); AttachmentPart attachment = message.createAttachmentPart(); attachment.setContent("sm_content", "text/plain"); attachment.setContentId("1.9f910338bf0cac0e783bfdec7e53be9237684caa8f8f4e6d@apache.org"); message.addAttachmentPart(attachment); SOAPMessage response = connection.call(message, endpoint); ByteArrayOutputStream out = new ByteArrayOutputStream(); response.writeTo(out); String strMsg = new String(out.toByteArray()); return strMsg;
public void callWebService() throws SOAPException, IOException { SOAPMessage request = createEchoRequest(); SOAPConnection connection = connectionFactory.createConnection(); SOAPMessage response = connection.call(request, url); if (!response.getSOAPBody().hasFault()) { writeEchoResponse(response); } else { SOAPFault fault = response.getSOAPBody().getFault(); System.err.println("Received SOAP Fault"); System.err.println("SOAP Fault Code :" + fault.getFaultCode()); System.err.println("SOAP Fault String :" + fault.getFaultString()); } }
@Test(expected = NetworkReactiveAuditException.class) public void createConnection() throws SOAPException { TestTools.strict.commit(); x.createConnection(); }
public void sendSoapMessage(String url) throws SOAPException, IOException { SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance(); soapConnection = soapConnectionFactory.createConnection(); try { soapResponse = soapConnection.call(request, url); } catch (Exception e) { logErrorToSystemOut(e); throw new CommandException("The request resulted in an error: " + e.getMessage()); } logResponseToSystemOut(); closeSoapConnection(); storeResponseAsString(); }
public SOAPMessage sendMessage() throws Exception { SOAPConnectionFactory conFactory = SOAPConnectionFactory.newInstance(); SOAPConnection connection = conFactory.createConnection(); MessageFactory msgFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL); SOAPMessage msg = msgFactory.createMessage(); SOAPBodyElement bodyElement = msg.getSOAPBody().addBodyElement(new QName("urn:switchyard-quickstart:soap-mtom:1.0", "image")); bodyElement.setTextContent(imageData); return connection.call(msg, new URL(SWITCHYARD_WEB_SERVICE)); }
SOAPConnectionFactory soapfactory=SOAPConnectionFactory.newInstance(); SOAPConnection soapconnection=soapfactory.createConnection(); MessageFactory messagefactory=MessageFactory.newInstance(); SOAPMessage messege=messagefactory.createMessage(); SOAPEnvelope envelop=messege.getSOAPPart().getEnvelope(); SOAPHeader header=messege.getSOAPHeader(); SOAPBody body=messege.getSOAPBody(); Name header_context=envelop.createName("context", null,"urn:zimbra"); Name auth_request=envelop.createName("AuthRequest",null,"urn:zimbraAccount"); Name account=envelop.createName("account"); Name password=envelop.createName("password"); header.addHeaderElement(header_context); SOAPBodyElement auth_body=body.addBodyElement(auth_request); auth_body.addChildElement(account).addAttribute(envelop.createName("by"),"name").addTextNode("abc");//(abc==your username) auth_body.addChildElement(password).addTextNode("1234");//(1234=your password) URL url=new URL("http://192.168.1.67/service/soap/AuthRequest"); SOAPMessage response=soapconnection.call(messege, url);
/** * Test it! */ public void runTest(Properties properties) { try { Object jibxMessage = createMessage(properties); SOAPMessage soapMessage = createSOAPMessage(jibxMessage); SOAPConnection connection = SOAPConnectionFactory.newInstance().createConnection(); SOAPMessage soapResponse = connection.call(soapMessage, getEndpoint(properties)); connection.close(); Object res = getResponseFromSOAPMessage(soapResponse, getResponseClass(jibxMessage)); checkResponseMessage(properties, res); } catch (SOAPException e) { e.printStackTrace(); } } /**
public SOAPMessage sendMessage() throws Exception { SOAPConnectionFactory conFactory = SOAPConnectionFactory.newInstance(); SOAPConnection connection = conFactory.createConnection(); MessageFactory msgFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL); SOAPMessage msg = msgFactory.createMessage(); SOAPBodyElement bodyElement = msg.getSOAPBody().addBodyElement(new QName("urn:switchyard-quickstart:soap-attachment:1.0", "echoImage")); bodyElement.addTextNode("cid:switchyard.png"); // CXF does not set content-type. msg.getMimeHeaders().addHeader("Content-Type", "multipart/related; type=\"text/xml\"; start=\"<root.message@cxf.apache.org>\""); msg.getSOAPPart().setContentId("<root.message@cxf.apache.org>"); AttachmentPart ap = msg.createAttachmentPart(); ap.setDataHandler(new DataHandler(new StreamDataSource())); ap.setContentId("<switchyard.png>"); msg.addAttachmentPart(ap); return connection.call(msg, new URL(SWITCHYARD_WEB_SERVICE)); }