cancel
Showing results for 
Search instead for 
Did you mean: 

WssCrypto

SOLVED
Highlighted
Occasional Contributor

WssCrypto

Do any one have any idea how to change the groovy script to use WssCrypto as the parameter type for setSslKeystore? Attached the script for my custom environments.

ShamuH
Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

Re: WssCrypto

Thank you for the log.

 

Could not see any issue with the script and don't think any respective API(in latest version) is changed which you are using. Request you to followup with support only.

 

By the way, your script can be avoided so many if..else constructs with use of simple map as shown below:

import com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep
def projectProperty = context.expand('${#Project#MyProp}')

def map = [IMP1A_Secured : [IMP1A: 'hixdshtesters.jks'], 
	IMP1B_Secured: [IMP1B: 'hixdshtesters.jks'],
	IMP2_Secured: [IMP2: 'hixdshtesters.jks'],
	AWS_Secured: ['AWS-IMP1A': 'hixdshtesters.jks'],
	DEV2_Secured: [DEV2: 'hixdshtesters.jks'],
	TEST2_Secured: [TEST2: 'hixdshtesters.jks'],
	TEST0_Secured: [TEST0: 'hixdshtesters.jks'],
	IMP0_Secured: [IMP0: 'hixdshtesters.jks'],
	HPProd_Secured: [HPProd: 'hixdshtesters.jks'],
	ProdPrime_Secured: [ProdPrime: 'prodkeystore.jks']
]

testSuite.testCaseList.each { kase ->
	kase.testStepList.findAll {it instanceof WsdlTestRequestStep}. each { 
		def tempMap = map[projectProperty]
		tempMap.each { wss, store ->
			it.httpRequest.with {
				outgoingWss = wss
				sslKeystore = store
			}
		}
	}
}

 



Regards,
Rao.

View solution in original post

9 REPLIES 9
Highlighted
Community Manager

Re: WssCrypto

Community, any suggestions?

@nmrao@msiadak@Lucian@avidCoder 

---------
Tanya Gorbunova
SmartBear Community Manager

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
Highlighted
Community Hero

Re: WssCrypto

I need more details, please. What are you actually trying to accomplish? Do you wish to use WssCrypto to automate setting up Outgoing WSS instead of setSSLKeystore? I am trying to understand what your end-goal is. 




---

Click the Accept as Solution button if my answer has helped, and remember to give kudos where appropriate too!
Highlighted
Occasional Contributor

Re: WssCrypto

Yes, as in the attahcement, I run this script in the Suite Setup Script to update WS-Security credentials and Keystore. This script perfectly works in Ready! API v2.5.0 but fails in ReadyAPI v2.6.0. The SmartBear Support team member recommends that I am  using a groovy script in the Setup Script for the TestSuites which is setting the keystore and causing this error because I need to change the script to use WssCrypto as the parameter type for setSslKeystore. However, I got the Java Class location for this but I am not sure where to update these.

ShamuH
Highlighted
Community Hero

Re: WssCrypto

Ah, I don't currently have 2.6.0 installed so I wasn't seeing an issue. I'll see if I can snag a copy to help.




---

Click the Accept as Solution button if my answer has helped, and remember to give kudos where appropriate too!
Highlighted
Occasional Contributor

Re: WssCrypto

Sure, Thanks
ShamuH
Highlighted
Community Hero

Re: WssCrypto

Can you please add the stacktrace from error log?


Regards,
Rao.
Highlighted
Occasional Contributor

Re: WssCrypto

Sure. Attached.

Thanks

ShamuH
Highlighted
Community Hero

Re: WssCrypto

Thank you for the log.

 

Could not see any issue with the script and don't think any respective API(in latest version) is changed which you are using. Request you to followup with support only.

 

By the way, your script can be avoided so many if..else constructs with use of simple map as shown below:

import com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep
def projectProperty = context.expand('${#Project#MyProp}')

def map = [IMP1A_Secured : [IMP1A: 'hixdshtesters.jks'], 
	IMP1B_Secured: [IMP1B: 'hixdshtesters.jks'],
	IMP2_Secured: [IMP2: 'hixdshtesters.jks'],
	AWS_Secured: ['AWS-IMP1A': 'hixdshtesters.jks'],
	DEV2_Secured: [DEV2: 'hixdshtesters.jks'],
	TEST2_Secured: [TEST2: 'hixdshtesters.jks'],
	TEST0_Secured: [TEST0: 'hixdshtesters.jks'],
	IMP0_Secured: [IMP0: 'hixdshtesters.jks'],
	HPProd_Secured: [HPProd: 'hixdshtesters.jks'],
	ProdPrime_Secured: [ProdPrime: 'prodkeystore.jks']
]

testSuite.testCaseList.each { kase ->
	kase.testStepList.findAll {it instanceof WsdlTestRequestStep}. each { 
		def tempMap = map[projectProperty]
		tempMap.each { wss, store ->
			it.httpRequest.with {
				outgoingWss = wss
				sslKeystore = store
			}
		}
	}
}

 



Regards,
Rao.

View solution in original post

Highlighted
Occasional Contributor

Re: WssCrypto

Thank you @nmaro. Honestly, the support team clearly mentioned: We don't provide support for custom coding, please look at the JAVA doc below for guidance. https://support.smartbear.com/readyapi/apidocs/soapui/com/eviware/soapui/impl/support/AbstractHttpRe...
I tried to modify my script and worked with one of our Java Developer. Unfortunately he talk in terms of Java Language and however, I am also familiar in Learning Java and Groovy fall in helpless.
The reason for this code is to automate updating WS-Security Keystore and Credentials. I don't know how to tie this WssCrypto with Keystore is a certificate.
Thanks
Shantha.
ShamuH
New Here?
Join us and watch the welcome video:
Announcements
TechCorner Leaderboard
Compete with community members in the TechCorner Challenge and get into the Leaderboard!

Rank Participant Points Earned
1 msiadak 12
2 nmrao 8
3 HimanshuTayal 3
Top Kudoed Authors