Contact Us
About Us
News
Home
Main Menu
Home
Eviware Store
Downloads
Products
News
Forum
Eviware Blog
Search
FAQs
Customer Area
Support
Documentation
Tutorials
CookBook
Downloads
Forum
Login Form
Welcome,
Guest
. Please
login
or
register
.
December 01, 2008, 07:33:16 pm
Username:
Password:
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Forgot your password?
how to disable from xml elements if...
Welcome,
Guest
. Please
login
or
register
.
December 01, 2008, 07:33:16 pm
News:
The Forums are up! Welcome to eviware.
Eviware Forum
soapUI
soapUI
how to disable from xml elements if...
« previous
next »
Pages:
[
1
]
Author
Topic: how to disable from xml elements if... (Read 670 times)
manish singh
Newbie
Posts: 9
how to disable from xml elements if...
«
on:
July 03, 2007, 06:48:19 pm »
My problem..
Im making test for our webservices.Im doing it with my jdbc datasource .
In my test case
I hav put all the properties from the datasource in my request method.
But some field are optional and for that i put in my corrosponding database fields blanks(null).
When im running the test,At the property where the corrosponding data in null in database, It is sending the ${propery field..} to my request.In my response im getting errors(number format exp or date time exp..)coz it is now seeing the ${property field} instead null.
My Question is How it can be done that elements in the soap request are removed when the corrosponding field is null in database and only request with filled fields proceed???
I think this the the best way to solve this problem(or if there is other way??) but can someone tell how it can be done?
Regards
Manish
Logged
omatzura
Administrator
Hero Member
Posts: 1,466
Re: how to disable from xml elements if...
«
Reply #1 on:
July 03, 2007, 07:02:03 pm »
Hi Manish,
hmm.. I think this should be viewed as a bug (ie that the expansion syntax is returned and not an empty string).. can you somehow in your sql-statement add handling of this? (I vaguely remember SQL Server had an ISNULL statement that allowed you to return a default value for null columns)..
Also, if you dont want the empty elements to show up in your request when there is no value, you may want to extend your select to include the xml-element;
SELECT "<name>" + name + "</name>" FROM ...
and in your request replace
<name>${DataSource#name}</name>
with
${DataSource#name}
Hope this helps!
regards,
/Ole
eviware.com
Logged
manish singh
Newbie
Posts: 9
Re: how to disable from xml elements if...
«
Reply #2 on:
July 04, 2007, 08:16:42 am »
The thing is,I also want that my logic in endpoint will not read that element when it is null or with (${DataSource#name} at present case).
How that logic can be made that before request is sent to the server ,Data is checked by a logic in SOAPUI and then that XML elements from soap request are disabled when it find (${DataSource#name}).
FOR example if data contains '$' in xml element then disable it .?
btw i try what u have said but it would be a long work:-( as my sql statement contain 20 tables with 300 data fields.
Regards
Logged
omatzura
Administrator
Hero Member
Posts: 1,466
Re: how to disable from xml elements if...
«
Reply #3 on:
July 04, 2007, 08:32:32 am »
Hi,
hmm.. you would have to create a groovy script that removes the empty/unwanted elements from the request.. but it is not that easy, since the original request needs to be restored before the next row.. We could add a "remove empty elements" option for outgoing requests that would do just that, which would do what you want.. I'll give it some more thought first..
regards,
/Ole
eviware.com
Logged
manish singh
Newbie
Posts: 9
Re: how to disable from xml elements if...
«
Reply #4 on:
July 04, 2007, 09:07:37 am »
In between i tried ur option but its not working as..
made select statement
select '<name>'+name+'</name>' from table ...
then in the coloum name its is added '<name>'+name+'</name>' in a same way (not in results) .I add property in datasource the same as the colum '<name>'+name+'</name>' (as it is must otherwise i will not get the value).
and when i get the null field then it is showing ${'<name>'+name+'</name>'} so i guess that will not work ..:-(
If it can be done with groove script then can u clear a bit picture in my mind how it can be done with on field or something like that...
Regards
Manish
Logged
Pages:
[
1
]
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> eviware general
-----------------------------
soapUI
-----------------------------
=> soapUI
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Powered by SMF 1.1.2
|
SMF © 2006-2007, Simple Machines LLC
Loading...