Hi,
I'm trying to upgrade Axis 1.0 to 1.2.1. I'm using Tomcat 5.5.9 and JRE
1.4.2. There seems to be a problem when using the SOAPHeaderElement class.
An empty namespace value is added and invalidates the message. This problem
almost looks like
the http://issues.apache.org/jira/browse/AXIS-1807 report, which should have
been resolved by now. Except the problem there was for the SOAPBodyElement.
//I generate the XML-document and everything looks fine when printing like
this:
EventLog.info("SOAP HEADER: " + XMLUtils.ElementToString(headerEl));
//But, when creating the SOAPHeaderElement and printing:
SOAPHeaderElement soapHeader = new SOAPHeaderElement(headerEl);
EventLog.info("SOAP HEADER: " + soapHeader.getAsString());
...Axis has added an empty namespace. Example below, first for
Axis 1.0 (everything is ok), and than for Axis 1.2.1 (error!).
AXIS 1.0 - OK
===============
//I show the complete Envelope, not just the result from printing the
SOAPHeaderElement:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<sis:MessageHeader sis:schemaLocation="http://www.sis.se/soap
http://www.sis.se/soap/soapHeader.xsd" version="2.0"
xmlns:sis="http://www.sis.se/soap">
&a mp;n bsp; <sis:From>
<sis:PartyId
type="MessageRoutingAddress">PartA</sis:PartyId>
<sis:PartyId
type="MessageRoutingSubAddress">PartA</sis:PartyId>
<sis:PartyId
type="https-RFC2817">https://host1:8443/axis/services/mhsysTransportService<
/sis:PartyId>
</sis:From>
<sis:To>
<sis:PartyId type= "Mess
ageRoutingAddress">PartA</sis:PartyId>
<sis:PartyId
type="MessageRoutingSubAddress">PartA</sis:PartyId>
<sis:PartyId
type="https-RFC2817">http://localhost:80/axis/services/mhsysTransportService
</sis:PartyId>
</sis:To>
<sis:CPAId>AGREEMENT-1234</sis:CPAId>
<sis:ConversationId>123123</sis:ConversationId>
<sis:Service>MHComponent</sis:Service>&nbs p;
<sis:Action>Document</sis:Action>
<sis:MessageData>
<sis:MessageId>123123</sis:MessageId>
<sis:Timestamp>2005-09-29T20:49:11</sis:Timestamp>
</sis:MessageData>
</sis:MessageHeader>
</soapenv:Header>
<soapenv:Body>
&n bsp; & nbsp; <sis:Manifest
sis:schemaLocation="http://www.sis.se/soap
http://www.sis.se/soap/soapHeader.xsd" version="2.0"
xmlns="urn:mhsysTransportService" xmlns:sis="http://www.sis.se/soap"
xmlns:xlink="http://www.w3.org/1999/xlink">
<sis:Reference id="1" xlink:href="cid:Envelope"
xlink:type="simple"/>
<sis:Reference id="2" xlink:href="cid:Document"
xlink:type="simple"/>
<sis:Reference id="3" xlink:href="cid:Signature1"
xlink:type="simple"/>
&nbs p; &n bsp; <sis:Reference id="4"
xlink:href="cid:ReceiptRequest" xlink:type="simple"/>
</sis:Manifest>
</soapenv:Body>
</soapenv:Envelope>
AXIS 1.2.1
=============
//Result from the first print operation = ok:
<sis:MessageHeader sis:schemaLocation="http://www.sis.se/soap
http://www.sis.se/soap/soapHeader.xsd" version="2.0"
xmlns:sis="http://www.sis.se/soap">
<sis:From>
<sis:PartyId type="MessageRoutingAddress">PartA</sis:PartyId>
<sis:PartyId type="MessageRoutingSubAddress">PartA</sis:PartyId>
<sis:PartyId
type="https-RFC2817">https://host1:8443/axis/services/mhsysTransportService<
/sis:PartyId>
</sis:From>
<sis:To>
<sis:PartyId type="MessageRoutingAddress">PartA</sis:PartyId>
<sis:PartyId type="MessageRoutingSubAddress">PartA</sis:PartyId>
<sis:PartyId
type="https-RFC2817">http://localhost:80/axis/services/mhsysTransportService
</sis:PartyId>
</sis:To>
<sis:CPAId>AGREEMENT-123 4</sis:CPAId>
<sis:ConversationId>123123</sis:ConversationId>
<sis:Service>MHComponent</sis:Service>
<sis:Action>Document</sis:Action>
<sis:MessageData>
<sis:MessageId>123123</sis:MessageId>
<sis:Timestamp>2005-09-30T12:47:20</sis:Timestamp>
</sis:MessageData>
</sis:MessageHeader>
// Result from the second print operation = NOT ok (look at the
xmlns:sis=""!):
<sis:MessageHeader sis:schemaLocation="http://www.sis.se/soap
http://www.sis.se/soap/soapHeader.xsd" version="2.0"
xmlns:sis="http://www.sis.se/soap" soapenv:actor=""
soapenv:mustUnderstand="0"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<sis:From xmlns:sis="">
<sis:PartyId type="MessageRoutingAddress" xmlns:sis="">PartA</sis:PartyId>
<sis:PartyId type="MessageRoutingSubAddress"
xmlns:sis="">PartA</sis:PartyId>
<sis:PartyId type="https-RFC2817"
xmlns:sis="">https://host1:8443/axis/services/mhsysTransportService</sis:Par
tyId>
</sis:From>
<sis:To xmlns:sis="">
<sis:PartyId type="MessageRoutingAddress"
xmlns:sis="">PartA</sis:PartyId><sis:PartyId type="MessageRoutingSubAddress"
xmlns:sis="">PartA</sis:PartyId>
<sis:PartyId type="https-RFC2817"
xmlns:sis="">http://localhost:80/axis/services/mhsysTransportService</sis:Pa
rtyId>
</sis:To>
<sis:CPAId xmlns:sis="">AGREEMENT-1234</sis:CPAId>
<sis:ConversationId xmlns:sis="">123123</sis:ConversationId>
<sis:Service xmlns:sis="">MHComponent</sis:Service>
<sis:Action xmlns:sis="">Document</sis:Action>
<sis:MessageData xmlns:sis="">
<sis:MessageId xmlns:sis="">123123</sis:MessageId>
<sis:Timestamp xmlns:sis="">2005-09-30T12:47:20</sis:Timestamp>
</sis:MessageData>
</sis:MessageHeader>
The reply:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server.userException</faultcode>
<faultstring>org.xml.sax.SAXParseException: The value of the
attribute
"prefix="xmlns",localpart="sis",rawname="xmlns
:sis"" is inval id. Prefixed namespace bindings may not be
empty.</faultstring>
<detail>
<ns1:hostname
xmlns:ns1="http://xml.apache.org/axis/">RICSVEUT2</ns1:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
Any idea what's going on?
Regards,
Rickard S