weblogicosb

How to access a password protected web service in osb?


I have a web service which returns a Unique ID when I provide a valid request. This web service is username/password protected and I have the credentials for the same.

The Service request returns a expected response in SOAP UI where I added the username password fields in the resource properties.

Now I want to access the same web service in OSB. I get the error:

'The invocation resulted in an error: FATAL Alert:BAD_CERTIFICATE - A corrupt or unuseable certificate was received..'

How do I access this web service?

I added the following code in the request part of the operation I am trying to invoke in the wsdl.

<wsp:Policy wsu:Id="WS-Policy-UNT"
xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-    wssecurity-utility-1.0.xsd">
<wssp:Identity xmlns:wssp="http://www.bea.com/wls90/security/policy">
<wssp:SupportedTokens>
<wssp:SecurityToken TokenType="http://docs.oasis-open.org/wss/2004/01/oasis- 200401-wss-username-token-profile-1.0#UsernameToken">
<wssp:UsePassword Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText"/>
</wssp:SecurityToken>
</wssp:SupportedTokens>
</wssp:Identity>
</wsp:Policy>

I also added a Service account with the username password in the security tab of the same.

I am still getting the same error. Please guide me...


Solution

  • Finally, I was able to get the solution. Phew.!

    I used openssl to download the certificate.

    This Command here from Server Fault made it a piece of cake.

    echo -n | openssl s_client -connect HOST:PORTNUMBER | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' >[PATH_TO_SAVE_CERTIFICATE]
    

    I then checked the USE JSSE SSL in Advanced Part of SSL Tab in the admin Console.

    After a complete Server Restart it worked as expected.