Skip to main content

Rant on Ant 1.7.1

Posted by ramapulavarthi on March 29, 2010 at 11:08 AM PDT

If you are using Ant 1.7.1 for developing Web Services with JAX-WS/JAXB, I suggest you to move to the latest version Ant 1.8.0.

JAXB/JAX-WS rely on package level runtime annotations for lot of things. For ex: JAXB relies on the @XmlSchema annotation in package-info.java and uses it for binding Java data types to XML schema types. You might be puzzled to see that the mappings are not as expected. I wasted almost half a day trying to figure out if there was some regression in JAX-WS/JAXB as I was suspecting Ant the least. A bug in Ant 1.7.1 javac ant task, makes it not compile package-info.java. This is a serious regression and the impact is not directly obvious until you see the behavior change in this case. The issue is resolved in Ant 1.8.0 and I encourage all JAXB/Metro users to use Ant 1.8.0 for development.
 

Comments

Getting Unexpected character 'S' (code 83) in prolog; Error

Hi Rama, sorry to put comment on this post, I am having a little trouble with JAX-WS and Tomcat, i saw your earlier post, so thought you could help me out.

I am using JAX-WS 2.2 RI and Tomcat 6.0 (with all the necessary endorsed thing you mentioned) when I make a call to i am getting below exception.

protocol.soap.MessageCreationException: Couldn't create SOAP message due to exception: XML reader error: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'S' (code 83) in prolog; expected '<'


I put an intercept handler and and took out the request xml and it seems to be correct,

From the error message i figured out it is complaining about the name space "S" for the SoapEnvelope

S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"

Can you help me out please?

Thanks
-Naveen

Using only the WSDL file

Hello, How can I not generate the XSD file, use only the WSDL file. Thanks Augusto

Adding SOAP headers when sending replies


Firstly, a big fan our blogs...
Now to my problem...
Using Handlers or accessing Soap MessageContext, is it possible to Add SoapHeaders to the response from the service impl (or server handler).
The client expects couple of Soap header values. We cannot use @WebParam as the value to be sent are computed (like number of items returned)
Searched all thru the web and could not find any answer on how to do it.
Changing WSDL is out of question as this is managed by a standards body.
Kindly create a blog on this at your earliest convenience.

Thanks in advance,
regds,
Chiths