If you read the Axis User's Guide, you’ll find the following description:

……………………………………………………………………………………………..

Message services

Finally, we arrive at "Message" style services, which should be used when you want Axis to step back and let your code at the actual XML instead of turning it into Java objects. There are four valid signatures for your message-style service methods:

public Element [] method(Element [] bodies);
public SOAPBodyElement [] method (SOAPBodyElement [] bodies);
public Document method(Document body);
public void method(SOAPEnvelope req, SOAPEnvelope resp);

…………………………………………………………………………………………………………………………….

What I am interested in here is trying to invoke the third signature (valid, isn’t it?) by passing a Document object. Is there a way to do so? Thanks a lot for your help.

Hui Xiao

 

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent:
Thursday, January 29, 2004 1:12 AM
To: [EMAIL PROTECTED]
Subject: RE: How to invoke "Message" style services passing a DOM Document

 

Hi

I am using a Messaging style service.

Following is the code.

Not sure whether ur looking for the same kind of thing.

 

  String url = "" href="http://localhost:5555/soap/servlet/messagerouter">http://localhost:5555/soap/servlet/messagerouter";
DocumentBuilder xdb = XMLParserUtils.getXMLDocBuilder();
   Document doc = xdb.parse (new InputSource ("file:///" + file.getAbsolutePath()));

Envelope msgEnv = Envelope.unmarshall (doc.getDocumentElement ());
   Message msg = new Message ();
   msg.send (new URL (url), "", msgEnv);
   SOAPTransport st = msg.getSOAPTransport ();

   BufferedReader br = st.receive ();

thanks and regards
hanmayya udgiri 
 

 -----Original Message-----
From: Xiao, Hui [mailto:[EMAIL PROTECTED]
Sent:
Wednesday, January 28, 2004 11:56 PM
To: [EMAIL PROTECTED]
Cc: Xiao, Hui; Currier, Jeff
Subject: How to invoke "Message" style services passing a DOM Document

Dear experts,

 

I am trying to invoke the modified MessageService (see below) using

 

     call.invoke(mydoc);

 

where mydoc is of Document type. However, I got a compilation error because the above signature doesn’t exist in the org.apache.axis.client.Call definition. 
 
Is there anybody who knows how to invoke my service passing a DOM Document object? Thanks a lot,
 
Hui Xiao

 

 

package samples.message ;

 

import org.w3c.dom.Document;

 

/**

 * Simple message-style service sample.

 */

public class MessageService {

    /**

     * Service method, which simply echoes back any XML it receives.

     *

     * @param elems an array of DOM Elements, one for each SOAP body element

     * @return an array of DOM Elements to be sent in the response body

     */

    public Document echoElements(Document doc) {

        return doc;

    }

}

 

Confidentiality Notice


The information contained in this electronic message and any attachments to this message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately
and destroy all copies of this message and any attachments.

Reply via email to