Ξ Notes

Recent Notes

Created byDr. Xion March 21, 2013 19:47:46
Last update: March 22, 2013 12:30:27

It's normal practice to import types from an external xsd file in WSDL like this: <wsdl:types> <xsd:schema xmlns:xsd="htt... When you use <dynamic-wsdl> and have Commons XMLSchema on the class path, Spring-WS inlines the xsd in the wsdl. But that doesn't happen when you use <static-wsdl> . You can define a SimpleXsdSchema bean to expose the xsd: <?xml version="1.0" encoding="UTF-8"?> <beans x... where the bean id "hello" should match the schemaLocation attribute in the WSDL (without the .xsd suffix). But note that the SimpleXsdSchema does not inline the xsd. It only makes the xsd available via an HTTP URL. Alternatively, you can simply put the xsd file under the content directory of the webapp (just link any CSS or JavaScript). Anyway, that's a lot of manual...

Created byfreyoon May 17, 2011 08:46:50
Last update: May 17, 2011 08:47:35

When I used AssetManager to open an XML file in a ContentProvider :
getContext().getAssets().openFd("demo.xml");
it failed with this exception:
java.io.FileNotFoundException: This file can not b...
It turned out that openFd only works for asset files that are not compressed. It works on media files such as .mp3 , .jpg , .wmv etc., which are not compressed during packaging. XML files are compressed by dedault, causing openFd to fail.
An Android ticket was opened on this issue. Till that is fixed, the workaround is to add an exclusion in build.xml :
<?xml version="1.0" encoding="UTF-8"?>
<pro...

Created byfreyoon May 05, 2011 09:00:36
Last update: May 05, 2011 09:07:27

This example uses an Intent with Uri scheme tel: to invoke the phone dialer. Create a new project with: $ ~/android-sdk-linux_86/tools/android create proj... Update the layout res/layout/main.xml to add a text field and a button: <?xml version="1.0" encoding="utf-8"?> <LinearL... Update the Java class src/com/android/intenttest/CallPhone.java to handle button click and start the built-in phone dialer with Intent : package com.android.intenttest; import andr... Update AndroidManifest.xml to add CALL_PHONE permission: <?xml version="1.0" encoding="utf-8"?> <manifes... Install to the emulator and test: ant install The phone dialer will be invoked when you click the "Call" button. So how did this happen? The CallPhone activity creates an Intent with action Intent.ACTION_CALL and Uri tel:<a number> and sends it off to Android. Android starts the activity com.android.phone.OutgoingCallBroadcaster because the intent matches the...

Created byDr. Xion September 17, 2010 21:29:47
Last update: September 17, 2010 21:31:43

With JBoss (Tomcat?), the servlet container always appends the default charset ISO-8859-1 to the Content-Type header of a JSP response. For example, if you are using JSP to render PDF and put the following declaration at the top of the JSP: <%@ page contentType="application/pdf"%> These would be the headers in the HTTP response (notice that charset=ISO-8859-1 was appended to Content-Type ): HTTP/1.1 200 OK Server: Apache-Coyote/1.1 X-... And the output would be truncated a few bytes before non-ASCII characters were encountered, without any error messages ! Maybe you don't intend to output binary files with JSP, but still your response would be truncated without warning if the page happens to contain any non-ASCII characters (when the charset is the default charset=ISO-8859-1 ). However, if you...