Thanks for your reply Jason.

I'm not following jbws-349 too well but it doesn't look related. I should have 
explained that I have two clients; one that works because it includes the 
attribute and one that doesn't.

Bad message
<multipart n1:arrayType="n0:MultimediaMessagePart[1]" 
xmlns:n1="http://schemas.xmlsoap.org/soap/encoding/";>
  |     <item i:type="n0:MultimediaMessagePart">
  |       <type i:type="d:string">image/gif</type>
  |       <contentID i:nil="1"/>
  |       <location i:nil="1"/>
  |       <data i:type="n1:base64">somedata</data>
  |       <multipart i:nil="1"/>
  |     </item>
  | </multipart>

Good message

<multipart i:type="n1:Array" n1:arrayType="n0:MultimediaMessagePart[1]" 
xmlns:n1="http://schemas.xmlsoap.org/soap/encoding/";>
  |     <item i:type="n0:MultimediaMessagePart">
  |       <type i:type="d:string">image/gif</type>
  |       <contentID i:nil="1"/>
  |       <location i:nil="1"/>
  |       <data i:type="n1:base64">somedata</data>
  |       <multipart i:nil="1"/>
  |     </item>
  | </multipart>

As you can see the only difference is that the good message contains
<multipart i:type="n1:Array" .....

Because I have no control over the client I decided to write a handler that 
would insert the attribute if it wasn't there. I'm at the stage where the 
handler inserts the attribute (so the XML changes) and the endpoint is invoked 
but I can see that the deserialised object (i.e. multipart) doesn't contain the 
data part.


My attention has come to handleRequest() in 
org.jboss.webservice.handler.ServerHandlerChain :
   public boolean handleRequest(MessageContext msgContext)
  |    {
  |       RPCInvocation invBefore = 
(RPCInvocation)msgContext.getProperty(RPCProvider.RPC_INVOCATION);
  |       if (invBefore == null)
  |          throw new IllegalStateException("Cannot obtain RPCInvocation from 
message context");
  | 
  |       String xmlBefore = 
invBefore.getRequestEnvelope().getAsStringFromInternal();
  |       if (log.isTraceEnabled())
  |          log.trace("RequestEnvelope before request handlers: " + xmlBefore);
  | 
  |       boolean doNext = super.handleRequest(msgContext);
  | 
  |       checkMustUnderstand(msgContext);
  | 
  |       RPCInvocation invAfter = new RPCInvocation(invBefore);
  |       invAfter.prepareFromRequestEnvelope();
  | 
  |       String xmlAfter = 
invAfter.getRequestEnvelope().getAsStringFromInternal();
  |       if (xmlBefore.equals(xmlAfter) == false)
  |       {
  |          if (log.isTraceEnabled())
  |             log.trace("RequestEnvelope after request handlers: " + 
xmlAfter);
  | 
  |          msgContext.setProperty(RPCProvider.RPC_INVOCATION, invAfter);
  |       }
  | 
  |       return doNext;
  |    }

xmlAfter contains the attribute so I know the handler has worked. But the 
RPCInvocation invAfter as part of its arguments does not contain the data part 
in the multipart object.

Investigating further, it looks like invAfter.prepareFromRequestEnvelope() 
deserialises the XML. However (it looks to me that) it checks to see if it has 
deserialised it before. I believe that because invAfter is created using a copy 
constructor, it thinks that it does not have to deserialise the SOAP body again.

Next thing I'll try is somehow force it to deserialise the body again.

Thanks again,
Shin



View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3914935#3914935

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3914935


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to