Ah yes, I had looked a that help topic, however I did not notice that "Invalid Session Id Fault" was one of the defined responses, since it is cut off in the screen shot....
That does help! I can now execute a dispatch, sort of.
I did not have success with the statement however. I do not believe I am obtaining values from the request properly...
My new code..
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
def holder = groovyUtils.getXmlHolder( mockRequest.requestContent )
def scriptName = holder.getNodeValue( "//scriptName")
def optionId = holder.getNodeValue( "//OptionId")
if (scriptName == "TEST2")
return "Response2"
else return "error"
always returns the "error" response, so at least I know it is being executed!
They are nested within objects, do I need to add their hierarchy?
some thing like... (//RunScript/scriptName)
The request is... (scriptName and OpionId tags near bottom)
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<tem:RunScript>
<!--Optional:-->
<tem:optionObject>
<!--Optional:-->
<tem:ErrorMesg> </tem:ErrorMesg>
<tem:ErrorCode> </tem:ErrorCode>
<!--Optional:-->
<tem:Forms>
<!--Zero or more repetitions:-->
<tem:FormObject>
<!--Optional:-->
<tem:CurrentRow>
<!--Optional:-->
<tem:Fields>
<!--Zero or more repetitions:-->
<tem:FieldObject>
<!--Optional:-->
<tem:FieldNumber>FIELD1</tem:FieldNumber>
<!--Optional:-->
<tem:FieldValue>XXXXXXXX</tem:FieldValue>
<!--Optional:-->
<tem:Required>0</tem:Required>
<!--Optional:-->
<tem:Enabled>1</tem:Enabled>
<!--Optional:-->
<tem:Lock> </tem:Lock>
</tem:FieldObject>
</tem:Fields>
<!--Optional:-->
<tem:ParentRowId>0</tem:ParentRowId>
<!--Optional:-->
<tem:RowId>ROW1</tem:RowId>
</tem:CurrentRow>
<!--Optional:-->
<tem:FormId>FORMID1</tem:FormId>
<tem:MultipleIteration>0</tem:MultipleIteration>
<!--Optional:-->
<tem:OtherRows>
<!--Zero or more repetitions:-->
<tem:RowObject>
<!--Optional:-->
<tem:Fields>
<!--Zero or more repetitions:-->
<tem:FieldObject>
<!--Optional:-->
<tem:FieldNumber> </tem:FieldNumber>
<!--Optional:-->
<tem:FieldValue> </tem:FieldValue>
<!--Optional:-->
<tem:Required> </tem:Required>
<!--Optional:-->
<tem:Enabled> </tem:Enabled>
<!--Optional:-->
<tem:Lock> </tem:Lock>
</tem:FieldObject>
</tem:Fields>
<!--Optional:-->
<tem:ParentRowId> </tem:ParentRowId>
<!--Optional:-->
<tem:RowId> </tem:RowId>
</tem:RowObject>
</tem:OtherRows>
</tem:FormObject>
</tem:Forms>
<!--Optional:-->
<tem:OptionId>OPTION2</tem:OptionId>
<!--Optional:-->
<tem:SystemCode>SYSTEM1</tem:SystemCode>
<!--Optional:-->
<tem:EntityID>OOOOOOO</tem:EntityID>
<!--Optional:-->
<tem:EpisodeNumber> </tem:EpisodeNumber>
<tem:Facility>QQQQ</tem:Facility>
<!--Optional:-->
<tem:OptionUserId>ZZZZZZ</tem:OptionUserId>
<!--Optional:-->
<tem:OptionStaffId>YYYYYYY</tem:OptionStaffId>
</tem:optionObject>
<!--Optional:-->
<tem:scriptName>TEST2</tem:scriptName>
</tem:RunScript>
</soapenv:Body>
</soapenv:Envelope>
Do scriptName and OptionId also need to be defined as properties somehwere? I figured i would have to do that in the MockResponse when it came time to modify the response, but I thought that would have been separate from the dispatch (I would have to read in from the xmlHolder again in the repsonse)
More thanks...
-Tim