Tech-Today
How to call java rest web service in soapUI
The following code is an explanation of how you can call a rest web service in java. Below you can find the actual java code and soapUI configuration. We enumerate 3 type of methods namely: POST, PUT and DELETE.
How to call rest web service using soapUI
public class Person {
private int id;
private String firstName;
private String lastName;
}
@POST
@Path("/")
public ActionStatus create(Person postData) {
}
In soapUI
Method=POST
MediaType=application/json
Json String=
{
"firstName" : "edward",
"lastName" : "legaspi"
}
@PUT
@Path("/")
public ActionStatus update(Person postData) {
}
In soapUI
Method=PUT
MediaType=application/json
{
"id" : 1,
"firstName" : "edward",
"lastName" : "legaspi"
}
@DELETE
@Path("/{personId}")
public ActionStatus delete(@PathParam("personId") Long reservationId) {
}
In soapUI
Method=DELETE
Request Parameters=
name=personId
value=1
/> level=resource
Your resource should look like: /xxx/{personId}
-
Display A Byte[] Image From A Rest Web Service
This tutorial will not delve into angular nor will we discuss what a directive is. We will not try to explain what a rest web service is. Instead we will provide a demonstration via actual code, how we can consume a rest service from angular that returns...
-
How To Set Basic Authentication Setting In Soapui Testsuite Project
This post assumes that you already have soapUI installed on your machine with testCases and testSuite. Our problem is when we have several testCases inside a testSuite that needs to be authenticated with BASIC. There are 3 ways as described here: http://thewonggei.com/2010/08/05/configure-http-basic-auth-once-for-soapui-test-suties/....
-
Java Generics And Multiple Parameterized Class With Inheritance
This tutorial will try to explain how to use multiple generic parameters in Java and also along the way the advantage of using this feature. Normally I use this when I have a method in a base class that returns a generic type. For example: public class...
-
Creating And Testing A Web Service Using Soap Ui
I just want to share a simple example on how to create and test a web service on java. Download and install the following: 1.) eclipse java (client) 2.) eclipse jee (web service) 3.) jboss 5.1 AS 4.) soap ui, get the stand alone (http://www.soapui.org/)...
-
Entity Framework Inserting Or Updating A Table With Foreign Key
For example you have 2 lookup entities: Country and Province And Your Person Entity has country and province field. In short both CountryId and ProvinceId are foreign keys to Person table. How to setup the Insert Statement (Update is almost the same,...
Tech-Today