You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by Adrian Pang <ap...@earthconnect.com> on 2001/07/18 23:31:04 UTC

Help on header complex type

Hi,


I have a web service that returns a rather complex type in the header:

- <SOAP-ENV:Header>
- <types:AuthenticationHeader
xmlns:types="http://marketdata.net/encodedTypes">
  <Key xsi:type="xsd:string">44844E</Key> 
  <Type xsi:type="xsd:string">TokenType</Type> 
  </types:AuthenticationHeader>
  </SOAP-ENV:Header>

I tried to get the response, using:

  Header respHeader = resp.getHeader();
  Object r = resp.getHeader();
  System.out.println(r.toString());

  if (respHeader!=null)
		{
			Vector e = respHeader.getHeaderEntries();
			Object d = e.lastElement() ;
			System.out.println(e.toString());
			System.out.println(d.toString());
			QName Token = new QName("" , "HeaderEntries");
			String TokenValue =
respHeader.getAttribute(Token);
			System.out.println(TokenValue);
	    }

I get:

[Header=[Attributes={}] [HeaderEntries={[[types:AuthenticationHeader:
null]]}]]
[methodName=LoginUser] [targetObjectURI=http://logon.earthconnect.net/]
[encodin
gStyleURI=null] [SOAPContext=[Parts={[cid:null type: text/xml;
charset=utf-8 enc
: null]}]] [return=null]
[Params={}]
[Attributes={}] [HeaderEntries={[[types:AuthenticationHeader: null]]}]
[[types:AuthenticationHeader: null]]
[types:AuthenticationHeader: null]
null

So, I get null instead of the Key and Type values.  It seems that the
complex type, AuthenticationHeader, is ignored and discarded.  Is there
any way I can get to the values?  Is there any way I can put these
values back into a soap envelope when I make a call later?  Thanks!

Adrian