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 ...

Installing Goodix Fingerprint Reader Driver on Fedora

I currently have a Lenovo Thinkpad L14 laptop equipped with fingerprint. I was `belok` from KDE Neon to use Fedora 40 because of someone. Now I am tempted to enable my fingerprint: lsusb | grep -i fingerprint Bus 001 Device 004: ID 27c6:55b4 Shenzhen Goodix Technology Co.,Ltd. Fingerprint Reader Dump the firmware Assuming this is a fresh install, lets do some magic by getting some dependencies: sudo dnf install gcc git python-pip python-devel openssl Let's get the source code: git clone --recurse-submodules https://github.com/goodix-fp-linux-dev/goodix-fp-dump.git cd goodix-fp-dump Create an isolated Python environment: python -m venv .v source .v/bin/activate Do the magic: sudo su pip install -r requirements.txt python run_55b4.py exit There are some python scripts available. I run run_55b4.py because my device ID is 27c6: 55b4 . It will spell some nonsense, which is a good thing. That nonsense actually the firmware captured by our device. Also, I typed exit becaus...

Vibe Coding Workflow

I am currently working for having A.I. workflow for generating projects. There are two things that need to be tackled for that: 1) hallucinations; and 2) old codes. I have met several patterns to tackle those two and just need to formulate the patterns into a general flow. Thankfully, a video of building fullstack app using A.I. from Raf Dev channel inspired me to make the formulation. He used multiple A.I. engines to his need: He used Google Gemini to onboard his ideas and summarized it. He forked a boilerplate of NextJS project into a new project. Then, he added the summary from Google Gemini into a file for context. He used QWEN Code, a QWEN3 code engine that is a fork from Gemini CLI, to build the project. When working with an existing project, A.I. will take the whole project as a context. It also means that it will stick with the version used by the libraries. It also will try to update its knowledge based on the common pattern in the project. Most of the time, it will use the c...