Hi,
Thanks for your answers ... which, unfortunately, don't work. But I found a
solution.
For me, it seems to be a bug but, as I don't really know why it works...
The key is to access MessageContext's envelope not in the skeleton but in the
beginning of the MessageReceiverInOut and give it to the skeleton :
public void invokeBusinessLogic(org.apache.axis2.context.MessageContext
msgContext, org.apache.axis2.context.MessageContext newMsgContext)
throws org.apache.axis2.AxisFault{
try {
String fluxXML = msgContext.getEnvelope().toString();
// get the implementation class for the Web Service
Object obj = getTheImplementationObject(msgContext);
ECCMAServiceCondamnation10Skeleton skel =
(ECCMAServiceCondamnation10Skeleton)obj;
//Out Envelop
org.apache.axiom.soap.SOAPEnvelope envelope = null;
//Find the axisOperation that has been set by the Dispatch phase.
org.apache.axis2.description.AxisOperation op =
msgContext.getOperationContext().getAxisOperation();
if (op == null) {
throw new org.apache.axis2.AxisFault("Operation is not located, if this is
doclit style the SOAP-ACTION should specified via the SOAP Action to use the
RawXMLProvider");
}
java.lang.String methodName;
if(op.getName() != null & (methodName = op.getName().getLocalPart()) != null){
if("remettreCondamnations".equals(methodName)){
testWS.RemettreCondamnationsReponse param11 = null;
//doc style
testWS.RemettreCondamnations wrappedParam =
(testWS.RemettreCondamnations)fromOM(
msgContext.getEnvelope().getBody().getFirstElement(),
testWS.RemettreCondamnations.class,
getEnvelopeNamespaces(msgContext.getEnvelope()));
param11 = skel.remettreCondamnations(wrappedParam, fluxXML) ;
envelope = toEnvelope(getSOAPFactory(msgContext), param11, false);
}
And now I've got the full XML request to work with !
John
Davanum Srinivas <[EMAIL PROTECTED]> a écrit :
Date: Fri, 8 Dec 2006 13:46:39 -0500
De: "Davanum Srinivas" <[EMAIL PROTECTED]>
À: [email protected]
Objet: Re: [Axis2 v1.1] How can I get full XML from SOAP Request ?
See if it helps if you call contexteMessage.getEnvelope().build()
before you print it.
-- dims
On 12/8/06, John DeeBee wrote:
>
> Hi,
>
> I'm working on server-side from Axis2 v1.1 and I need to get the whole XML
> request in my WS skeleton (and after) to make other XML parsing and to log
> every message going in and out from my webapp.
> In Axis2 v1.0, I wrote a method called setOperationContext() in my skeleton
> which retireved the full XML request by using
> "messageContext.getEnveloppe().toString()".
> But now I'm working with v1.1 and it doesn't work anymore. So I delete my
> setOperationContext() method and, in my WS operation, I write this code to
> replace :
>
> MessageContext contexteMessage =
> MessageContext.getCurrentMessageContext();
> setFluxXML(contexteMessage.getEnvelope().toString());
>
> But "contexteMessage.getEnvelope().toString()" gives me only the beginning
> and the end of the request, not the full content.
> I tried to make a logging module as described in documentation but the
> result is the quite the same. I have the full xml from WS response but not
> for request.
> Who have a solution before I getting mad ?
>
> John
> ________________________________
> Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions
> ! Profitez des connaissances, des opinions et des expériences des
> internautes sur Yahoo! Questions/Réponses.
--
Davanum Srinivas : http://www.wso2.net (Oxygen for Web Service Developers)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------
Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son
interface révolutionnaire.