Showing posts with label 11g. Show all posts
Showing posts with label 11g. Show all posts

Monday, 4 December 2017

SOA 12c SOAPUI : How to add OWSM WS-Security Username Token

Lately I was trying to test a service that was using an OWSM Username Service Token policy using SOAPUI and was getting the below error:

<env:Fault xmlns:ns0="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <faultcode>ns0:InvalidSecurity</faultcode>
         <faultstring>InvalidSecurity : error in processing the WS-Security security header</faultstring>
         <faultactor/>
</env:Fault>


I had added Basic Authorization with the required credentials.

Well the reason was quite simple.

I had not added the username token to the SOAP Header. Hence it was able to validate the security.

Here is what you must do:

Let the Basic Authorization be as is.
1. Right-click on your request message in SOAPUI
2. Select 'Add WSS Username Token'



3. Select Password Text and click on OK.



You can see that the Token is added to the Header




4. Test


Helpful? Please Comment.

Happy Learning!!

Monday, 13 November 2017

SOA 12c DBAdapter : JDeveloper Error Element 'properties' used but not declared

If you are trying to open your DBAdapter configuration but getting the below error in popup:

java.util.InvalidPropertiesFormatException:
org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 12; <Line 2, Column 12>:
XML-20149: (Error) Element 'properties' used but not declared.
    at sun.util.xml.PlatformXmlPropertiesProvider.load(PlatformXmlPropertiesProvider.java:80)
    at java.util.Properties$XmlSupport.load(Properties.java:1201)

The configuration still opens if you ignore the error but properties don't load correctly.

The reason for this error is that the properties declaration is missing from the adapter-properties.xml file.

Add the below line before the properties element in your adapter-properties.xml file.

<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">

Save and retry.

Helpful? Please Comment.

Happy Learning!!

Wednesday, 25 October 2017

SOA 12c Security : Create Users & Groups

Here is what you do if you want to create users or groups in WebLogic 12c.

1. Login to WebLogic server console
2. Navigate  to Security Realms on the Home page
3. Select myrealm
4. Click on tab Users and Groups
5. Click on Groups
6. Create new Group
7. Provide Name, Description and leave Provider default


8. Save
9. Now select the group created above, Click on Membership
10. Choose required group(example: Deployers) from available groups and Save.


Similarly,

1. Click on User
2. Create new User
3. Provide Name, Description and Password
4. Click on OK
5. Select the created User
6. Click on Groups tab
7. Select the Group from available ones based in the role you want to assign to User.
8. Save

Note: If you will not assign atleast one Group to the user, you will not be able to login to the console with that user

Login with this user and check access levels.

Helpful? Please Comment.

Happy Learning!!


Tuesday, 10 October 2017

SOA 12c : SunCertPathBuilderException: unable to find valid certification path to requested target

Here is what you should do if you are exposing your SOA or any other service securely and on invocation getting  the below error.

Error- 

javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Message send failed: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Cause-

The reason for the error is that the certificates are not part of the trust store or when a server changed their HTTPS SSL certificate, the older version of Java did not recognize the root certificate authority (CA).

Solution-

1. Access the HTTPS service in the browser. Click on the HTTPS certificate chain (there is lock icon in the Internet Explorer, or the domain name left of the URL in Firefox) and navigate the certificate hierarchy
2. Export the certificates, generally Root, Secure and your certificate.crt to a tmp directory
3. To verify the root certificates, determine where the cacerts file is located. By default it is in jre/lib/security/cacerts under your JDK home
4. Navigate to directory and execute the below command:
  
keytool -list -v keystore ./cacerts


You will be prompted for password, Enter password  and check if the certificates are present inside the file.

5. Assuming that the certificates are called; exampleroot.crt, examplesecure.crt and example.crt type the command below:

keytool -keystore ./cacerts -import -alias exampleroot -file /tmp/exampleroot.crt

6. You will be prompted for password, Enter password. and Respond 'yes' to trust this key.
7. Repeat for remaining certificates.
8. Restart your JVM and test.  

Now you will be able to access/invoke HTTPS URL. 

Note: If you are using custom trust store, make sure that the key-store is  part of the startup parameter of your server.



Helpful? Please Comment.

Happy Learning!!
 

Saturday, 7 October 2017

SOA 12c : Setting up Environment variables on Unix/Windows

Generally before we begin our local installation or execute commands on Windows or Unix/Linux systems we should setup the environment variables so that we do not face any issues.

In this post we will learn how to setup the environment variables.



1.       Windows (one-time activity):
a.       Right click on MyComputer/This PC > Properties
b.       On left pane click on ‘Advanced system settings’
c.       On System Properties pop up click on ‘Advanced’ tab
d.       Click on button ‘Environment Variables’
e.       Under System variables box, click on New
f.        Insert Variable name and Variable values as below





 

g.       Add above variables to ‘Path’ variable by selecting on Path and clicking on Edit
h.       Add  %JAVA_HOME%\bin
i.     Apply and Save.
j.        Open command-prompt, type echo %JAVA_HOME% to validate.

 


1.       Unix/Linux (on every login):
a.       Login to box
b.       Identify dir path for variable
c.       Run command to set environment variable for JAVA_HOME like below

                            export JAVA_HOME=/java/jdk/jdk1.8.0_131
 
d.       Run command echo %JAVA_HOME% to validate

Note: Paths may differ based on how installation has been done.

If you want to set path permanently on Linux box, edit you ~/.profile or ~/.bash_profile and add the export commands.

You can also check the post on How to create a shell script which is easier to execute every time.


Helpful? Please Comment.


Happy Learning!!





OSB 12c : Dynamic Routing to Business/Proxy Service

Dynamic routing is a kind of  Content-based Routing pattern, which is used when the BusinessService/ProxyService path is required to be de...