SoapUI and XQuery

Because I have been looking for this a long time, I will post it here.

In Soapui you have assertions. One of the types is XQuery. An example can be found here.

What it does not explain, you need to add the XML elements around. So this:

declare namespace ns1='http://what/a/namespace/it/is';
{
for $e in //ns1:ValidationFault/ns1:ValidationErrors/ns1:ValidationError
return {$e/ns1:Error/text()}
}

should be:

declare namespace ns1='http://what/a/namespace/it/is';

<errors>
{
for $e in //ns1:ValidationFault/ns1:ValidationErrors/ns1:ValidationError
return <error>{$e/ns1:Error/text()}</errors>
}
</errors>

The related and not so helpfull error message:

XQuery Match Assertion failed for path [declare namespace ns1='http://what/a/namespace/it/is'; { for $e in //ns1:ValidationFault/ns1:ValidationErrors/ns1:ValidationError return {$e/ns1:Error/text()} }] : RuntimeException:java.lang.reflect.InvocationTargetException

My problem was very simple, but I had a hard time finding an answer. So to put it here, will make sure I never forget.

SoapUI and XQuery

SoapUI and Security #7

Next step is the set up the request on the WS-A Tab.

Enable WS-A Adressing
If this one is not enabled you get a SocketException: Read timed out. When enabled I get a “An error occurred when verifying security for the message.”. So I leave it enabled.

Must Understand
This must be set to TRUE. Only thing it does, for what i can see, is that it adds soap:mustUnderstand=”true” to a number of elements. This is done in a valid message I have so it stays.

WS-A Version
Set to “200508” and it adds the namespace xmlns:a=”http://www.w3.org/2005/08/addressing&#8221;.

Add Default wsa:Action
I have this not selected.

Action
Use the action provided by the webservice

Add Default wsa:To
I have this not selected.

To
The URL for the webservice.

Reply To
For this I used the URL: http://www.w3.org/2005/08/addressing/anonymous. I do not know if this is correct.

Generate MessageID
Select this one if needed.

ReplyTo Reference Parameters, MessageID, From, Fault To, FaultTo Reference Parameters, Relates To, Relationship type
These are left empty for now.

SoapUI and Security #7