Mesdames, Messieurs,
Bonjour,
Je passe par les web services xfire pour gérer mes données en base qui fonctionnent super bien jusqu'à ce souci.
En fait il semble que certaines données en base contiennent des caractères spéciaux illisibles par xfire qui me renvoie ce message systématiquement.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Message: An invalid XML character (Unicode: 0x1) was found in the element content of the document  
 
Caused by: org.codehaus.xfire.XFireRuntimeException: Could not read XML stream.. Nested exception is javax.xml.stream.XMLStreamException: ParseError at [row,col]:[615,1506]
Message: An invalid XML character (Unicode: 0x1) was found in the element content of the document.
	at org.codehaus.xfire.aegis.stax.ElementReader.getValue(ElementReader.java:128)
	at org.codehaus.xfire.aegis.type.basic.StringType.readObject(StringType.java:21)
	at org.codehaus.xfire.aegis.type.basic.BeanType.readObject(BeanType.java:159)
	at org.codehaus.xfire.aegis.type.basic.ArrayType.readCollection(ArrayType.java:80)
	at org.codehaus.xfire.aegis.type.collection.CollectionType.readObject(CollectionType.java:36)
	at org.codehaus.xfire.aegis.AegisBindingProvider.readParameter(AegisBindingProvider.java:169)
	at org.codehaus.xfire.service.binding.AbstractBinding.read(AbstractBinding.java:206)
	at org.codehaus.xfire.service.binding.WrappedBinding.readMessage(WrappedBinding.java:51)
	at org.codehaus.xfire.soap.handler.SoapBodyHandler.invoke(SoapBodyHandler.java:42)
	at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
	at org.codehaus.xfire.client.Client.onReceive(Client.java:406)
Avez vous déjà rencontré ce type de problème ?
Si oui comment concrètement avez vous fait ?
Une idée par ailleurs ?

J'ai tenté de ré-encoder les mauvais caractères avec ce bout de code que j'ai trouvé sur le net mais sans succès.
La vérité est elle ailleurs ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
 
/**
 
     * This method ensures that the output String has only valid XML unicode characters as specified by the
 
     * XML 1.0 standard. For reference, please see the
 
     * standard. This method will return an empty String if the input is null or empty.
 
     * @author Donoiu Cristian, GPL
 
     * @param  The String whose non-valid characters we want to remove.
 
     * @return The in String, stripped of non-valid characters.
 
     */
 
 
public static String removeInvalidXMLCharacters(String s) {
 
        StringBuilder out = new StringBuilder();                // Used to hold the output.
 
    	int codePoint;                                          // Used to reference the current character.
 
//    	String ss = "\ud801\udc00";                           // This is actualy one unicode character, represented by two code units!!!.
 
    	//System.out.println(ss.codePointCount(0, ss.length()));// See: 1
 
		int i=0;
		if (s == null || ("".equals(s))) return "";
    	while(i<s.length()) {
 
    		//System.out.println("i=" + i);
 
    		codePoint = s.codePointAt(i);                       // This is the unicode code of the character.
 
			if ((codePoint == 0x9) ||          				    // Consider testing larger ranges first to improve speed. 
					(codePoint == 0xA) ||
					(codePoint == 0xD) ||
					(codePoint == 0x1) ||     // 0x1
					((codePoint >= 0x20) && (codePoint <= 0xD7FF)) ||
 
					((codePoint >= 0xE000) && (codePoint <= 0xFFFD)) ||
 
					((codePoint >= 0x10000) && (codePoint <= 0x10FFFF))) {
 
				out.append(Character.toChars(codePoint));
 
 
 
 
			}				
 
			i+= Character.charCount(codePoint);                 // Increment with the number of code units(java chars) needed to represent a Unicode char.  
 
 
 
    	}
 
    	return out.toString();
 
    }

Merci d'avance .