Re: Custom Deserializer is not being used when a SOAP Header is present in message

2006-03-26 Thread paul slade
In case anyone is interested I have determined the cause of this
issue.  The Handler I was using to validate a SOAP header was defined
at the Transport level (as opposed to within a particular service). 
The MessageContext object is in a different state when Handlers
defined at the Transport level are called when compared to Handlers
defined at the Service level.

By moving my Handler definition from the Transport level to the
Service level I was able to resolve the issue.   This is not ideal
since I really want to execute this Handler for each service
regardless of how the service is confgured.

I think if I put SOAPPart.getEnvelope() early on in my Handler invoke
method, I can ensure that the MessageContext is in the correct state
(since it forces the complete message to be parsed).  That is yet to
be tested.

paul

On 3/24/06, paul slade <[EMAIL PROTECTED]> wrote:
> I am running Axis 1.4 and using the MTOM support.
>
> I have an "echo" service that just takes a DataHandler as input and returns 
> it.
>
> When I use this service when there is no SOAPHeader included in the
> message it works happily.  When I use the service AND execute a
> Handler that adds a SOAP Header Element (for WS-Security) then I get a
> SAX exception.
>
> I have tried to go through the code and basically what seems to be
> happening (in the case there is a SOAP Header) is that the
> OperationDesc for the method I am calling is null within the
> RPCHandler that is trying to parse the element (from the message) that
> is of type DataHandler.
>
> When the OperationDesc is null Axis does not use the appropriate
> Deserializer.  It uses SimpleDeserializer when it should use
> JAFDataHandlerDeserializer.  This results in the SAX exception because
> the SimpleDeserializer does not expect nested elements.
>
> I have attached the following:
>
> 1. good message and log file (good.txt).
> 2. bad message and log file (bad.txt)
>
> You will notice that the SOAP body is the same for both good and bad
> scenarios.  It seems that the appearence of the SOAP Header that is
> causing issues.
>
> Any help would really be appreciated.
>
> paul
>
>
>


Custom Deserializer is not being used when a SOAP Header is present in message

2006-03-24 Thread paul slade
I am running Axis 1.4 and using the MTOM support.

I have an "echo" service that just takes a DataHandler as input and returns it.

When I use this service when there is no SOAPHeader included in the
message it works happily.  When I use the service AND execute a
Handler that adds a SOAP Header Element (for WS-Security) then I get a
SAX exception.

I have tried to go through the code and basically what seems to be
happening (in the case there is a SOAP Header) is that the
OperationDesc for the method I am calling is null within the
RPCHandler that is trying to parse the element (from the message) that
is of type DataHandler.

When the OperationDesc is null Axis does not use the appropriate
Deserializer.  It uses SimpleDeserializer when it should use
JAFDataHandlerDeserializer.  This results in the SAX exception because
the SimpleDeserializer does not expect nested elements.

I have attached the following:

1. good message and log file (good.txt).
2. bad message and log file (bad.txt)

You will notice that the SOAP body is the same for both good and bad
scenarios.  It seems that the appearence of the SOAP Header that is
causing issues.

Any help would really be appreciated.

paul
BAD with SOAP Header


Content-Type: multipart/related;type="application/xop+xml"; 
start="<437B087C54BA73C3377301AE5D565A33>"; start-info="text/xml"; 
charset="utf-8"; boundary="=_Part_0_7796677.1143196978497"
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.4
Host: localhost
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: ""
Content-Length: 1538


--=_Part_0_7796677.1143196978497
Content-Type: application/xop+xml; charset=utf-8; type="text/xml";
Content-Transfer-Encoding: binary
Content-Id: <437B087C54BA73C3377301AE5D565A33>


http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>

http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
 
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";>
admin
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest";
 EncodingType="SHA-1">8WwNOUVX6GEKd1o6nVxzfLwMj7U=
RwTHHxX6i8b8a3mid5jHRQ==
2006-03-24T10:42:58Z




http://schemas.xmlsoap.org/soap/encoding/"; 
xmlns:ns1="urn:EchoAttachment">

http://www.w3.org/2004/08/xop/include"/>




--=_Part_0_7796677.1143196978497
Content-Type: text/plain
Content-Transfer-Encoding: binary
Content-Id: <1F170227DD600E370027B9EA2F7D79C5>

the quick brown fox jumped over the lazy dog
--=_Part_0_7796677.1143196978497--


error 

24/03/2006 22:39:54 org.apache.axis.message.SAXOutputter startElement
FINE: SAXOutputter.startElement ['' dh]
24/03/2006 22:39:54 org.apache.axis.encoding.SerializationContext startElement
FINE: Start element []:dh
24/03/2006 22:39:54 org.apache.axis.encoding.SerializationContext 
registerPrefixForURI
FINE: register 'ns2' - 'http://www.w3.org/2004/08/xop/include'
24/03/2006 22:39:54 org.apache.axis.message.SAXOutputter startElement
FINE: SAXOutputter.startElement ['http://www.w3.org/2004/08/xop/include' 
Include]
24/03/2006 22:39:54 org.apache.axis.encoding.SerializationContext startElement
FINE: Start element [http://www.w3.org/2004/08/xop/include]:Include
24/03/2006 22:39:54 org.apache.axis.message.SAXOutputter endElement
FINE: SAXOutputter.endElement ['http://www.w3.org/2004/08/xop/include' Include]
24/03/2006 22:39:54 org.apache.axis.encoding.SerializationContext endElement
FINE: End element ns2:Include
24/03/2006 22:39:54 org.apache.axis.message.SAXOutputter endElement
FINE: SAXOutputter.endElement ['' dh]
24/03/2006 22:39:54 org.apache.axis.encoding.SerializationContext endElement
FINE: End element dh
24/03/2006 22:39:54 org.apache.axis.message.RPCHandler onStartChild
FINE: Exit: RPCHandler.onStartChild()
24/03/2006 22:39:55 org.apache.axis.message.SAXOutputter startElement
FINE: SAXOutputter.startElement ['' dh]
24/03/2006 22:39:55 org.apache.axis.encoding.SerializationContext startElement
FINE: Start element []:dh
24/03/2006 22:39:55 org.apache.axis.encoding.SerializationContext 
registerPrefixForURI
FINE: register 'ns2' - 'http://www.w3.org/2004/08/xop/include'
24/03/2006 22:39:55 org.apache.axis.message.SAXOutputter startElement
FINE: SAXOutputter.startElement ['http://www.w3.org/2004/08/xop/include' 
Include]
24/03/2006 22:39:55 org.apache.axis.encoding.SerializationContext startElement
FINE: Start element [http://www.w3.org/2004/08/xop/include]:Include
24/03/2006 22:39:55 org.apache.axis.message.SAXOutputter endElement
FINE: SAXOutputter.endElement ['http://www.w3.org/2004/08/xop/include' Include]
24/03/2006 22:39:55 org.apache.axis.encoding.SerializationContext endElement
FINE: End element ns2:Include
24/03/2006 22:39:55 org.apache.axis.message.SAXOutputter endElement
FINE: SAXOutputter.endEle