Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 87087 invoked from network); 3 Jan 2008 19:15:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Jan 2008 19:15:32 -0000 Received: (qmail 80924 invoked by uid 500); 3 Jan 2008 19:15:11 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 80908 invoked by uid 500); 3 Jan 2008 19:15:11 -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: List-Id: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 80897 invoked by uid 99); 3 Jan 2008 19:15:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jan 2008 11:15:11 -0800 X-ASF-Spam-Status: No, hits=3.2 required=10.0 tests=HTML_MESSAGE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [142.73.64.14] (HELO MSXYVR1.ds.mda.ca) (142.73.64.14) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jan 2008 19:14:48 +0000 Received: from VMXYVR2.ds.mda.ca ([142.73.129.71]) by MSXYVR1.ds.mda.ca with Microsoft SMTPSVC(6.0.3790.3959); Thu, 3 Jan 2008 11:14:49 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C84E3C.E8F7EFF4" Subject: [Axis2] Changes to WSDL2Java generated MessageReceiverInOut class Date: Thu, 3 Jan 2008 11:14:13 -0800 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [Axis2] Changes to WSDL2Java generated MessageReceiverInOut class Thread-Index: AchOPNPMo6OkZTjOT2SxoqWV6rCJPQ== From: "Alastair FETTES" To: X-OriginalArrivalTime: 03 Jan 2008 19:14:49.0896 (UTC) FILETIME=[E9495280:01C84E3C] X-Virus-Checked: Checked by ClamAV on apache.org ------_=_NextPart_001_01C84E3C.E8F7EFF4 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Apache Axis2 Team: During our work with Apache Axis2 version 1.3 we have run into a deficiency in the generated output from WSDL2Java in the form of the MessageReceiverInOut class. The problem lies in the order of operations. In the generated MessageReceiverInOut.java class, the out message context does not have a valid SOAP envelope when the message handler in the application supplied skeleton interface is called. Therefore, the message handler cannot populate the contents of the out message SOAP header. To solve the problem the out message SOAP envelope must be created prior to calling the skeleton interface message handler. Current implementation: if((op.getName() !=3D null) && ((methodName =3D org.apache.axis2.util.JavaUtils.xmlNameToJava(op.getName() .getLocalPart())) !=3D null)) { if("MessageName".equals(methodName)) { com.foo.messages.MessageNameResponseDocument messageNameResponse170 =3D null; com.foo.messages.MessageNameRequestDocument wrappedParam =3D (com.foo.messages.MessageNameRequestDocument) fromOM( msgContext.getEnvelope().getBody() .getFirstElement(), com.foo.messages.MessageNameRequestDocument.class, getEnvelopeNamespaces(msgContext.getEnvelope())); messageNameResponse170 =3D skel.MessageName(wrappedParam); envelope =3D toEnvelope(getSOAPFactory(msgContext), messageNameResponse170, false); } else { throw new java.lang.RuntimeException("method not found"); } newMsgContext.setEnvelope(envelope); } Possible solution: if((op.getName() !=3D null) && ((methodName =3D org.apache.axis2.util.JavaUtils.xmlNameToJava(op.getName() .getLocalPart())) !=3D null)) { if("MessageName".equals(methodName)) { com.foo.messages.MessageNameResponseDocument messageNameResponse170 =3D null; com.foo.messages.MessageNameRequestDocument wrappedParam =3D (com.foo.messages.MessageNameRequestDocument) fromOM( msgContext.getEnvelope().getBody() .getFirstElement(), com.foo.messages.MessageNameRequestDocument.class, getEnvelopeNamespaces(msgContext.getEnvelope())); /* * Changes begin here */ // Create the envelope and associate it with the message context // BEFORE the operation call envelope =3D getSOAPFactory(msgContext).getDefaultEnvelope(); newMsgContext.setEnvelope(envelope); // operation call as normal messageNameResponse170 =3D skel.MessageName(wrappedParam); //=20 if (messageNameResponse170 !=3D null) { envelope.getBody().addChild(toOM(messageNameResponse170, false)); } /* * Changes end here */ } else { throw new java.lang.RuntimeException("method not found"); } newMsgContext.setEnvelope(envelope); } The solution splits the functionality of the toEnvelope function into two separate calls on either side of the operation call. This allows the operation to have access to the envelope and thus add custom SOAP headers as appropriate. Once again, thanks very much for your time and efforts on this project. Sincerely, Alastair Fettes This e-mail and any attachments are intended solely for the use of the intended recipient(s) and may contain legally privileged, proprietary and/or confidential information. Any use, disclosure, dissemination, distribution or copying of this e-mail and any attachments for any purposes that have not been specifically authorized by the sender is strictly prohibited. If you are not the intended recipient, please immediately notify the sender by reply e-mail and permanently delete all copies and attachments. The entire content of this e-mail is for "information purposes" only and should not be relied upon by the recipient in any way unless otherwise confirmed in writing by way of letter or facsimile.=20 ------_=_NextPart_001_01C84E3C.E8F7EFF4 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable [Axis2] Changes to WSDL2Java generated MessageReceiverInOut = class

Apache Axis2 Team:

During our work with Apache Axis2 = version 1.3 we have run into a deficiency in the generated output from = WSDL2Java in the form of the MessageReceiverInOut class.  The = problem lies in the order of operations.

In the generated = MessageReceiverInOut.java class, the out message context does not have a = valid SOAP envelope when the message handler in the application supplied = skeleton interface is called. Therefore, the message handler cannot = populate the contents of the out message SOAP header. To solve the = problem the out message SOAP envelope must be created prior to calling = the skeleton interface message handler.

Current implementation:

<snippet>
if((op.getName() !=3D null)
    && = ((methodName =3D
        = org.apache.axis2.util.JavaUtils.xmlNameToJava(op.getName()
         &n= bsp;  .getLocalPart())) !=3D null))
{
    = if("MessageName".equals(methodName))
    {
        = com.foo.messages.MessageNameResponseDocument messageNameResponse170 = =3D
         &n= bsp;  null;
        = com.foo.messages.MessageNameRequestDocument wrappedParam =3D
         &n= bsp;  (com.foo.messages.MessageNameRequestDocument) fromOM(
         &n= bsp;      = msgContext.getEnvelope().getBody()
         &n= bsp;          = .getFirstElement(),
         &n= bsp;      = com.foo.messages.MessageNameRequestDocument.class,
         &n= bsp;      = getEnvelopeNamespaces(msgContext.getEnvelope()));

        = messageNameResponse170 =3D skel.MessageName(wrappedParam);

        envelope =3D = toEnvelope(getSOAPFactory(msgContext),
         &n= bsp;      messageNameResponse170, = false);
    }
    else
    {
        throw new = java.lang.RuntimeException("method not found");
    }

    = newMsgContext.setEnvelope(envelope);
}
</snippet>

Possible solution:

<snippet>
if((op.getName() !=3D null)
    && = ((methodName =3D
        = org.apache.axis2.util.JavaUtils.xmlNameToJava(op.getName()
         &n= bsp;  .getLocalPart())) !=3D null))
{
    = if("MessageName".equals(methodName))
    {
        = com.foo.messages.MessageNameResponseDocument messageNameResponse170 = =3D
         &n= bsp;  null;
        = com.foo.messages.MessageNameRequestDocument wrappedParam =3D
         &n= bsp;  (com.foo.messages.MessageNameRequestDocument) fromOM(
         &n= bsp;      = msgContext.getEnvelope().getBody()
         &n= bsp;          = .getFirstElement(),
         &n= bsp;      = com.foo.messages.MessageNameRequestDocument.class,
         &n= bsp;      = getEnvelopeNamespaces(msgContext.getEnvelope()));

        /*
         * = Changes begin here
         = */

        // Create = the envelope and associate it with the message context
        // BEFORE = the operation call
        envelope =3D = getSOAPFactory(msgContext).getDefaultEnvelope();
        = newMsgContext.setEnvelope(envelope);

        // operation = call as normal
        = messageNameResponse170 =3D skel.MessageName(wrappedParam);

        //
        if = (messageNameResponse170 !=3D null)
        {
         &n= bsp;  envelope.getBody().addChild(toOM(messageNameResponse170, = false));
        }

        /*
         * = Changes end here
         = */
    }
    else
    {
        throw new = java.lang.RuntimeException("method not found");
    }

    = newMsgContext.setEnvelope(envelope);
}
</snippet>

The solution splits the functionality = of the toEnvelope function into two separate calls on either side of the = operation call.  This allows the operation to have access to the = envelope and thus add custom SOAP headers as appropriate.

Once again, thanks very much for your = time and efforts on this project.

Sincerely,

Alastair Fettes

This e-mail and any attachments are = intended solely for the use of the intended recipient(s) and may contain = legally privileged, proprietary and/or confidential information.  = Any use, disclosure, dissemination, distribution or copying of this = e-mail and any attachments for any purposes that have not been = specifically authorized by the sender is strictly prohibited.  If = you are not the intended recipient, please immediately notify the sender = by reply e-mail and permanently delete all copies and = attachments.

The entire content of this e-mail is = for "information purposes" only and should not be relied upon = by the recipient in any way unless otherwise confirmed in writing by way = of letter or facsimile.

------_=_NextPart_001_01C84E3C.E8F7EFF4--