axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark <mark...@yahoo.com>
Subject RE: Reconstructing a SOAP reply -- Plsss help
Date Mon, 08 Dec 2003 03:44:54 GMT
Hi Chris, 
Thanks again for your help, but obviously I am missing somehting. Here is the code from PRCProvider
which deals with the return values. Now if the return value which i want to send is in an
integer variable returnInt, how do I send it back? I will want to do the same with out parameters
as well..I really appreciate your help in this, I have tried quite a few  things but nothing
seem to be working..
 
thanks
Mark
 
                QName qname1 = operationdesc.getReturnQName();
                if(qname1 == null)
                    qname1 = new QName(rpcelement.getNamespaceURI(), s + "Return");
                RPCParam rpcparam2 = new RPCParam(qname1, obj3);
                rpcparam2.setParamDesc(operationdesc.getReturnParamDesc());
                if(!operationdesc.isReturnHeader())
                {
                    if(messagecontext.getSOAPConstants() == SOAPConstants.SOAP12_CONSTANTS
&& servicedesc.getStyle().equals(Style.RPC))
                    {
                  RPCParam rpcparam4 = new RPCParam( Constants.QNAME_RPC_RESULT, qname1);
                        rpcparam4.setXSITypeGeneration(Boolean.FALSE);
                        rpcelement1.addParam(rpcparam4);
                 }
                    rpcelement1.addParam(rpcparam2);
                }
                else
                {
                    soapenvelope1.addHeader(new RPCHeaderParam(rpcparam2));
                }


chris <chris.haddad@cobia.net> wrote:

Obj3 represents the return value from the actual ‘service agent’ performing the work…. If
you have a return value after executing the code or component performing the real work, you
simply need to stuff the return value into the envelope as XML.  There are two approaches:

 

The MsgProvider just attaches SOAPBody elements to a SOAPEnvelope..….   

 

 

In the RPCProvider use case, note that RPCElement is added to the SOAPEnvelope.  The embedded
RPCParam objects hold the return values. RPCParam contains a serialize() method detailing
how to take an object and generate XML.  **Of course, the correct type mappings have to be
defined in WSDD if you are not using built-in types *** 

 

/Chris

 

 

 

-----Original Message-----
From: Mark [mailto:mark_ai@yahoo.com] 
Sent: Friday, December 05, 2003 2:31 PM
To: axis-user@ws.apache.org
Subject: RE: Reconstructing a SOAP reply -- Plsss help

 

Chris, Thanks a lot for your reply, I had a look at the RPCprovider. a call is made to invokemethod
which returns obj3. This obj3 is used to construct the soap msg. But in my case I dont call
invokemethod and I have the return value. So how do I construct the object (obj3) ?


 


obj3 = invokeMethod(messagecontext, operationdesc.getMethod(), obj, aobj);

chris <chris.haddad@cobia.net> wrote:


Mark -  Look at the existing providers in org.apache.axis.providers to see how they craft
the response message.  processMessage() in MsgProvider.java and the code after the /* Now
put the result in the result SOAPEnvelope */ comment in RPCProvider.java

        

 

/Chris

http://cvs.apache.org/~haddadc

 

 

 

-----Original Message-----
From: Mark [mailto:mark_ai@yahoo.com] 
Sent: Friday, December 05, 2003 12:40 PM
To: axis-user@ws.apache.org
Subject: Reconstructing a SOAP reply -- Plsss help

 

Can some one pls help me with this...any help would greatly be appreciated..

Hi


I have a SOAP client which uses my own provider. In the provider I call another method - not
through the method.invoke but through other means. But I want to send the reply through a
SOAP msg. So is there a way for me to add the return value into the SOAP msg and reconstruct
the SOAP reply msg? Can I use messageContext for that? Can someon pls point me to code samples?


 


 


 


thanks


Mark


---------------------------------



Do you Yahoo!?
Free Pop-Up Blocker - Get it now


---------------------------------



Do you Yahoo!?
Free Pop-Up Blocker - Get it now

---------------------------------


Do you Yahoo!?
Free Pop-Up Blocker - Get it now



---------------------------------
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing


---------------------------------
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing
Mime
View raw message