Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 62856 invoked from network); 8 Sep 2003 13:17:07 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 8 Sep 2003 13:17:07 -0000 Received: (qmail 66455 invoked by uid 500); 8 Sep 2003 13:16:32 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 66428 invoked by uid 500); 8 Sep 2003 13:16:31 -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: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 66415 invoked from network); 8 Sep 2003 13:16:31 -0000 Message-Id: <89539780CB9BD51182270002A5897DF605ECFAA1@hqempn04.agedwards.com> From: "Volkmann, Mark" To: "'axis-user@ws.apache.org'" Subject: message-style frustrations Date: Mon, 8 Sep 2003 08:15:18 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2655.55) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C3760B.4028CA5E" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C3760B.4028CA5E Content-Type: text/plain; charset="iso-8859-1" I'm trying to learn how to use message-style services in Axis. The documentation says that a message-style service can have any of the following method signatures. public Element [] method(Element [] bodies); public SOAPBodyElement [] method (SOAPBodyElement [] bodies); public Document method(Document body); public void method(SOAPEnvelope req, SOAPEnvelope resp); In the samples/message directory there is an example that demonstates using the first of these signatures. Oddly the client code (TestMsg.java) passes it SOAPBodyElement objects instead of org.w3c.dom.Element objects and it works anyway. Why is that? Based on my attempts to get all four signatures to work, it seems that each service class can only use ONE of these signatures. Can someone confirm that restriction? Also, I think there's a reason why the sample only demonstrates the first signature. I don't believe the others work! I'd love to be proven wrong on this with working examples that could be added to the samples directory. I'm mostly interested in getting the third signature (Document) to work. Here's a description of what I tried and the results. Without making any extra calls on the Call object before the call to the invoke method I get "No operation name specified!". That's odd because the sample doesn't specify an operation name for the first signature and it works. When I set the operation name on the Call object with call.setOperationName(myServiceMethodName) I get back a String instead of a Document. The value of the String is the value of the first Text node in the Document that the service returned, not the whole document. I decided to specify the parameter and return types on the Call object as Document using the following code. QName docQName = new QName("http://dom.w3c.org/Document", "Document"); call.addParameter("doc", docQName, Document.class, ParameterMode.IN); call.setReturnType(docQName, Document.class); This time I got a SAXException on the client side that said "could not find deserializer for type {http://dom.w3c.org/Document}Document". The part in the curly braces is the namespace I assigned to the parameter and return types. I'm real unsure about how I should have created that QName object. Next I explicitly set the operation style on the Call object to "message" with call.setOperationStyle("message"). This time I got back the correct data, but it was in a SOAPBodyElement object instead of a Document object. Please let me know if you have successfully used the Document signature for a message-style service and if possible send me an example. Thanks! ------------------------------------------------------------------------------------------ A.G. Edwards & Sons' outgoing and incoming e-mails are electronically archived and subject to review and/or disclosure to someone other than the recipient. ------------------------------------------------------------------------------------------ ------_=_NextPart_001_01C3760B.4028CA5E Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable message-style frustrations

I'm trying to learn how to use message-style services in = Axis.  The documentation says that a message-style service can have an= y of the following method signatures.

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

In the samples/message directory there is an example that= demonstates using the first of these signatures.  Oddly the client co= de (TestMsg.java) passes it SOAPBodyElement objects instead of org.w3c.dom.= Element objects and it works anyway.  Why is that?

Based on my attempts to get all four signatures to work, = it seems that each service class can only use ONE of these signatures. = ; Can someone confirm that restriction?

Also, I think there's a reason why the sample only demons= trates the first signature.  I don't believe the others work!  I'= d love to be proven wrong on this with working examples that could be added= to the samples directory.

I'm mostly interested in getting the third signature (Doc= ument) to work.  Here's a description of what I tried and the results.=

Without making any extra calls on the Call object before = the call to the invoke method I get "No operation name specified!"= ;.  That's odd because the sample doesn't specify an operation name fo= r the first signature and it works.

When I set the operation name on the Call object with cal= l.setOperationName(myServiceMethodName) I get back a String instead of a Do= cument.  The value of the String is the value of the first Text node i= n the Document that the service returned, not the whole document.

I decided to specify the parameter and return types on th= e Call object as Document using the following code.

QName docQName =3D new QName("http://dom.w3c.org/Document", = "Document");
call.addParameter("doc", docQName, Document.cl= ass, ParameterMode.IN);
call.setReturnType(docQName, Document.class);

This time I got a SAXException on the client side that sa= id "could not find deserializer for type {http://dom.w3c.org/Document}Document"= ;.  The part in the curly braces is the namespace I assigned to the pa= rameter and return types.  I'm real unsure about how I should have cre= ated that QName object.

Next I explicitly set the operation style on the Call obj= ect to "message" with call.setOperationStyle("message")= .  This time I got back the correct data, but it was in a SOAPBodyElem= ent object instead of a Document object.

Please let me know if you have successfully used the Docu= ment signature for a message-style service and if possible send me an examp= le.

Thanks!



---------------------------------------------------------------------------= ---------------
A.G. Edwards & Sons' outgoing and incoming e-mails are electronically
archived and subject to review and/or disclosure to someone other
than the recipient.

---------------------------------------------------------------------------= ---------------
------_=_NextPart_001_01C3760B.4028CA5E--