I need to change the request method to GET instead of the default one POST in SoapUI 5.3.0.
ٍSteps
Open SoapUI.
Create new project.
Add WSDL.
Add New Test suite.
Add New Test case.
Add new Soap Request step.
When I run the test step and check the HTTP log I find that the default method is POST.
How I can change the method to GET.
Related
I'm trying to leverage Postman's mock server feature to mock an API that my application calls.
This is a Post request. I have gone through the documentation and as advised I have saved the responses as examples.
When I try hit the mock URL I get the postman error response
Here is my setup -
My Collection with saved examples
MY mock server
After going through your query, I can see that you're trying to match an example based on the body passed with the request.
To match an example based on the request body, you can leverage the body matching feature of mock servers by:
Enabling the body matching feature from the mock edit page (Reference: https://learning.postman.com/docs/designing-and-developing-your-api/mocking-data/setting-up-mock/#matching-request-body-and-headers).
OR
Passing an additional x-mock-match-request-body header with value as true along with your mock request to get the desired results.
You can find more information on how to use body matching feature with mock servers here: https://learning.postman.com/docs/designing-and-developing-your-api/mocking-data/matching-algorithm/#6-check-for-header-and-body-matching.
Do let me know if this doesn't solve your issue. In that case, it would be helpful if you can share the mock request that you're sending to get the response.
I am trying to learn webservices,
I have created a webservice and client after watching tutorials and my client is getting the input from webmethod successfully.
What i did is, i just created a test webservice method to retun a hardcoded string to client.
But when i change the hardcoded value to something new and run the client, it is not getting the updated value, it is still displaying the old value.
Do i have to regenerate client or any other step needed to get the updated weservice call ...???
please guide me ...
I am new in SOAP UI. I have an one scenario like I have to pass the access token value coming as a response to all the requests under the test suite.This access token type is "Bearer". I ADD this token value in the next request header field called "Authorization" and it is working but my query is there any method OR groovy script that I can add which can be applied for all the soap requests, instead of changing the value every time for all request's header.How to automate this?Please guide me on this.
I don't understand exactly what you are trying to achieve, I suppose that you want to add an http-header for Authoritzation with your token as value for each request within this testCase, to do so you can put a groovy script testStep below the testStep request where you get your token. In this groovy script you can put the follow code which sets an http-header for each testStep in this testCase:
// testSteps is a map where keys are request names and values are the instance
// of the testStep
testRunner.testCase.testSteps.each{ name, testStep ->
log.info name
// check if the testStep has required methods (to avoid error
// trying to add header on groovy script testSteps for example)
if(testStep.metaClass.getMetaMethod("getTestRequest")){
def request = testStep.getTestRequest()
def headers = request.getRequestHeaders()
headers.add('Authoritzation','yourToken')
request.setRequestHeaders(headers)
log.info "Added header to $name"
}
}
This script adds the required http-header for each testStep in your testCase.
EDIT
Another possible approach is to add a testCase property as an http-header value and then set the value for this property when you need to refresh this value. To do so in your TestStep request click on Headers() tab and add a http-header with name Authoritzation and value ${#TestCase#Authoritzation} as in the follow image:
Then each time that you want to set the value for this property you can use different approaches (I don't have enough details about your case so I give you different possible solutions), property transfer testStep or a groovy script testStep using testRunner.testCase.setPropertyValue('Authoritzation',yourToken).
Hope it helps,
I am working with SOAP UI project to test web service.
When i build a request automatically using SOAP UI right click and generate rquest.
Request is generated with default '?' value with all the properties requires for request.
My request object contains bunch of properties nearly i can say 100-150. I have to set this manually.
My question is that is there any way to generate request object with default values?
Yes, use a Request Template.
Under the Interface, find your method.
Right click on the method, select New Request, give it a name, click OK.
Define your default values. Close the Request editor.
Right-click on the Request you named in step 2, select Add To test Case. Follow through with the rest of the prompts.
I am badly stuck with a SOAP based integration using Axis2 framework for generation of client stubs from the Server WSDL. The scenario is as follows :
There is always a login API call first, which gives a Success response in SOAP body and Temporary Redirect in HTTP header. Also provides a URL which contains the session ID in the Location field of HTTP Header.
The next API call is required to be made at this redirect location. IN THE SAME TCP CONNECTION, for getting a proper response.
Now, the problem is, as a part of Webservice implementation using Axis2 generated stubs, I need to reload this redirect URL and re-instantiate it as --- "stub=new Stub(newurl)"
As soon as this is done, it creates a new TCP connection and so, the next request gives the response as "session ID invalid" because it goes out-of-sync with login API.
I have tried everything mentioned as a solution in this forum and nothing is working out.
For e.g --
MultiThreadedHttpConnectionManager httpConnectionManager = new MultiThreadedHttpConnectionManager();
HttpClient httpClient = new HttpClient(httpConnectionManager);
ServiceClient serviceClient = stub._getServiceClient();
Options opts = stub._getServiceClient().getOptions();
opts.setTo(new EndpointReference(prop.getProperty("target_end_point_url")));
opts.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Constants.VALUE_TRUE);
opts.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient);
serviceClient.setOptions(opts);
stub._setServiceClient(serviceClient);
Similarly, I have tried many other options too. But it's not helpful at all.
Faced exactly the same issue.
Following steps solved the issue.
1. Using HttpClient, perform login. Don't use stub object to perform login.
2. Use the Location Header URL, to create new stub object i.e. stub = new Stub(locationURL). (Your existing options setting should be retained.)
3. There is a default timeout, by which server disconnects the TCP connection. In my case it was 50 seconds. Hence as soon as i performed login in step 1, i execute a timer every 40 seconds, to send an empty requests to new Location URL using HeadMethod of same HttpClient object.