wscaller其实是很好使用的,页面很简单,但是我却出现了这个问题:java.io.IOException:ERROR:Missing<soap:fault>elementinFault"IOException"in operation"IOException",in binding recordSoftwareEvent。。。。。后来我在谷歌了n多次之后,发现有一句话很好,但是我却没有找到对应此的很好的解决方法。。。
I believe that there is a JIRA open for this one.
Description:
When you have a soap 1.2 binding with soap fault, the fault element is not correctly extracted, resulting in error
ERROR: Missing <soap:fault> element inFault "..." in operation "...", in binding ...
Their temporary recommendation is adding a line of code and recompiling Axis1... Nahh.
Personally, I've just downloaded the wsdl file (it's an Axis 2 service and I have an Axis 1.5 client) and edited the namespace for all of the following lines from:
<wsdl:fault name="Exception">
<soap12:fault use="literal" name="Exception"/>
</wsdl:fault>
to:
<wsdl:fault name="Exception">
<soap:fault use="literal" name="Exception"/>
</wsdl:fault>
As suggested here.
Upgrading to Axis2, however, is the best long term solution. After resolving this issue, I have found yet more errors in the code that WSDL2JAVA has generated.
在此种,问题的描述和我遇到的一模一样。
但是我却不知道怎么解决!!!
之前想做这样一个效果,
如图:
之前的code:
et = (EditText) findViewById(R.id.et); String text = "<font >"+"123456789"+"</font>"; et.setText(Html.fromHtml(text));
这个是实现不了的.
后来发现EditView的selectAll()属性.
该属性意味选中当前所有文本。
修改之后:
et = (EditText) findViewById(R.id.et); String text = "123456456"; et.setText(text); et.selectAll();//设定全部选中 et.setHighlightColor(Color.BLUE);//设定选中背景色
这样,文本背景色设定OK.
效果:
如果还要设定文本字体颜色,如上如一样。
可以这样去做:
et = (EditText) findViewById(R.id.et); String text = "123456456"; et.setText(Html.fromHtml("<font color=red>"+text+"</font>")); et.selectAll();//设定全部选中 et.setHighlightColor(Color.BLUE);//设定选中背景色
效果:
//下面这些都OK
//Intent it = getHtmlFileIntent("/mnt/sdcard/tutorial.html");//SD卡主目录
//Intent it = getHtmlFileIntent("/sdcard/tutorial.html");//SD卡主目录,这样也可以
Intent it = getHtmlFileIntent("/system/etc/tutorial.html");//系统内部的etc目录
//Intent it = getPdfFileIntent("/system/etc/helphelp.pdf");
//Intent it = getWordFileIntent("/system/etc/help.doc");
//Intent it = getExcelFileIntent("/mnt/sdcard/Book1.xls")
//Intent it = getPptFileIntent("/mnt/sdcard/download/Android_PPT.ppt");//SD卡的download目录下
//Intent it = getVideoFileIntent("/mnt/sdcard/ice.avi");
//Intent it = getAudioFileIntent("/mnt/sdcard/ren.mp3");
//Intent it = getImageFileIntent("/mnt/sdcard/images/001041580.jpg");
//Intent it = getTextFileIntent("/mnt/sdcard/hello.txt",false);
startActivity( it );
public class MyIntent
{
//android获取一个用于打开HTML文件的intent
public static Intent getHtmlFileIntent( String param )
{
Uri uri = Uri.parse(param ).buildUpon().encodedAuthority("com.android.htmlfileprovider").scheme("content").encodedPath(param ).build();
Intent intent = new Intent("android.intent.action.VIEW");
intent.setDataAndType(uri, "text/html");
return intent;
}
//android获取一个用于打开图片文件的intent
public static Intent getImageFileIntent( String param )
{
Intent intent = new Intent("android.intent.action.VIEW");
intent.addCategory("android.intent.category.DEFAULT");
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Uri uri = Uri.fromFile(new File(param ));
intent.setDataAndType(uri, "image/*");
return intent;
}
//android获取一个用于打开PDF文件的intent
public static Intent getPdfFileIntent( String param )
{
Intent intent = new Intent("android.intent.action.VIEW");
intent.addCategory("android.intent.category.DEFAULT");
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Uri uri = Uri.fromFile(new File(param ));
intent.setDataAndType(uri, "application/pdf");
return intent;
}
//android获取一个用于打开文本文件的intent
public static Intent getTextFileIntent( String param, boolean paramBoolean)
{
Intent intent = new Intent("android.intent.action.VIEW");
intent.addCategory("android.intent.category.DEFAULT");
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
if (paramBoolean)
{
Uri uri1 = Uri.parse(param );
intent.setDataAndType(uri1, "text/plain");
}
else
{
Uri uri2 = Uri.fromFile(new File(param ));
intent.setDataAndType(uri2, "text/plain");
}
return intent;
}
//android获取一个用于打开音频文件的intent
public static Intent getAudioFileIntent( String param )
{
Intent intent = new Intent("android.intent.action.VIEW");
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.putExtra("oneshot", 0);
intent.putExtra("configchange", 0);
Uri uri = Uri.fromFile(new File(param ));
intent.setDataAndType(uri, "audio/*");
return intent;
}
//android获取一个用于打开视频文件的intent
public static Intent getVideoFileIntent( String param )
{
Intent intent = new Intent("android.intent.action.VIEW");
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.putExtra("oneshot", 0);
intent.putExtra("configchange", 0);
Uri uri = Uri.fromFile(new File(param ));
intent.setDataAndType(uri, "video/*");
return intent;
}
//android获取一个用于打开CHM文件的intent
public static Intent getChmFileIntent( String param )
{
Intent intent = new Intent("android.intent.action.VIEW");
intent.addCategory("android.intent.category.DEFAULT");
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Uri uri = Uri.fromFile(new File(param ));
intent.setDataAndType(uri, "application/x-chm");
return intent;
}
//android获取一个用于打开Word文件的intent
public static Intent getWordFileIntent( String param )
{
Intent intent = new Intent("android.intent.action.VIEW");
intent.addCategory("android.intent.category.DEFAULT");
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Uri uri = Uri.fromFile(new File(param ));
intent.setDataAndType(uri, "application/msword");
return intent;
}
//android获取一个用于打开Excel文件的intent
public static Intent getExcelFileIntent( String param )
{
Intent intent = new Intent("android.intent.action.VIEW");
intent.addCategory("android.intent.category.DEFAULT");
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Uri uri = Uri.fromFile(new File(param ));
intent.setDataAndType(uri, "application/vnd.ms-excel");
return intent;
}
//android获取一个用于打开PPT文件的intent
public static Intent getPptFileIntent( String param )
{
Intent intent = new Intent("android.intent.action.VIEW");
intent.addCategory("android.intent.category.DEFAULT");
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Uri uri = Uri.fromFile(new File(param ));
intent.setDataAndType(uri, "application/vnd.ms-powerpoint");
return intent;
}
}