目前,我需要在我必须进行的每个 SOAP 调用中重复以下标头
client.send(SOAPAction: 'http://TEST/developments/2013/01/IP24DevelopmentService1/PingSecured') {
envelopeAttributes "xmlns:test": 'http://test.cxf.grails.org/', "xmlns:soapenv":"soapenv"
version SOAPVersion.V1_1
header {
'wsse:Security'('soapenv:mustUnderstand': "1", 'xmlns:wsse': 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd', 'xmlns:wsu': 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd') {
'wsse:UsernameToken'('wsu:Id':"UsernameToken-13") {
'wsse:Username'(username)
'wsse:Password'('Type':'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText',password)
'wsse:Nonce'('EncodingType':'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary',new String(password.bytes.encodeBase64().toString()))
'wsu:Created'('2013-01-18T16:19:17.950Z')
}
}
}
body {
PingSecured(xmlns:"http://TEST/developments/2013/01")
}
一等奖是在某种闭包/变量/映射中拥有信封属性、版本和标题。二等奖是只提取标题
例如
client.send(SOAPAction: 'http://TEST/developments/2013/01/IP24DevelopmentService1/PingSecured') {
header
body {
PingSecured(xmlns:"http://TEST/developments/2013/01")
}
这可能吗?