Package javax.xml.soap

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


      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


           throws SOAPException, MalformedURLException, IOException
   {
      SOAPConnectionFactory conFactory = SOAPConnectionFactory.newInstance();
      SOAPConnection con = conFactory.createConnection();
      //msg.writeTo(System.out);
      SOAPMessage resMessage = con.call(msg, new URL(TARGET_ENDPOINT_ADDRESS));
      SOAPBody soapBody = resMessage.getSOAPBody();
      SOAPEnvelope soapEnvelope = (SOAPEnvelope)soapBody.getParentElement();

      Name rpcName = soapEnvelope.createName(rpcMethodName + "Response", NS_PREFIX, TARGET_NAMESPACE);
      Iterator childElements = soapBody.getChildElements(rpcName);
View Full Code Here

          "</env:Body>" +
         "</env:Envelope>";

      SOAPMessage reqMsg = MessageFactory.newInstance().createMessage(null, new ByteArrayInputStream(reqStr.getBytes()));
      SOAPConnection con = SOAPConnectionFactory.newInstance().createConnection();
      SOAPMessage resMsg = con.call(reqMsg, "http://" + getServerHost() + ":8080/jaxrpc-jbws775/document");
      SOAPEnvelope resEnv = resMsg.getSOAPPart().getEnvelope();

      assertEquals(resStr, DOMWriter.printNode(resEnv, false));
   }
}
View Full Code Here

         " </env:Body>" +
         "</env:Envelope>";
     
      SOAPMessage reqMessage = factory.createMessage(null, new ByteArrayInputStream(reqStr.getBytes()));
      SOAPConnection con = SOAPConnectionFactory.newInstance().createConnection();
      SOAPMessage resMessage = con.call(reqMessage, "http://" + getServerHost() + ":8080/jaxrpc-jbws1186");
      SOAPElement soapElement = (SOAPElement)resMessage.getSOAPBody().getChildElements().next();
      soapElement = (SOAPElement)soapElement.getChildElements().next();
      assertEquals("1", soapElement.getAttribute("xsi:nil"));
   }
}
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

    */
   private void sendAndValidateMimeMessage(String rpcMethodName, SOAPMessage msg, long count) throws SOAPException, MalformedURLException
   {
      SOAPConnectionFactory conFactory = SOAPConnectionFactory.newInstance();
      SOAPConnection con = conFactory.createConnection();
      SOAPMessage resMessage = con.call(msg, new URL("http://" + getServerHost() + ":8080/jaxrpc-jbws801"));
      SOAPBody soapBody = resMessage.getSOAPBody();
      SOAPEnvelope soapEnvelope = (SOAPEnvelope)soapBody.getParentElement();

      Name rpcName = soapEnvelope.createName(rpcMethodName + "Response", NS_PREFIX, NS_URI);
      Iterator childElements = soapBody.getChildElements(rpcName);
View Full Code Here

      MessageFactory msgFactory = MessageFactory.newInstance();
      SOAPConnection con = SOAPConnectionFactory.newInstance().createConnection();
      SOAPMessage reqMsg = msgFactory.createMessage(null, new ByteArrayInputStream(reqString.getBytes()));

      URL epURL = new URL("http://" + getServerHost() + ":8080/jaxws-jaxbintros/ProviderEndpoint");
      SOAPMessage resMsg = con.call(reqMsg, epURL);
      SOAPEnvelope resEnv = resMsg.getSOAPPart().getEnvelope();

      Element child = (Element)resEnv.getBody().getChildElements().next();
      JAXBContext jc = JAXBContext.newInstance(new Class[]{AnnotatedUserType.class});
      AnnotatedUserType user = (AnnotatedUserType)jc.createUnmarshaller().unmarshal(new DOMSource(child));
View Full Code Here

   private void runEndpointTest(Object endPoint) throws Exception
   {
      SOAPMessage request = buildValidMessage();
      SOAPConnection connection = SOAPConnectionFactory.newInstance().createConnection();
      SOAPMessage response = connection.call(request, endPoint);
      validateResponse(response);
   }

   private SOAPMessage buildValidMessage() throws Exception
   {
View Full Code Here

      MessageFactory msgFactory = MessageFactory.newInstance();
      SOAPConnection con = SOAPConnectionFactory.newInstance().createConnection();
      SOAPMessage reqMsg = msgFactory.createMessage(null, new ByteArrayInputStream(reqEnv.getBytes()));

      URL epURL = new URL("http://" + getServerHost() + ":8080/jaxws-wsaddressing-replyto/ReplyToService");
      con.call(reqMsg, epURL);

      assertEquals("Mars Bar", replyto.getLastItem());
   }

   /** This sends a fault message to the FaultTo endpoint and verfies whether we can read it of again.
View Full Code Here

      MessageFactory msgFactory = MessageFactory.newInstance();
      SOAPConnection con = SOAPConnectionFactory.newInstance().createConnection();
      SOAPMessage reqMsg = msgFactory.createMessage(null, new ByteArrayInputStream(reqEnv.getBytes()));

      URL epURL = new URL("http://" + getServerHost() + ":8080/jaxws-wsaddressing-faultto/FaultToService");
      con.call(reqMsg, epURL);

      assertEquals("java.lang.IllegalArgumentException: Mars Bar", faultto.getLastFault());
   }

   public void testInital() throws Exception
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.