Win a copy of Penetration Testing Basics this week in the Security forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Web service client gives com.ctc.wstx.exc.WstxIOException: Invalid UTF-8 middle byte 0x20 on reply

Luca Zitto
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In our organization we have developed a web service on oracle. basically it is a pl/sql function reading some rows from some table and with some configuration on the db-server the function itself is exported as a web service.
In addition, we have developed a standard web client application connecting to this service and normally all is ok.
Problem is, sometimes in the tables being read we have non standard characters, like for instance 'à' and in this case the client will be unable to unmarshal the soap message and the exception in the title is returned.
This client application was developed using jax-ws on netbeans.
As the web service requirese authentication, I have written a header handler to set the authentication header and this works fine, so I am now trying to use the same handler to add
a sort of content-type handler, but I am not sure if this is the correct approach, so let's get to the questions:

1) As the reply can contain these odd characters, which content-type should I be using? UTF-8, UTF-16? this is just text at least for the moment.
2) should the content-type be declared by the service wsdl? or is it sufficient to specify it in the client side?
3) so far I've been trying to set content-type in the Header handler on the client side as follows, is this approach correct? and if it is, how should I be setting the content-type?

This is the code from the handler:

Any suggestions?
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic