Contributions
Re: learning how to Mock a service
Hi Rupert, As always, thanks for the response. The service I am trying to mock, does the following: accepts the upload of a file in XML format via a method call with a signature like - int ToUpload(byte[] file, string fileName, string fileID out string errorMsg) provides a file for download in XML format when you call a method with a signature like - int GetFile(string fileID, out string file, out string errorMsg) and a way to mark/flag files downloaded as 'downloaded'. using a method like - int SetToDownloaded(string fileID, out string errorMsg). I feel the last operation should be easy to accomplish, so want to do it first. But can't seem to figure out an approach. Kind regards,3.1KViews0likes0CommentsRe: learning how to Mock a service
Hi Rupert, Thanks again for the response. Another question: The XML response that got generated automatically. Where does it come from? And how does SOAP UI know what tags is needed for the response? Same goes for the request (step 4.4). And when it says it changes the endpoint automatically. That means, internally, the request is been pointed to the endpoint of the mock service - to invoke the response. Overall, my aim is to develop a mock service that behaves like an actual services that exists. This service has a number of methods it understands. I need to simulate all these methods, with thier corresponding outputs. Now, I have a service in Visual Studio that will query this mock service.Since I'm expecting a number of different responses, I now know it means I will have multiple responses. Question is, how do I tell SOAP UI to look out for certain requests and give the corresponding responses? In addition to the questions above, I was able to find a SOAP UI project a colleague worked on (who I have no contact with anymore). In his mockservice, there is no operation (and no response), but he made use of the 'OnRequest Script' - which is described as "a groovy script to run when receiving a request before it is dispatched". This contradicts the tutorial. How does it fit in? Can one really make use of the OnRequest script to generate the required XML response? If there is any additional reading material you feel I should read, please feel free to advise. Asides from your book ofcourse. Your response, as always, is appreciated. Kind regards, Michael3.1KViews0likes2CommentsRe: learning how to Mock a service
Hi Rupert, Again thanks for the detailed response. Much appreciated. Another question. In Step 4, line 4. It stated "As you can see the MockService returned the values we entered earlier as the response". I was expecting a GUI window or something to display the value I entered in the previous step. Instead, the response window came up with the xml script that was generated + the value I entered. Is this what happens when you get a response using SOAP UI? You basically get the XML response, just like your application would, if you were making a call to the service? Kind regards, Michael3.1KViews0likes5CommentsRe: learning how to Mock a service
Hi Rupert, Thank you very much. This clears it up. It appears simple things like that trips a SOAP UI newbie like myself. Again, much appreciated. Will be posting more questions as I go along. I sure hope I'm sending the mto the right place. Just a complimentary question. Can I confirm that an operation could have more than one response? I am asking because the response is numbered with a '1'. Personally, I dont see how this is logical. But figured I ask. Also, is your book SOAP UI Cookbook aimed at SOAP UI newbies? Kind regards, Michael3.1KViews0likes7Commentslearning how to Mock a service
hi guys, As the title suggest, I'm trying to learn how to mock a service. And as a result, I am reading this tutorial on mocking a service. Now, in the spirit of making sure I understand every single line, I came across a line in seciton 3, line 4 of the tutorial that reads: "After creating the MockService, you should get a MockService with one operation and one request". Please SOAP UI gurus, where in navigator does it show 'one operation and one request"? There's nothing in the script that suggest a particular code segment is an operation either. Look forward to your responses.Solved3.2KViews0likes9Comments