Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 70980 invoked from network); 13 Nov 2009 17:49:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 Nov 2009 17:49:15 -0000 Received: (qmail 83300 invoked by uid 500); 13 Nov 2009 17:49:13 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 83206 invoked by uid 500); 13 Nov 2009 17:49:13 -0000 Mailing-List: contact axis-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 83197 invoked by uid 99); 13 Nov 2009 17:49:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Nov 2009 17:49:13 +0000 X-ASF-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [212.240.172.234] (HELO mailgate.his.co.uk) (212.240.172.234) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Nov 2009 17:49:10 +0000 Received: from jupiter.local ([192.168.0.45] helo=JUPITER) by mailgate.his.co.uk with esmtp (Exim 4.67) (envelope-from ) id 1N9028-0005rU-Jj for axis-user@ws.apache.org; Fri, 13 Nov 2009 17:34:04 +0000 From: "John Francis" To: References: <4AF95F1C.8060402@gmail.com> <4AF95FF4.9020706@gmail.com> <4AF97A08.5000808@gmail.com> <003d01ca645e$b44821d0$1cd86570$@co.uk> In-Reply-To: <003d01ca645e$b44821d0$1cd86570$@co.uk> Subject: RE: XML to SOAP without binding to Java Objects Date: Fri, 13 Nov 2009 17:48:46 -0000 Message-ID: <007401ca6489$8f80f1d0$ae82d570$@co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcpiEQTrD0tQJKbaSwmn6wM45ZSIXAACWt4gAJC6kHAACqoiMA== Content-Language: en-gb x-cr-hashedpuzzle: BBIx CkgT Cl72 DWmE DkfM Dy6W EKFM Hgzr JEf8 JTXe JaK1 JabI KHHK Ky9B LYsh LvKG;1;YQB4AGkAcwAtAHUAcwBlAHIAQAB3AHMALgBhAHAAYQBjAGgAZQAuAG8AcgBnAA==;Sosha1_v1;7;{2EA1AA5B-1959-4685-915D-817F6D3E9647};agBmAHIAYQBuAGMAaQBzAEAAaABpAHMALgBjAG8ALgB1AGsA;Fri, 13 Nov 2009 17:48:26 GMT;UgBFADoAIABYAE0ATAAgAHQAbwAgAFMATwBBAFAAIAB3AGkAdABoAG8AdQB0ACAAYgBpAG4AZABpAG4AZwAgAHQAbwAgAEoAYQB2AGEAIABPAGIAagBlAGMAdABzAA== x-cr-puzzleid: {2EA1AA5B-1959-4685-915D-817F6D3E9647} X-HISL-UNQUALIFIED-HOSTNAME: yes The following appears to work using JAX-WS from the JDK package dispatchClient; import java.io.ByteArrayOutputStream; import java.io.File; import java.net.URL; import javax.xml.namespace.QName; import javax.xml.transform.Source; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamSource; import javax.xml.ws.Dispatch; import javax.xml.ws.Service; public class DispatchXMLClient { public static void main(String[] args) { try { URL wsdlURL = new URL("myService.wsdl"); Service service = Service.create(wsdlURL, new QName("http://mySite.com/ws/service1", "ServiceName")); Dispatch disp = service.createDispatch(new QName("http://mySite.com/ws/service1", "ServicePort"), Source.class, Service.Mode.PAYLOAD); Source request = new StreamSource(new File("Project1/resources/WSEtestData/Service1Body.txt")); Source response = disp.invoke(request); // Process the response. StreamResult result = new StreamResult(new ByteArrayOutputStream()); Transformer trans = TransformerFactory.newInstance().newTransformer(); trans.transform(response, result); ByteArrayOutputStream baos = (ByteArrayOutputStream) result.getOutputStream(); // Write out the response content. String responseContent = new String(baos.toByteArray()); System.out.println(responseContent); } catch (Throwable t) { System.err.println("Unexpected exception: " + t); t.printStackTrace(); } } } The message to stream in will be the body of the SOAP message, it is best to put it in its own namespace; Stuff Ofcourse it could be implemented using pure sockets, or an HttpURLConnection or commons HttpClient, but then you'd need to make sure you get all the headers right and the SOAP envelope. Not sure what the overhead is... ---------------------------------------------------------------------------- -------------- This message is private and confidential. If you have received this message in error, please notify postmaster@his.co.uk and remove it from your system. Please carry out your own virus check before opening attachments. HISL Limited is a limited company registered in England and Wales. Registered Number: 3202995. VAT number: 729-6256-05. Registered Office: Chestnut Farm, Jill Lane, Sambourne, Redditch B96 6ES ---------------------------------------------------------------------------- --------------