Hey Meisinotti
Firstly unless you've got tailored responses that have altered how the app server handles error responses, I wouldn't expect a 500 response from a malformed xml request - 5xx http status codes are server errors - not client errors. I'd expect something like a 400 (bad request) if you were injecting malformed xml - so I'd suggest you double check the server is working fine, cos it doesnt matter how wellformed/malformed your xml is if the app server's busted :)
Also - can you please describe clearly (maybe a screenshot as well) as what you have in your test right now - you say you pass the XML content via a property transfer and the xfer is actually removing the declaration? I'm just wondering how the content/payload of your requests are setup.
I've thought about it a bit more and it's probably feasible to do this without bothering with the event handler - all you need to do is to concatenate the xml declaration and a line break before the parent tag in your xml.
One of the coders on the forum will probably whip out some 3 lines of cool code that does the job - but in the meantime....
I've only used a couple of event handlers before - so I'm not sure - but I'm guessing it would be something like 'TestRunListener.beforeStep' or 'TestRunListener.beforeRun' - essentially depending on your testcase object (teststep) hierarchy, I'm thinking for this to work, you'd want the event to fire before the specific test step is submitted to the endpoint.
UPDATE to ticket: I had another look at the event handlers help page - it says you'll know which event handlers to pick if you know the soapUI API (which I dont) - it mentions the SubmitListener (relates to submitting a request) and RequestFilter (relates to sending a request) - unsure what the difference between submitting and sending is here - but anyway - I'll play around with it later
The 'Target' value you'd specify would be the relevant test step name.
In the field below after the correct event handler is selected you'd need a bit of groovy to grab the content request, concatenate the declaration to the request content and publish the concatenated whole to the endpointn - so something LIKE the following (Im not a groovy coder - -this is a guess on my part)
def extractedRequest = context.expand( '${REST Request#Request}' ).toString();
def wellFormedXML = "<?xml version="1.0" encoding="ISO-8859-15"?> \n" + extractedRequest
//bit unsure how to finish it off cos Im not very au fait with event handlers nor groovy - but....
//....Im guessing you'd want to publish the the wellFormedXML variable as the content of the request, but I'm...
//....wondering how the event handler deals with this - so I'll look at this later tonight
I need to do a little investigation as to how to publish the concatenated xml content to the endpoint after the event handler has fired - like I say above - I've only used 2 different types of event handler and both times it was on a response not a request - I'll play with it tonight and try and give you an answer by tomorrow - but quite possibly one of the coders will answer this too.
Cheers,
rich