Hi!

If passing "true" solves your problem and you're sure that actors will not be involved in any way, then stick to it.
If you want to program defensively, you could still do something like the following:


org.apache.axis.message.SOAPHeaderElement header;
header = env.getHeaderByName(namespace, localPart, true);
if (header != null)
{
   if ((header.getActor() == null) ||
       (header.getActor.equals("")))
   {
      //The header has no actor.
   }
   else
   {
      //The header has an actor (attribute). Act according to that.
   }
}

Just to get sure.
If at some day actors get relevant for you, you could maybe start with the following:
http://www.w3.org/TR/soap11/#_Toc478383499


Maybe the above link can then also help to understand the strange comment for the method
public java.util.Enumeration
getHeadersByName(java.lang.String namespace,
java.lang.String localPart,
boolean accessAllHeaders)
throws AxisFault


in the Axis API for org.apache.axis.message.SOAPEnvelope
(Watch out: it's getHeader_s_ByName)

Hope it helps,
Christoph

PS: I'm talking about Axis 1.1

PILLAI,RANJITH (HP-PaloAlto,ex1) wrote:

Hi Tratter,
Thanks for your reply..
Yes when I invoked getHeaderByName passing argument "true" worked when I
ported to another system. Though I don't have any actors defined, first API worked in one system, but
when I ported the same service to another system, first API didn't work, but
second API worked passing argument "true".


I am trying to understand its difference.. why first API worked in one
system and not in other? So are you suggesting to use second API passing
"true" always if I don't have any Actors defined?

Thanks again,
Ranjith Pillai.





Reply via email to