Forum Discussion
SmartBear_Suppo
Alumni
16 years agoHello,
The MockRequest object you have is of the type WsdlMockRequest (Whenever you need to know the type of an object just print the class it to the log, log.info mockRequest.class).
You can the look up the api for the class on the soapUI website, for instance: WsdlMockRequest.
The reason you are able to access mockRequest.requestContent is because of Groovy doing some of its magic
mockRequest.requestContent gets transformed to mockRequest.getRequestContent(), since there is no public field by that name. In Groovy, whenever you have a .getSomething() method, you can just use .something instead.
As for mockOperation.name, this should work fine (works for me) since WsdlMockOperation inherits from ModelItem, which has a .getName() method. Maybe you can post more of your script and we can see if there is anything else wrong with it?
Regards,
Dain
eviware.com
The MockRequest object you have is of the type WsdlMockRequest (Whenever you need to know the type of an object just print the class it to the log, log.info mockRequest.class).
You can the look up the api for the class on the soapUI website, for instance: WsdlMockRequest.
The reason you are able to access mockRequest.requestContent is because of Groovy doing some of its magic

mockRequest.requestContent gets transformed to mockRequest.getRequestContent(), since there is no public field by that name. In Groovy, whenever you have a .getSomething() method, you can just use .something instead.
As for mockOperation.name, this should work fine (works for me) since WsdlMockOperation inherits from ModelItem, which has a .getName() method. Maybe you can post more of your script and we can see if there is anything else wrong with it?
Regards,
Dain
eviware.com