You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Aravi <cs...@yahoo.com> on 2010/09/16 13:25:59 UTC

Re: [Axis2] How Do I Set mustUnderstand="0"?

Use axis2 and override the method addHeader in your stub class as below

protected void addHeader(OMElement omElementToadd, SOAPEnvelope 
envelop, boolean mustUnderstand)
    {
        SOAPHeaderBlock soapHeaderBlock = 
envelop.getHeader().addHeaderBlock(omElementToadd.getLocalName(), 
omElementToadd.getNamespace());
 
        // Temporary Fix. 
        if(mustUnderstand) {
            soapHeaderBlock.setMustUnderstand(mustUnderstand);
        }
 
        OMNode omNode = null;
        for(Iterator iter = omElementToadd.getChildren(); iter.hasNext(); 
soapHeaderBlock.addChild(omNode))
            omNode = (OMNode)iter.next();
 
        OMAttribute omatribute = null;
        for(Iterator iter = omElementToadd.getAllAttributes(); 
iter.hasNext(); soapHeaderBlock.addAttribute(omatribute))
            omatribute = (OMAttribute)iter.next();
 
    }


westpine wrote:
> 
> Hi! I have a little bit similar problem. But I need mustUnderstand
> attribute to be vanished completely, not just set to "0". Because I have
> error "The request failed schema validation: The
> 'http://schemas.xmlsoap.org/soap/envelope/:mustUnderstand' attribute is
> not declared." Do you know how to do that? Thanks! 
> 

-- 
View this message in context: http://old.nabble.com/-Axis2--How-Do-I-Set-mustUnderstand%3D%220%22--tp13502520p29727373.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


RE: [Axis2] How Do I Set mustUnderstand="0"?

Posted by Martin Gainty <mg...@hotmail.com>.
i would do the assignment before referecning the entity in the step e.g.

        for (Iterator iter = omElementToadd.getChildren(); iter.hasNext();){
             omNode = (OMNode) iter.next();                          /* do the assignment of omNode first */
             soapHeaderBlock.addChild(omNode);
        }
        OMAttribute omatribute = null;
        // add attributes
        for (Iterator iter = omElementToadd.getAllAttributes(); iter.hasNext();){
             omatribute = (OMAttribute) iter.next();            /*do the assignment of omatribute first */
             soapHeaderBlock.addAttribute(omatribute);
        }

Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.



 

> Date: Thu, 16 Sep 2010 04:25:59 -0700
> From: csaravindh@yahoo.com
> To: axis-user@ws.apache.org
> Subject: Re: [Axis2] How Do I Set mustUnderstand="0"?
> 
> 
> Use axis2 and override the method addHeader in your stub class as below
> 
> protected void addHeader(OMElement omElementToadd, SOAPEnvelope 
> envelop, boolean mustUnderstand)
> {
> SOAPHeaderBlock soapHeaderBlock = 
> envelop.getHeader().addHeaderBlock(omElementToadd.getLocalName(), 
> omElementToadd.getNamespace());
> 
> // Temporary Fix. 
> if(mustUnderstand) {
> soapHeaderBlock.setMustUnderstand(mustUnderstand);
> }
> 
> OMNode omNode = null;
> for(Iterator iter = omElementToadd.getChildren(); iter.hasNext(); 
> soapHeaderBlock.addChild(omNode))
> omNode = (OMNode)iter.next();
> 
> OMAttribute omatribute = null;
> for(Iterator iter = omElementToadd.getAllAttributes(); 
> iter.hasNext(); soapHeaderBlock.addAttribute(omatribute))
> omatribute = (OMAttribute)iter.next();
> 
> }
> 
> 
> westpine wrote:
> > 
> > Hi! I have a little bit similar problem. But I need mustUnderstand
> > attribute to be vanished completely, not just set to "0". Because I have
> > error "The request failed schema validation: The
> > 'http://schemas.xmlsoap.org/soap/envelope/:mustUnderstand' attribute is
> > not declared." Do you know how to do that? Thanks! 
> > 
> 
> -- 
> View this message in context: http://old.nabble.com/-Axis2--How-Do-I-Set-mustUnderstand%3D%220%22--tp13502520p29727373.html
> Sent from the Axis - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>