Forum Discussion

rralison's avatar
rralison
Occasional Contributor
15 years ago

Insert additional node

Hello,

I am newbie to soapui pro, however I have already made run some simple test from a Datasoursce.

Now my actual problem is more complex : I have two Table (one to many relationship) who feed soap xml request :

Table_A
id | data
-----------
1  | Adata1
2  | Adata2


Table_B
id | A_id | data
-------------------
1  | 1    | Adata1
2  | 1    | Adata1
3  | 1    | Adata1

My remote service need two parameters :
- A
- B[] array

For the first parameter, it seems simple to implement with Datasource.
But but the second one I don't have any solution : how to construct dynamicaly new XML node and insert it in the request? Please answer me if you have any solution.

Thanks

19 Replies

  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    Your first datasource has the property

    [tt:2vb75itk]level2.id[/tt:2vb75itk]

    and that is what you log in the Groovy script but your second datasource references

    [tt:2vb75itk]level2_id[/tt:2vb75itk]

    as the value of the prepared property. "." and "_" are not the same
  • rralison's avatar
    rralison
    Occasional Contributor
    All syntaxes are verified and corrected now, but second datasource still  doesn't run.

    Groovy logger can catch the value from first datasource, even if it comes from a joined table. But the second datasource continue to say Missing property values in DataSource Row.

    Maybe the syntaxe ${MySQLLevel1_2#level2_id} I used is not good.

    Is there more detailed documentation about PreparedProperties?

    Thanks
  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    Check how your loops are configured. Other than that I have no suggestions, a very similar testcase (outer datasource with loop, inner datasource using prepared property that has a value of a property from the outer datasource, see screen shot) works fine for me in a recent 3.5.1 build.

    Perhaps Eviware Support can help here.
  • rralison's avatar
    rralison
    Occasional Contributor
    Thanks for these informations.
    Wish eviware can help, my job future depend on it 
  • rralison's avatar
    rralison
    Occasional Contributor
    The problem seems solved : never use _ (or .) in variables naming.
  • rralison's avatar
    rralison
    Occasional Contributor
    In your inner table remove the row(s) corresponding to the FIRST line of you outter table.
    Then lauch you test, with some lucky you will find that your inner datasource is definitle ko.
  • rralison's avatar
    rralison
    Occasional Contributor
    Does anyone able to reproduce the behaviour I describe above?

    Is that a bug?
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi!

    sorry.. for the delayed response on this.. can you tell me exactly where you stand now in regard to this issue? What is still not working? (have you updated to 3.5.1?)

    Another alternative is to just use a groovy script fro the inner loop that queries the database and builds the corresponding XML for you.. !?

    regards!

    /Ole
    eviware.com
  • rralison's avatar
    rralison
    Occasional Contributor
    Thanks for helps.
    All problems are solved with 3.5.1

    This thread is closed now.