-
String 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) {
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?
Please ask if you need more information.
Best Regards
Dave
Similar Threads
-
Replies: 0
Last Post: 02-27-2007, 10:30 AM
-
By tekidum in forum VB Classic
Replies: 0
Last Post: 09-09-2006, 02:08 AM
-
By ObiWan in forum VB Classic
Replies: 3
Last Post: 05-23-2006, 10:35 AM
-
By vikassheelgupta in forum Java
Replies: 0
Last Post: 01-06-2006, 01:12 AM
-
By Julian Milano in forum VB Classic
Replies: 0
Last Post: 08-10-2000, 09:16 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks