Is Rest-Assured api supporting SOAP - soap

We are trying to perform tests using Rest Assured Api but we aren't getting success with the response. We sent a request but the response is a faultcode (xml). The same request was made successfully using Soapui.
So, we searched a lot, people say that rest assured supports SOAP and others says that doesn't support.
Anyone knows what is the truth? Supports or not?

While it does not specifically support SOAP protocol, nothing stops you from using RestAssured for SOAP Servers testing - because it is just sending and receiving XML over HTTP and RestAssured does this perfectly well.
To be honest, the fact that RestAssured is not specifically designed to support SOAP makes it even more valuable for error testing, which would be really difficult with SOAP-centered clients.
Here's more details how one can verify XML content: https://github.com/rest-assured/rest-assured/wiki/Usage#example-2---xml

Rest-Assured framework only supports testing REST services.
You can read the introductory post by Johan (Rest-Assured committer) in the below link:
https://www.jayway.com/2013/11/29/rest-assured-2-0-testing-your-rest-services-is-easier-than-ever/
Also in the source code of REST-Assured in Github, it is never mentioned about supporting SOAP services, or has code that supports it.
https://github.com/rest-assured/rest-assured
If you want a single framework supporting both REST and SOAP services try the following options.
http://www.citrusframework.org/
https://www.soapui.org/developers-corner/integrating-with-soapui.html

Currently, We are leveraging a REST API framework tool to automate large soap msgs for api testing, fundamentally rest and soap are same.
The only difference is SOAP msg payload is in xml and response is in xml, will have single header and single type of https request -POST.
you just have to write supporting utils for constructing payload and then processing response.

Related

Is SOAP a stateful protocol? Is REST really stateless? How can one store data using REST?

Is SOAP designed to be a stateful? How can it be reached? SOAP use RPC, so where to store data?
Is REST designed to be a stateless? Is it possible to store data in JSON ? Is it so wrong?
Thanks
Is REST designed to be a stateless?
Yes, it really is -- but Fielding is precise about what stateless means in the context of REST:
communication must be stateless in nature, as in the client-stateless-server (CSS) style of Section 3.4.3 (Figure 5-3), such that each request from client to server must contain all of the information necessary to understand the request, and cannot take advantage of any stored context on the server. Session state is therefore kept entirely on the client.
In other words, to correctly interpret a request, the server does not need to remember any previous requests.
For example, contrast HTTP (where credentials are part of the metadata of the request) with FTP (where credentials are sent separately from the RETR command).
Comparing SOAP with REST is not so suitable, because SOAP is a protocol based on XML and REST is an architectural style that is by definition not bringged to a specific technology.
In any case the common use of REST is via http, like SOAP, and the common usage of REST with json and http is only a comfortable implementation that is very suitable for web development and machine to machine communication due to the incredible good support for json in almost all the modern programming language.
Said that SOAP is definitely stateless!.
When we fire a web service call with soap we create a SOAP envelop in xml and send it on a http channel, that is stateless by default.
During the years near to SOAP many other protocols that can be used with SOAP can add some feature to the protocol the well known WS-*. BPEL deserves some discussion, it is the most important standard for SOAP orchestration.
Even if with BPEL in my experience the engine provide a SOAP web service in order to create a "state full" web service, the fact that a BPEL process is exposed via SOAP it is not correlated with SOAP. BPEL is BPEL and SOAP is SOAP are two separated things.
said that yes REST is an architectural style that is stateless by design and it is particular suitable and used with http, but even soap is a stateless protocol that use http like transportation layer.
for the storing data part of the question, storing data is a application concern. Of course you can pass data in a rest api like a SOAP web service. For the SOAP web service usually you will post data on the body of the SOAP envelop. In a REST service typically you are creating/updating a resource and for this reason using the classical http implementation of REST you will perform a POST(create)/PUT(update all the resource)/
PATCH(update only a piece of resource) pasing the data in the body of the http request. of course do not forget the Content-Type http header on application/json.
I hope that it can help you

Generating soapUI Rest Service Mock

I created a REST service project in version 4.6.0, and added a mock. I'm not able to add an operation for the mock. I get..
No unique operations to mock in project!
I am able to directly modify the onRequest script and set the response status code for GET messages. However, when I switch to POST, which is what I really need, I get a SOAP fault string in the response:
org.apache.xmlbeans.XmlException: Missing/Invalid SOAP Envelope,
expecting [{http://schemas.xmlsoap.org/soap/envelope/}Envelope]
How can I bypass soapUI's SOAP processing of the message? I'm trying to post a plain old XML message, not SOAP.
posting: <test></test>
As Temil Sanchez writes for a question asked on the soapUI forum:
Rest Mocking was not that fully supported in 4.6.3, the only
workaround for Rest Mocking in 4.6.3 is located here :
http://www.soapui.org/Getting-Started/mock-services.html
rest mocking becomes much easier to do in our SoapUI 5.0 Release which
should be available on April 1st. In the meantime we have a Beta that
you can try here:
http://forum.soapui.org/viewtopic.php?f=2&t=23529

Does NeoLoad support load testing for RESTful webservices?

I want to use NeoLoad to perform load test on:
1. HTTP traffic
2. REST services
From the NeoLoad site I found that it supports HTTP and SOAP. Can anyone confirm me that using NeoLoad I can perform load testing for REST APIs.
Thank you for your interest in NeoLoad. I'm working at Neotys, the company who publishes it. NeoLoad works at the minimum with HTTP and HTTPS. As REST is just a superset to these, you can load test your API with NeoLoad and this with just the standard license, without any extras.
On top of this, if you are using the JSON format, NeoLoad facilitates the handling of the requests and responses by showing you the XML tree and allowing you to use for instance Xpaths expressions in the content extractors. http://www.neotys.com/documents/doc/neoload/latest/en/html/index.html#862.htm#o867
About SOAP, which brings new operations over HTTP(s), NeoLoad has a module to decode the calls. With NeoLoad, you can load test your webservices based on SOAP
http://www.neotys.com/documents/doc/neoload/latest/en/html/index.html#839.htm

How SOAP and REST work with XML/JSON response?

This is one very common question asked again and again on stack overflow and I read so many answers about this but I am still bit confused.
I need to call the webservices from iPhone sdk.
Here are my questions:
I am not clear what response SOAP or REST return.Is there anything specific that if response is XML then we should use REST and if JSON we should use SOAP?
What is the role of ASIHTTP with SOAP and REST?
If I am getting XML response as
<oproduct>
<iid>113133791</iid>
<icategoryid>270</icategoryid>
<imerchantid>1547</imerchantid>
<iadult>0</iadult>
<sname>The Ashes / 1st Test - England v Australia - Day 1</sname>
<sawdeeplink>http://www.acbcd.com/pclick.php?p=113133791&a=111402&m=1547&platform=cs</sawdeeplink>
<sawthumburl>http://images.abcdd.com/thumb/1547/113133791.jpg</sawthumburl>
<fprice>69.99</fprice>
</oproduct>
Do I need to parse it by hand? or how do I handle XML response?
I got so many articles about REST and SOAP but no proper code to understand it.
I would be grateful for any help regarding these questions.
SOAP - "Simple Object Access Protocol"
SOAP is a method of transferring messages, or small amounts of information, over the Internet. SOAP messages are formatted in XML and are typically sent using HTTP (hypertext transfer protocol).
So SOAP has a standard how a message has to be sent.
Each soap web service can be defined with a WSDL(Web Service Definition Language) which is kind of a schema for the SOAP XML transferred.
There are many tools available to convert WSDL(your webservice definition) to native code.
One of the tool available for ObjC is Sudz-C (http://sudzc.com/) which convert the WDSL of any webservice to ObjC code to access the Web service.
Rest - Representational state transfer
Rest is a simple way of sending and receiving data between client and server and it don't have any much standards defined , You can send and receive data as JSON,XML or even a Text. Its Light weighted compared to SOAP.
To handle Rest in iOS there are many tools available, I would recommend RestKit http://restkit.org/, for handling XML and JSON both.
I would suggest you to go with Rest for mobile development, since its light weight
(Simple example, People correct me If I am wrong)
Ok, so you have a few different questions here:
REST is a way of accessing the web service. SOAP is an alternative way of accessing the web service. REST uses query string or URL format whereas SOAP uses XML. JSON and XML are two different ways of sending back data. SOAP and XML are usually associated with each other. For mobile apps, REST/JSON is usually the way to go. Easier to implement and maintain, far more telegraphic, etc.
ASIHTTP, as Bill notes, is a wrapper. There are other choices that do similar things depending on what you need. If you are using REST/JSON then NSURLConnection + SBJSON might do the trick, I like it personally.
If your SOAP service has an available WSDL you can use wsdl2objc to automatically build the code for your parsing and fetching. If it is a JSON service or no WSDL is available, I would recommend using SBJSON and simply parsing in the following way:
for (id jsonElement in repsonse) {
self.propertyA = [jsonElement valueForKey:#"keyA"];
self.propertyB = [jsonElement valueForKey:#"keyB"];
}
Hope that helps!
1) SOAP responses must be XML, and to return other formats you need to either embed them in the response XML (inefficient) or use SOAP attachments (difficult). SOAP responses are contained in a soap envelope tag, and there is usually an associated wsdl. If the XML you show is all you're getting, then it may not be a SOAP service. I see links in the XML so that is a good sign that they had REST in mind.
2) I haven't heard of ASIHTTP. A quick google, and it looks like its a third party library that wraps the http interfaces in iOS. It looks like you would use that to help you make the http requests, although I would suggest that it might not be necessary; you should evaluate using the http libraries directly.
3) You need to parse it somehow. You can do it by hand, but that is generally a really bad idea. XML can come in many forms and still have the same meaning, and if you don't support all forms your application could break in the future if the web service provider began to format their XML differently, even if its semantics were the same. You would use an XML api to read the XML. The DOM api will read it into a tree form for you, and you can use XPath to extract information out of the tree.

SOAP Requests in Dojo

I am trying to make a call to a SOAP web service through Dojo, but have found no relevant, up-to-date documentation on how to make a SOAP request.
Does anyone have any experience making a SOAP request in Dojo?
IBM has something here. Unfortunately, it's not supported in Dojo. However, this library could be of use for JavaScript to SOAP connectivity.