Forum Discussion

simonjd's avatar
simonjd
New Contributor
11 years ago

Setting Parts for WS-Security

I am current writing some Groovy that will allow OWSM security settings to be configured quickly for future testing.

I have got into some difficulty when attempting to add Parts to the Parts table. To see what I am talking about, on Soap UI:
- Double click a Project
- Select the WS-Security Configurations tab
- Select the Outgoing WS-Security Configurations tab
- Add a New Configuration + Give it a name
- Add a new WSS Entry (Signature)
- See the Parts table.

Currently I am using the following code to try and populate this table:

--------------------------------------------------------------------------------------------------------
package com.eviware.soapui.impl.wsdl.support.wss.crypto;
import com.eviware.soapui.support.types.StringToStringMap;

def coredb = testRunner.testCase.testSuite.project.getWssContainer()
def outgoing = coredb.getOutgoingWssByName("Outgoing")
def signature = outgoing.addEntry("Signature")

List<StringToStringMap> list = new ArrayList<StringToStringMap>()
StringToStringMap parts = new StringToStringMap()
parts.put("ID", "")
parts.put("Name", "Timestamp")
parts.put("Namespace", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")
parts.put("Encode", "Element")
list.add(parts)
signature.setParts(list)

------------------------------------------------------------------------------------------------

However, this seems to populate a blank row in the Parts table without the content I have specified.

Is this due to some mapping that I am missing? Has anyone been able to do this successfully?

Any help would be appreciated.

Thanks, Simon.

1 Reply

  • nmrao's avatar
    nmrao
    Community Hero
    Do you mean to ask that you would like to set username, password for outgoing test request?