Javier,
no, such a conditional encryption and/or signing is not implemented. To
do this we would need to implement some sort of logic processing
(similar a lightwight scriptin) to cover the "if exists" expressions.
In you case would it be ok to just encrypt the body? Usually you can
call one method of a webservice at one time anyhow.
Regards,
Werner
Garzon Maldonado, Jesus Javier schrieb:
Hello all,
Actually with WSS4J we can define which elements inside a soap body we
want to encrypt (with encryptionParts parameter). However service
interfaces usually have several method defined, and not all methods use
the same input or output params. Taking into acccount handlers are
applied to services, we only can encrypt common elements to all methods
defined in each service.
For example, let's assume we have the following service defined:
service {
boolean methodA(ParamA a);
boolean methodB(ParamB b);
}
Where ParamA is something like:
<a>
<somestuffA>hello</somestuffA>
</a>
and ParamB is something like:
<b>
<somestuffB>Oppps</somestuffB>
</b>
If we define a handler with the following parameter:
<parameter name="encryptionParts"
value="{Content}{http://anamespace}somestuffA"/>
Calls to methodA will encrypt somestuffA element, but calls to methodB
will fail, because no somestuffB element will be found.
Is there any way to encrypt an element only if it is present, or to
define which methods are affected by this param?
Thak you very much in advance.
Regards.
Javi Garzon