URL をデコードするために、OSB (バージョン 11.1.3) で Java コールアウト関数を作成しようとしています。プログラムで使用できます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 (xmlbeans.jar で利用可能な XmlAnyTypeImpl)に変換するにはどうすればよいですか?
これが私の新しいプログラムです
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 に変換するのを手伝ってくれますか?