Return-Path: Mailing-List: contact soap-dev-help@xml.apache.org; run by ezmlm Delivered-To: mailing list soap-dev@xml.apache.org Delivered-To: moderator for soap-dev@xml.apache.org Received: (qmail 82503 invoked from network); 12 Mar 2002 19:03:55 -0000 Received: from e31.co.us.ibm.com (32.97.110.129) by daedalus.apache.org with SMTP; 12 Mar 2002 19:03:55 -0000 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.194.23]) by e31.co.us.ibm.com (8.9.3/8.9.3) with ESMTP id OAA68262; Tue, 12 Mar 2002 14:00:39 -0500 Received: from d03nm015.boulder.ibm.com (d03nm015.boulder.ibm.com [9.17.194.14]) by westrelay02.boulder.ibm.com (8.11.1m3/NCO/VER6.00) with ESMTP id g2CJ3uH61290; Tue, 12 Mar 2002 12:03:56 -0700 Subject: RE: soap messaging XML ??? To: Shashi Anand , soap-dev@xml.apache.org X-Mailer: Lotus Notes Release 5.0.7 March 21, 2001 Message-ID: From: "Ashutosh Arora" Date: Tue, 12 Mar 2002 11:03:55 -0800 X-MIMETrack: Serialize by Router on D03NM015/03/M/IBM(Release 5.0.9a |January 7, 2002) at 03/12/2002 12:03:56 PM MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N soapURI gives the URI of the target Web Service. It may be url of messagerouter servlet, if your service is deployed in Apache. Shashi Anand cc: Subject: RE: soap messaging XML ??? 03/11/02 08:49 PM sorry for writting off-list. In following code where is the soapURI variable used. probably you missed out or something. I hope soapURL is just url of messagerouter servlet. Shashi Anand Senior Software Engineer Infogain India B 15 Sec 58, NOida, UP 201301, India -----Original Message----- From: Ashutosh_Arora/Boulder/IBM%IBMUS [mailto:Ashutosh_Arora/Boulder/IBM@us.ibm.com] Sent: Tuesday, March 12, 2002 12:32 AM To: Shashi Anand Subject: RE: soap messaging XML ??? SOAP method name is the name of the first element you create in the body. I mean first element of bodyEntries vector below. Now to set the URI see the following code: String soapURI = "www.mywebservice.com/Exchange" Message msg = new Message(); msg.send(soapURL, "", msgEnv); SOAPTransport st = msg.getSOAPTransport(); if(st == null) throw new IOException("Error: Cannot get SOAP transport."); BufferedReader br = st.receive(); Hope it helps. Thanks. -Ashutosh Shashi Anand cc: Ashutosh.Arora@crossworlds.com Subject: RE: soap messaging XML ??? 03/11/02 07:00 AM Hi Ashutosh, Thanks for the code snippet. I have one question. How do I add the target uri and the soap method name in the code below? Can this be done through Apache SOAP API itself or Is the myEl added to bodyEntries supposed to have method name in it? + Shashi Anand ( Senior Software Engineer 8 Infogain India O B 15 Sec 58, NOida, UP 201301, India -----Original Message----- From: Ashutosh Arora [mailto:Ashutosh.Arora@crossworlds.com] Sent: Saturday, March 09, 2002 1:10 AM To: 'soap-dev@xml.apache.org'; 'soap-user@xml.apache.org'; 'SOAP@DISCUSS.DEVELOP.COM' Subject: RE: soap messaging XML ??? Shashi, Apache SOAP message can be built using Apache SOAP API. You need not read them from file. Developers did a great job with Apache SOAP APIs. It provides great support and utilities for that. Following code snippet will walk u thru: // Create document DocumentBuilder xdb = XMLParserUtils.getXMLDocBuilder(); Document doc = xdb.newDocument(); // Create SOAP envelope Envelope msgEnv = new Envelope(); Body msgBody = new Body(); Vector bodyEntries = new Vector(); // In bodyEntries add DOM Element object to your body. Or you can add java objects with pre-registered serializer/deserializer. // Following shows how to add DOM element Element myEl = doc.createElement("myelement); bodyEntries.addElement(myEl); msgBody.setBodyEntries(bodyEntries); // Set body msgEnv.setBody(msgBody); String strWriter; msgEnv.setAttribute(new QName(Constants.NS_URI_SOAP_ENV, // SOAP encoding Constants.ATTR_ENCODING_STYLE), Constants.NS_URI_SOAP_ENC); msgEnv.marshall(strWriter, new XMLJavaMappingRegistry(), new SOAPContext()); String xmlMsg = strWriter.toString(); Hope this code snippet helps. Thanks -Ashutosh. -----Original Message----- From: Shashi Anand [mailto:Shashia@india.infogain.com] Sent: Friday, March 08, 2002 2:14 AM To: SOAP@DISCUSS.DEVELOP.COM; soap-dev@xml.apache.org; soap-user@xml.apache.org Subject: soap messaging XML ??? Hi, One strange thing I noticed is that all the tutorials explaining the SOAP messaging assume whole SOAP message to be readilly available in XML file, where as this is not the case. None of tutorials explain how to form this SOAP message given the XML which is only part of message body. Does somebody have any idea on how to form the SOAP message using API. + Shashi Anand ( Senior Software Engineer 8 Infogain India O B 15 Sec 58, NOida, UP 201301, India