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 Tommy Holm - TELMORE <to...@telmore.dk> on 2003/10/20 16:08:16 UTC

How to set the following header information

Hi 
I am working on a small project where I need to call a .net webservice.
I have succesfully used the WSDL2 java. The webservice provider requires
me to give authentication information as a soap header.
I just can't seem to get the soap header stuff working. If they turn of
the SOAP header authentication everything works fine.
How do I set the soap headers.

The provider expects the following XML(The request)

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<soap:Header>
		<KrakSoapHeader xmlns="http://webservice.krak.dk/">
			<ticket>43653454XFGHDSGHSF</ticket>
			<product>iip-oph-formudfyl</product>
		</KrakSoapHeader>
	</soap:Header>
	<soap:Body>
		<GetTeleByTn xmlns="http://webservice.krak.dk/">
			<telephoneNumber>45956500</telephoneNumber>
		</GetTeleByTn>
	</soap:Body>
</soap:Envelope>

I get the stub like this 
TeleSearchSoap stub = searchservice.getTeleSearchSoap();
How do I set a soap header for 
<soap:Header>
		<KrakSoapHeader xmlns="http://webservice.krak.dk/">
			<ticket>43653454XFGHDSGHSF</ticket>
			<product>iip-oph-formudfyl</product>
		</KrakSoapHeader>
	</soap:Header>

I would be very happy if someone could help me!
Thanks



Tommy Holm, Developer
TELMORE A/S
Carl Gustavsgade 3, 2630 Taastrup
Telefon 70218700, Mobil 22582344
www.telmore.dk