473,403 Members | 2,366 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Charset/Encoding problem

Hi

I don't know anymore what to do, so I'm posting this question in good faith getting help...

I have a jaxrpc web service and a regular web application running in weblogic server.

When I'm automatically invoking web service from web application, then characters like öäüõ are getting lost, instead of them ? is written. But when I invoke the web service from php or independent java client, then everything works. And I can't figure out where's the problem.

jaxrpc:
public class WebServiceHandler implements Handler {
public boolean handleRequest(MessageContext messageContext) {
System.setProperty("file.encoding", CHARSET_NAME);
SOAPMessageContext smc = (SOAPMessageContext) messageContext;
SOAPMessage msg = smc.getMessage();
SOAPPart sp = msg.getSOAPPart();
SOAPEnvelope se = sp.getEnvelope();
Iterator childElems = se.getChildElements();
while (childElems.hasNext()) {
SOAPElement child = (SOAPElement) childElems.next();
String data = child.toString();

-When I here print out data, then ??? marks are in the text.

}
return true;
}
public boolean handleResponse(MessageContext messageContext) {
return false;
}
public boolean handleFault(MessageContext messageContext) {
return false;
}
public void init(HandlerInfo handlerInfo) {
}
public void destroy() {
}
public QName[] getHeaders() {
return new QName[0];
}
}


And web application:
MessageFactory messageFactory = MessageFactory.newInstance();
SOAPMessage message = messageFactory.createMessage();
SOAPPart soapPart = message.getSOAPPart();
SOAPEnvelope envelope = soapPart.getEnvelope();
SOAPBody body = envelope.getBody();
MimeHeaders hh = message.getMimeHeaders();

hh.addHeader("Content-Type", "text/xml; charset=UTF-8");
SOAPHeader header = envelope.getHeader();
SOAPElement bodyElement = body.addChildElement(envelope.createName("funcName "));

SOAPElement element = header.addChildElement("SomeData");
element.addTextNode("ÜÜÜÜÜ");

message.saveChanges();
SOAPConnectionFactory soapConnFactory = SOAPConnectionFactory.newInstance();
SOAPConnection connection = soapConnFactory.createConnection();
SOAPMessage reply = connection.call(message, "link");
envelope = reply.getSOAPPart().getEnvelope();
body = envelope.getBody();
System.out.println(body);
connection.close();


Both, in the web application and in the jaxrpc function:
System.getProperty("file.encoding") returns UTF-8.

Any ideas/suggestions?

Best Regards
Dave
May 9 '07 #1
0 1086

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: lawrence | last post by:
How do I get PHP to tell the server that when I echo text to the screen, I need for the text to be sent as UTF-8? How does Apache know the right encoding when all the text is being generated by...
3
by: Ricardo Garcia | last post by:
hi, i put as you said encoding="UTF-8" (<?xml version="1.0" encoding="UTF-8" standalone="no"?> as first line), but when i tried to validate in http://validator.w3.org, i get the following response:...
1
by: Nick Kew | last post by:
Someone just drew attention to an open bug report in Apache concerning shipping with an AddDefaultCharset set by default in httpd.conf. This leads to bogus charsets being served in many cases. ...
37
by: Haines Brown | last post by:
I understand that <br /> is marginal in CSS, and so am looking for a substitute for the EOL character. I've failed in both approaches and seek advice. The first thing I tried was to use the...
15
by: Ben Sharvy | last post by:
I hae a page which validates, but produces a warning about a charset mismatch. The warning claims I specify a charset in the http header. I don't specify a charset in the http header. What gives?...
6
by: Calvin Lai | last post by:
Does anyone know the difference and usage of them? Great thanks!
4
by: Rémi | last post by:
Question: How can you determine the character set used by a webpage you built? My understanding of the issue is that the character set used by an HTML file (or any other file, for that matter)...
7
by: gmclee | last post by:
Hi there, I am writing a program to load HTML from file and send it to IE directly. I've met some problem in charset setting. Most of HTML have charset "us-ascii", for some reason, some UNICODE...
3
by: yellowtek | last post by:
Hi, I'm simply using PHP as a programming language, and I just want to print some text information to stdout, but instruction print "é" (&eacute;) does not print my "e" with an accent in the...
0
by: mubx2000 | last post by:
I Did Some Application (In Symbian C++) To Get Email Message from POP3 Server Using Sockets Engine, The Message Containes (Arabic) Language Text ,Inside the message body It's Charset should be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.