Forum Discussion

Stony's avatar
Stony
New Contributor
16 years ago

How to create Property Transfers in the Java API

Hi.

I've had the pleasure to work with SoapUI for some time now, and I now need to make some java-code to autogenerate some SoapUI projects based on some XML input.

Doing that I also need to create some property transfers, and I think I've got the code right, but for some reason I only get an empty Property Transfer in the final SoapUI project.

===== code snippet start =====

TestStepConfig transferStepConfig = new PropertyTransfersStepFactory().createNewTestStep(testCase, "cfg");

PropertyTransfersTestStep transferStep = (PropertyTransfersTestStep)testCase.addTestStep("transfer", "InitValues");
transferStep.setConfig(transferStepConfig);
transferStep.afterLoad();

PropertyTransfer currentTransfer = transferStep.addTransfer("Property Transfer"+ counter);
currentTransfer.setSourceStepName(sourceTestStepName);
currentTransfer.setSourcePropertyName("Response");
currentTransfer.setSourcePath("");

currentTransfer.setTargetStepName(targetTestStepName);
currentTransfer.setTargetPropertyName("Request");
currentTransfer.setTargetPath("");

===== code snippet end =====

What am I missing?

Oh, and on a sidenote. I've got a Pro license, but how do I upgrade my account here to get the advantages of that?
  • Hi!

    hmm.. in this scenario I don't think

    transferStep.setConfig(transferStepConfig);

    should be used, can you try without it?

    Please send an email to support@eviware.com regarding the forum access, they will help you with the account!

    regards!

    /Ole
    eviware.com