It's a combination of things in their Client.java:

1)  wout.write("<order 
xmlns=\"http://demo.order\";><name>Rajeev</name></order>r\n");

The "r" at the end is not escaped.  Thus, it's invalid content at the end of 
the XML stream.    

2) They aren't setting a Content-Type header, so the charset isn't being 
picked up properly and such.   Add:

httpCon.setRequestProperty("Content-Type", "text/xml; charset=UTF-8");

With those changes and with the latest snapshot code (not sure if it works 
with the latest releases), the demo seems to work fine.

Dan



On Tue July 21 2009 3:08:37 pm nbreau wrote:
> When deploying the sample code found at the following article
>
> https://www.ibm.com/developerworks/webservices/library/ws-pojo-springcxf2/
>
> deployed to both tomcat 5.5 and tomcat 6, GET requests return successfully
> however POST and PUT requests fail with the following errors:
>
> I've tried both CFX 2.1 and 2.2.2 but both error out.
>
>
> ----------------------------------
> PUT Request in Tomcat 6 on Vista:
> ----------------------------------
>
> INFO: URIParameterInterceptor handle message on path [/endpointPut/custo
> mer01/endpoint/dfdf.vsvs.fw23s] with content-type [null]
> Jul 21, 2009 10:35:06 AM org.apache.cxf.phase.PhaseInterceptorChain
> doIntercept
> INFO: Interceptor has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: Unexpected EOF in prolog
>  at [row,col {unknown-source}]: [1,0]
>         at
> org.apache.cxf.binding.http.interceptor.URIParameterInInterceptor.mer
> geParams(URIParameterInInterceptor.java:122)
>
>
> ----------------------------------
> PUT Request in Tomcat 5.5 in Ubuntu:
> ----------------------------------
>
> INFO: URIParameterInterceptor handle message on path
> [/EndpointPut/customer01/endpoint/dfdf.vsvs.fw23s] with content-type [null]
> 21-Jul-2009 10:29:34 AM org.apache.cxf.phase.PhaseInterceptorChain
> doIntercept
> INFO: Interceptor has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: ParseError at [row,col]:[1,1]
> Message: Premature end of file.
>         at
> org.apache.cxf.binding.http.interceptor.URIParameterInInterceptor.mergePara
>ms(URIParameterInInterceptor.java:122) at
> org.apache.cxf.binding.http.interceptor.URIParameterInInterceptor.handleMes
>sage(URIParameterInInterceptor.java:103) at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChai
>n.java:236)

-- 
Daniel Kulp
[email protected]
http://www.dankulp.com/blog

Reply via email to