If you use Axis2 wsdl2java to create a web service client based on a 
WSDL, and then run the web service client in the resin 3 environment (in 
this way, Resin's xmlStreamWriterImpl class will be picked up), you will 
come across the error. 

In the current code, the setPrefix() method will cause the namespace not 
being included in the element to be output. This side effect should be 

To explain it with an example, let's see the following code segment:

The intention of this piece of codes is to output namespace (if 
necessary) and set the prefix. However, since setPrefix() is called 
after the method setNamespace(), the namespace will never be included in 
output, since the setPrefix() method set the namespace output to false. 
In my opinion (maybe I am not correct), in logic, I think that setting 
prefix should not have any effect on deciding whether the namespace 
should be output or not. This is the point that codes need to be fixed. 
Without the fix,
the developer has to do this in the following code order in order to 
have the namespace output with resin implementations:


See the difference of the orders of the code lines? In fact, if I 
remember correctly, with resin xmlstreamwriterimpl, setPrefix() is not 
needed in the above code lines, since setNamespace() will by default set 
the prefix in the output.

Based on my debugging and checking the differences of the soap messages 
generated from axis2 implementations and resin implementations, I would 
suggest resin modify the logic of how an element will be output.

All the above is based on what is left in my brain for this matter, and 
probably I have not referred to the resin API names perfectly. However, 
I debugged through the resin source code for this matter a while ago. 
Hope that you will get the idea.

Huitang Li

> Huitang,
> I've been looking into reproducing this problem, but I haven't been
> able to do so.  Can you let me know where in Axis it is calling
> setPrefix()?  In my own testing, I can't find any difference in the
> behavior between Resin's XMLStreamWriterImpl and Axis'.  
> Thanks,
> Emil
> ============================================================
> Emil Ong
> Software Engineer
> Caucho Technology, Inc.
> Tel. (858) 456-0300
> Caucho: Reliable Open Source
> --> Resin: application server
> --> Quercus: PHP in Java
> --> Hessian Web Services
> **********************

resin-interest mailing list

Reply via email to