3 Replies Latest reply on Apr 29, 2006 7:56 AM by Thomas Diesler

    special character in string parameter

    Gert Kropiunik Newbie


      I am just testing the new jbossws stack interacting with microsoft .net client applications. I was running into some trouble exchanging string parameter with german special characters like "ß" or "ö".

      Before Jira issue JBWS-812 was fixed I got exceptions on the server side which are resolved after that. But the .net client still did not understand these special characters. With the old axis stack the client had no problems understanding these characters.

      The reason for this problem is the Content-Type in the header of the HTTP response.
      The old axis stack returned:

      Content-Type: text/xml;charset=utf-8

      The new jbossws stack returns only:
      Content-Type: text/xml

      I have fixed this problem by adding the following line into the doPost() method of the org.jboss.ws.server.ServiceEndpointServlet:
      res.setContentType("text/xml; charset=UTF-8");

      To increase interopability with .net client applications the content type should be modified.

      By the way...
      I also found out that the responding soap messages do not have a XML declaration which I first thought could be the problem. The reason is that the method isWriteXMLDeclaration() in org.jboss.ws.soap.SOAPMessageImpl always returns false because the propValue in line
      Object propValue = getProperty(WRITE_XML_DECLARATION);
      is null.