In one of my projects, I had a requirement to call a web service
which was a REST service and I had to POST XML content to the web
service. The web service URL demanded to query parameters though and the
service only wanted a XML to be POSTed.
The service was Certificate SSL secured with HTTPs basic authentication.
So here are the steps which I did using Oracle Service Bus.
Firstly, I went to the UNIX box the ran the below command to load the certificate from the web service.
I used the openssl utility to load the certificate. Other option is any browser to do the same. The certificates nature vary from being a chain of certificates being CA signed or a single self- signed certificate. In my case it turned out to be a single self signed certificate.
Here is the command -
openssl s_client -connect host:port | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /..../somename.cert
Once the certificate was loaded. I had to loaded it up into the keystore of weblogic. To load it, I used the keytool utility.
Loading into the Java Keystore -
keytool -import -trustcacerts -keystore /appl/oracle/dev/fmw/11g/java/jrockit-jdk1.6.0_81/jre/lib/security/cacerts -noprompt -alias somealias -file somename.cert
Loading into the Default weblogic demoTrust keystore. Note, for production, it can be the Custom Trust store.
keytool -import -trustcacerts -keystore /appl/oracle/dev/fmw/11g/product/wlserver_10.3/server/lib/DemoTrust.jks -noprompt -alias somealias -file somename.cert
and the work for the certificate part was done.
Now, since the service was HTTPs basic authentication secured too, so an OSB Service Account was used to provide a static username and password and associate it with the Business Service.
After create the Business Service, I had too only put the XML content in the Request panel and the work was done.
The service was Certificate SSL secured with HTTPs basic authentication.
So here are the steps which I did using Oracle Service Bus.
Firstly, I went to the UNIX box the ran the below command to load the certificate from the web service.
I used the openssl utility to load the certificate. Other option is any browser to do the same. The certificates nature vary from being a chain of certificates being CA signed or a single self- signed certificate. In my case it turned out to be a single self signed certificate.
Here is the command -
openssl s_client -connect host:port | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /..../somename.cert
Once the certificate was loaded. I had to loaded it up into the keystore of weblogic. To load it, I used the keytool utility.
Loading into the Java Keystore -
keytool -import -trustcacerts -keystore /appl/oracle/dev/fmw/11g/java/jrockit-jdk1.6.0_81/jre/lib/security/cacerts -noprompt -alias somealias -file somename.cert
Loading into the Default weblogic demoTrust keystore. Note, for production, it can be the Custom Trust store.
keytool -import -trustcacerts -keystore /appl/oracle/dev/fmw/11g/product/wlserver_10.3/server/lib/DemoTrust.jks -noprompt -alias somealias -file somename.cert
and the work for the certificate part was done.
Now, since the service was HTTPs basic authentication secured too, so an OSB Service Account was used to provide a static username and password and associate it with the Business Service.
After create the Business Service, I had too only put the XML content in the Request panel and the work was done.