I'm pretty sure the ns1: part is just a different way of specifying the namespace of the KrakSoapHeader. In an XML context, if you ignore the <ticket> and <product> elements the two versions are identical.

Also, I'm wondering if it is possible to get Axis to send something without specifying the type... otherwise how will it serialise/deserialise it ??

stephen


Tommy Holm - TELMORE wrote:


I looked at the examples and I didn't get any further by reading that.
Whenever I set the header information AXIS creates an xml file that looks like this


<ns1:KrakSoapHeader soapenv:mustUnderstand="0"
xmlns:ns1="http://webservice.krak.dk/";>
         <ticket
xsi:type="xsd:string">B8E941091D413058FE9D8C153C6B3E49BD5639706EA19D4CEB
0D772E9CD385998A0C518B3A4F033AF542AFC3947A613638C3727D8FAB52E1ECD4DACBB3
ECDAA4DF4ACDBEB573B25CE097EDCC4A11BD72</ticket>
         <product xsi:type="xsd:string">iip-oph-formudfyl</product>
  </ns1:KrakSoapHeader>
I desperately need to avoid the xsi type of the ticket/product child
elements and if possible also avoid the ns1: part of the KrakSoapHeader
I just can't seem to get it working!
Cheers and thanks in advance"
Tommy



Tommy,


Check out org.apache.axis.handlers.SimpleSessionHandler. This handler creates SOAP headers and should give you an example to base your code

off of.



justin



At 07:08 AM 10/20/2003, you wrote:


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



____________________________________ Justin Ruthenbeck Software Engineer, NextEngine Inc. justinr - AT - nextengine DOT com Confidential See http://www.nextengine.com/confidentiality.php ____________________________________

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








Reply via email to