Опитвам се да създам функция за извикване на Java в OSB (версия 11.1.3), за да декодирам URL адреса. Мога да използвам java.net.URLDecoder.decode(data, "UTF-8");
в програмата, но OSB функцията дава по-долу грешка (когато типът на въвеждане и връщане е String)
<Jun 11, 2014 7:43:30 AM UTC> <Error> <OSB Transform> <BEA-382516> <Failed to evaluate expression for callout to java method "public static java.lang.String com.help.sachinProject.ttttt.test(java.lang.String)". Argument index: 1, exception: Value of type 'org.apache.xmlbeans.impl.values.XmlAnyTypeImpl' cannot be type-cast to 'java.lang.String'>
<Jun 11, 2014 7:43:35 AM UTC> <Warning> <Socket> <BEA-000449> <Closing socket as no data read from it on 10.232.24.59:49,359 during the configured idle timeout of 5 secs>
Така че трябва да въвеждам и връщам тип като XmlAnyTypeImpl. Как да конвертирам String в XmlAnyTypeImpl (XmlAnyTypeImpl е наличен в xmlbeans.jar)?
Ето я новата ми програма
import org.apache.xmlbeans.impl.values.XmlAnyTypeImpl;
public class XMLFormatDecode {
XMLFormatDecode(){
super();
}
public static String getValue(XmlAnyTypeImpl data)
{
String decoded = java.net.URLDecoder.decode(data.toString(), "UTF-8");
return decoded;
}
public static void main(String[] args) throws UnsupportedEncodingException {
new XMLFormatDecode();
System.out.println("Result main - "+XMLFormatDecode.getValue(null));
}
}
ще работи ли XmlAnyTypeImpl.toString()?
Може ли някой да ми помогне да конвертирам String в XmlAnyTypeImpl?