You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-dev@ws.apache.org by "Lars Andersen (JIRA)" <ji...@apache.org> on 2010/03/09 20:24:27 UTC
[jira] Created: (MUSE-308) Encoding errors in wsdlmerge tool
Encoding errors in wsdlmerge tool
---------------------------------
Key: MUSE-308
URL: https://issues.apache.org/jira/browse/MUSE-308
Project: Muse
Issue Type: Bug
Components: Tooling - Code Generation
Affects Versions: 2.2.0
Reporter: Lars Andersen
Assignee: Dan Jemiolo
I have been looking into using the wsdlmerge tool. I noticed that the resulting file often contains encoding errors. For example merging two UTF-8 wsdl files results in a wsdl file that has encoding="UTF-8" in the xml content, but actually is encoded with Cp1252.
Looking in the source reveals the error : the merged wsdl file is written using FileWriter, which simply uses whatever encoding is default on the system, and pays no attention to the xml encoding.
The code in question is found in "muse-tools/src/org/apache/muse/tools/generator/WsdlMerge.java'
I have with success changed the code like this :
>>>>>>>>>>>>> CODE BEGINS <<<<<<<<<<<<<<<<<<<<<
private static void writeWsdl(String fileName, Definition mergedDefinition, boolean overwrite) {
System.out.println("*** writeWsdl");
File wsdlDestination = new File(fileName);
if (!wsdlDestination.exists() || overwrite) {
try {
checkParentDirectory(wsdlDestination.getAbsoluteFile().getParentFile());
Document wsdlDoc = _writer.getDocument(mergedDefinition);
String enc = "UTF-8";
if (wsdlDoc.getXmlEncoding()!=null)
{
enc = wsdlDoc.getXmlEncoding();
}
FileOutputStream fileOut = new FileOutputStream(wsdlDestination);
fileOut.write(XmlUtils.toString(wsdlDoc).getBytes(enc));
fileOut.close();
} catch (Exception e) {
Object[] filler = {wsdlDestination.getAbsolutePath()};
throw new MuseRuntimeException("FailedWritingWsdl", _MESSAGES.get("FailedWritingWsdl", filler), e);
}
} else {
handleMessage(_MESSAGES.get("NotOverwriting", new String[] {wsdlDestination.getPath()}));
}
}
>>>>>>>>>>>>> CODE ENDS <<<<<<<<<<<<<<<<<<<<<
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org
[jira] Updated: (MUSE-308) Encoding errors in wsdlmerge tool
Posted by "Lars Andersen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/MUSE-308?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lars Andersen updated MUSE-308:
-------------------------------
Description:
I have been looking into using the wsdlmerge tool. I noticed that the resulting file often contains encoding errors. For example merging two UTF-8 wsdl files results in a wsdl file that has encoding="UTF-8" in the xml content, but actually is encoded with Cp1252.
Looking in the source reveals the error : the merged wsdl file is written using FileWriter, which simply uses whatever encoding is default on the system, and pays no attention to the xml encoding.
The code in question is found in "muse-tools/src/org/apache/muse/tools/generator/WsdlMerge.java'
I have with success changed the code like this :
>>>>>>>>>>>>> CODE BEGINS <<<<<<<<<<<<<<<<<<<<<
private static void writeWsdl(String fileName, Definition mergedDefinition, boolean overwrite) {
File wsdlDestination = new File(fileName);
if (!wsdlDestination.exists() || overwrite) {
try {
checkParentDirectory(wsdlDestination.getAbsoluteFile().getParentFile());
Document wsdlDoc = _writer.getDocument(mergedDefinition);
String enc = "UTF-8";
if (wsdlDoc.getXmlEncoding()!=null)
{
enc = wsdlDoc.getXmlEncoding();
}
FileOutputStream fileOut = new FileOutputStream(wsdlDestination);
fileOut.write(XmlUtils.toString(wsdlDoc).getBytes(enc));
fileOut.close();
} catch (Exception e) {
Object[] filler = {wsdlDestination.getAbsolutePath()};
throw new MuseRuntimeException("FailedWritingWsdl", _MESSAGES.get("FailedWritingWsdl", filler), e);
}
} else {
handleMessage(_MESSAGES.get("NotOverwriting", new String[] {wsdlDestination.getPath()}));
}
}
>>>>>>>>>>>>> CODE ENDS <<<<<<<<<<<<<<<<<<<<<
was:
I have been looking into using the wsdlmerge tool. I noticed that the resulting file often contains encoding errors. For example merging two UTF-8 wsdl files results in a wsdl file that has encoding="UTF-8" in the xml content, but actually is encoded with Cp1252.
Looking in the source reveals the error : the merged wsdl file is written using FileWriter, which simply uses whatever encoding is default on the system, and pays no attention to the xml encoding.
The code in question is found in "muse-tools/src/org/apache/muse/tools/generator/WsdlMerge.java'
I have with success changed the code like this :
>>>>>>>>>>>>> CODE BEGINS <<<<<<<<<<<<<<<<<<<<<
private static void writeWsdl(String fileName, Definition mergedDefinition, boolean overwrite) {
System.out.println("*** writeWsdl");
File wsdlDestination = new File(fileName);
if (!wsdlDestination.exists() || overwrite) {
try {
checkParentDirectory(wsdlDestination.getAbsoluteFile().getParentFile());
Document wsdlDoc = _writer.getDocument(mergedDefinition);
String enc = "UTF-8";
if (wsdlDoc.getXmlEncoding()!=null)
{
enc = wsdlDoc.getXmlEncoding();
}
FileOutputStream fileOut = new FileOutputStream(wsdlDestination);
fileOut.write(XmlUtils.toString(wsdlDoc).getBytes(enc));
fileOut.close();
} catch (Exception e) {
Object[] filler = {wsdlDestination.getAbsolutePath()};
throw new MuseRuntimeException("FailedWritingWsdl", _MESSAGES.get("FailedWritingWsdl", filler), e);
}
} else {
handleMessage(_MESSAGES.get("NotOverwriting", new String[] {wsdlDestination.getPath()}));
}
}
>>>>>>>>>>>>> CODE ENDS <<<<<<<<<<<<<<<<<<<<<
> Encoding errors in wsdlmerge tool
> ---------------------------------
>
> Key: MUSE-308
> URL: https://issues.apache.org/jira/browse/MUSE-308
> Project: Muse
> Issue Type: Bug
> Components: Tooling - Code Generation
> Affects Versions: 2.2.0
> Reporter: Lars Andersen
> Assignee: Dan Jemiolo
>
> I have been looking into using the wsdlmerge tool. I noticed that the resulting file often contains encoding errors. For example merging two UTF-8 wsdl files results in a wsdl file that has encoding="UTF-8" in the xml content, but actually is encoded with Cp1252.
> Looking in the source reveals the error : the merged wsdl file is written using FileWriter, which simply uses whatever encoding is default on the system, and pays no attention to the xml encoding.
> The code in question is found in "muse-tools/src/org/apache/muse/tools/generator/WsdlMerge.java'
> I have with success changed the code like this :
> >>>>>>>>>>>>> CODE BEGINS <<<<<<<<<<<<<<<<<<<<<
> private static void writeWsdl(String fileName, Definition mergedDefinition, boolean overwrite) {
>
> File wsdlDestination = new File(fileName);
>
> if (!wsdlDestination.exists() || overwrite) {
> try {
> checkParentDirectory(wsdlDestination.getAbsoluteFile().getParentFile());
> Document wsdlDoc = _writer.getDocument(mergedDefinition);
>
> String enc = "UTF-8";
>
> if (wsdlDoc.getXmlEncoding()!=null)
> {
> enc = wsdlDoc.getXmlEncoding();
> }
>
> FileOutputStream fileOut = new FileOutputStream(wsdlDestination);
> fileOut.write(XmlUtils.toString(wsdlDoc).getBytes(enc));
> fileOut.close();
> } catch (Exception e) {
> Object[] filler = {wsdlDestination.getAbsolutePath()};
> throw new MuseRuntimeException("FailedWritingWsdl", _MESSAGES.get("FailedWritingWsdl", filler), e);
> }
> } else {
> handleMessage(_MESSAGES.get("NotOverwriting", new String[] {wsdlDestination.getPath()}));
> }
> }
> >>>>>>>>>>>>> CODE ENDS <<<<<<<<<<<<<<<<<<<<<
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org