Sending a SOAP request to a Web Service via URLConnection

You may want to test you web service by sending it a manually composed request and reading the XML returned. Here’s how to do it (e.g. using BeanShell in jEdit): The SOAP request <?xml version=”1.0″ encoding=”utf-16″?> <soap:Envelope xmlns:soap=”http://schemas.xmlsoap.org/soap/envelope/&#8221; xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221; xmlns:xsd=”http://www.w3.org/2001/XMLSchema”&gt; <soap:Body> <getUserByEmail xmlns=”http://service.w3.ibm.com”&gt; <iuser>jholy@example.com</iuser> </getUserByEmail> </soap:Body> </soap:Envelope> The Java code String soapXml = // jEdit:Continue reading “Sending a SOAP request to a Web Service via URLConnection”