Here we are using the WSO2ESB 4.0.3 and SoapUI 4.0.0
First of all you have to start the ESB and secure the "echo" service as follows
1. Click on the "List" button under "Web Service" menu and Select the "Unsecured" button to Secure the service in front of "echo" service
2. Now select "yes" from drop down and selected the policy number "5" and click Next
3. Select the "Trusted key store" and "Private key store" click Finish
4. You can see the message "Security applied successfully"
Configuration part in ESB side is finished. What we have to do now is Invoke the secured service through the SoapUI
1. Open the SoapUI and go to "New SoapUI project" and give the service endpoint url with wsdl
ex/ endpoint url - http://localhost:8280/services/echo?wsdl
you can easily take the endpoint url by click on the service
Place the endpoint url with wsdl and create SoapUI project
2. Click on the created project and select "Show Project View"
3. go to "WS-Security Configurations"
4. Select "Keystores / Certificates"
5. Add new keystore - select the "wso2carbon.jks" that you select to secure the service (you can easily find this here ${ESB_HOME}/repository/resources/security)
6. Set Default Alias as "wso2carbon" and Alias Password as "wso2carbon"
7. Select tab "Incoming WS-Security Configuration"
Add new record name as "incoming-security"
Select Signature keystore as "wso2carbon.jks" and set password as "wso2carbon"
8. Select tab "Outgoing WS-Security Configuration"
Add new record name as "outgoing-security"
Set Alias name as "wso2carbon" and password as "wso2carbon"
9. Add new WS Entry "TimeStamp"
Set value as "300000"
9. Add another WS Entry "Signature"
Keystore : wso2carbon.jks
Alias : wso2carbon
Password : wso2carbon
Key Identifier type : Binary Security Token
Signature Algorithm : http://www.w3.org/2000/09/xmldsig#rsa-sha1
Signature Canonicalization : http://www.w3.org/2001/10/xml-exc-c14n#
Digest Algorithm : sha1
Use Single certificate : true
Parts - Add a new sign part for SOAP body. For that use the following values
ID - [keep it as blank]
Name - Body
Namespace - http://www.w3.org/2003/05/soap-envelope
Encode - Content
9. Add another WS Entry "Encryption"
Keystore : wso2carbon.jks
Alias : wso2carbon
Password : wso2carbon
Key Identifier type : Binary Security Token
Symmetric Encoding Algorithm : <Default>
Key Encryption Algorithm : <Default>
Encryption Canonicalization : <Default>
Create Encrypted Key : true
Parts - Add a new Encryption part
ID - [keep it as blank]
Name - Body
Namespace - http://www.w3.org/2003/05/soap-envelope
Encode - Content
10. Save the SoapUI project and select the one of function under soap12Binding and go to request
Select "Aut" and Set the "Outgoing WSS" and "Incoming WSS"
11. Invoke the service with the required parameters
No comments:
Post a Comment