Skip to main content

WS-JP: Revolting JP in WS

Java is a great tool as a language but sucks at some points. Why can't I use two different keystore files in my application? One for my embedded Axis/Jetty server and one for my Axis WS client. I know, when it comes to connection any fools out there whom prefer instant production would suggest using plain HTTP connection. Mind you! I will never let any of my product with that kind of quality. And I would not have my quality time of playing wasted on the overkill productivity such as write yet another WS library. Just leave the SAX and those JAX-RPC, JAX-WS, and WS-* to the right people and Apache is them.

Oh, btw, to have your own keystore just put these lines in the main:

System.setProperty("javax.net.ssl.trustStore", "YOUR_KEYSTORE");
System.setProperty("javax.net.ssl.trustStorePassword", "YOUR_PASSWORD");


I know, you can use the funky way like mentioning it in command lines by adding -Djavax.net.ssl.trustStore=YOUR_KEYSTORE -Djavax.net.ssl.trustStorePassword=YOUR_PASSWORD to the command line. I added that to my Axis AdminClient utility. But, I don't recommend that, especially when using SSL for a server. It could be exposed by a naughty user. If you would like to debug, you could add -Djava.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol -Djavax.net.debug=ssl

Anyway, I don't want to lose in despair of inability to have two different keystore. So, I manage to learn about the keytool command tool provided by Sun's JDK. I just need to store the certificates in one keystore. I know about the way to store the certificates in single command line, but I have to use two command lines because of the forgetfulness. For the sake of laziness, let me show you:
  1. Suppose we have generate a Keystore for our server side:
    • keytool -genkey -keystore aKeystore.jks -keyalg RSA
  2. And we want to merge the other keystore which contain certificates of other server.
    • keytool -export -alias keyAlias -keystore yetAnotherKeystore.jks -file outputFile.cert
    • keytool -import -alias keyAlias -keystore aKeystore.jks -trustcacerts -file outputFile.cert
    Btw, if you don't know what is the alias, just see it:
    • keytool -list -keystore yetAnotherKeystore.jks
  3. But, if you don't get it, just google it.
Btw, "encoded" is considered deprecated, SOAP 1.2 add it as optional and WS-Profile prohibit it, but PHP5 just love to abuse that in their own WS implementation. PHP5 implementation is very similar to nuSOAP implementation. Yeah, then again why not using WSO2 for PHP. Hmm.. yet another framework? I myself recommend those PHP programmers to use that, but it seems too cryptic for them to code it. Yeah again, you could just make some wrapper of the creepy part, but, hey, I'm not the PHP guy.

Anyway, as I see the working example of WSO2/PHP, I think the PHP dev guy just not see the example, yet. You don't need to make your own WSDD, WSDL, or the worst: some SOAP messages. I think the poor guy just watch the Download page without seeing the Library page where the tiny description tells about tutorial. Hmm... I guest I just tell him later.

The Debian package of WSO/PHP is not so Debian. It assumes that we have a working Apache server as the front end of PHP. The workaround of that is to create a /etc/php5/apache2/php.ini file. After that, split the file configuration accordingly. For the sake of laziness, I'll just show you:
  1. Append these lines in the php.ini:

    [wsf]
    wsf.home="/usr/lib/php5/20060613+lfs/wsf_c"
    wsf.log_path="/tmp"
    wsf.rm_db_dir="/tmp

  2. Put the loading extension in /etc/php5/conf.d/wso.ini:

    # WSO/2 PHP Extension
    extension=wsf.so
You may name the wso.ini as whatever in case you don't like the name. Btw, As I dive, I think the poor PHP dev guy is using MTOM mode for generating the WS. No wonder he is exposed to the cryptic SOAP.

Okay, this is getting lame. I think I will continue about WS later on. Oh, just in case you don't know, WS is abbreviation of Web Service.

Comments

Popular posts from this blog

STAN vs. UI

Ugh, kasihan banget adek gue. Saking kepinteran dia jadi dapet Akuntansi UI dan STAN. Jadi bingung mau masuk yang mana. Beberapa orang (termasuk orang tua gue), menyarankan masuk STAN. Gue malah memperburuk suasana dengan membela memasuki Akuntansi UI, maklum bela almamater. Duh, gue jadi merasa bersalah bikin dia ragu-ragu. Kira-kira enakan masuk mana, yah? Gue juga gak tahu keuntungan masing-masing. Hasil debat sementara: ~ Untuk jangka panjang masuk UI, untuk jangka pendek STAN. ~~Tapi, dia itu kan cewek, ntar pas menikah kemungkinan besar karir terhambat. Eits, ntar, dulu, sekarang kan jamannya emansipasi, bisa aja cowoknya yang jadi BRT. ~ STAN sarang korupsi, kalo masuk STAN jadi pegawai negeri. Kalo mau kaya harus korupsi. Tapi kalo masuk UI, lulus masuk jadi akuntan publik. Sekarang ini, orang membayar akuntan publik untuk memanipulasi nilai pajak dan aset. *SIGH*. Jadi gak ada yang beres ~ dll. Yah, udah gue jadi bingung, apa lagi dia nanya saran gue. Buah, gue gak pengalaman ...

I Hate Marvel Civil War Storyline In Comic

See this snippets from The Amazing Spiderman: [1] http://scans-daily.dreamwidth.org/4625006.html The snippets on [1] made it clear: Stan Lee made Spidey have a strong believe in Privacy. The comic strips show how Spidey even have to face charges because of his anonymity. The accuser even made many accusation to other entities for political attacks. A fan-art/art I've found in the 90's illustrated Spiderman standing in front of Peter Parker tomb. I don't know if that was originally from comic book or fan-made, 90's are a long time ago. That art mesmerized me and introduced me to the importance of privacy. In late nineties, I was joined to a program hold by an NGO. So, at that time I know how crucial a privacy was (and still is) to humanity. I'm not exaggerating! Humanity would fall to big financial organizations if people could not voice their fears in anonymity. Whistleblowers around the world would not dare to come up. We would not see any suppression ge...