Forum Discussion

CrazyFrog's avatar
CrazyFrog
Contributor
5 years ago

add the "Outgoing WSS" information to the request from Java

Hello,   Who can help me (maybe someone from Smarbear Olga_T  To add the "Outgoing WSS" to the request I use the following Java Code below, this is the same code that is used in the GUI to add ...
  • CrazyFrog's avatar
    CrazyFrog
    5 years ago

    I found the problem.

     

    We generate the soapui project entirely from java and add the keystore and the

    "Outgoing WSS configurations" from java.

    To be able to use this configuration when making the test steps (from the java code)

    I first have to save the project and then read it in again.

    After re-reading it is possible to add the "Outgoing WSS" to the request from the java code.

     

    Why is the keystore and the "Outgoing WSS configuration" not immediately available

    after adding to the project (from java)?

     

    Another point, you must of course first add the "WSA-Headers" before you can properly

    add the "Outgoing WSS" to your request.

    In the example code above I had not done this yet.

     

    Current method add WsaHeaders and OutgoingWSS to a teststep.

    private static void addOutgoingWSSToRequest(WsdlTestRequestStep testStep){

    WsdlRequest request = testStep.getHttpRequest();

    DefaultWssContainer wss = request.getOperation().getInterface().getProject().getWssContainer();
    List<OutgoingWss> outgoingWssList = wss.getOutgoingWssList();
    OutgoingWss outgoing = outgoingWssList.get(0);

    AddWsaHeadersToRequestAction addWsaHeadersToRequestAction = new AddWsaHeadersToRequestAction(request);
    addWsaHeadersToRequestAction.actionPerformed(null);

    ApplyOutgoingWSSToRequestAction outgoingWSSToRequestAction = new ApplyOutgoingWSSToRequestAction(request, outgoing);
    outgoingWSSToRequestAction.actionPerformed(null);
    }

     

    Thank you for picking up the issue, but the problem is currently fixed.

    Kind regards

     

    Raymond Wiertz

    The Netherlands