1/22
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What was the historical problem with SOAP in Java?
Early versions were complex, with details very exposed to the programmer.
What does WSDL stand for and what’s its purpose?
Web Service Description Language
SOAP uses WSDL to define what the service does.
What format is a WSDL file written in?
XML
What are annotations in Java used for?
To tag code with metadata or instructions that the compiler or runtime can use.
What happens if you use @Override
on a method that doesn’t override anything?
The compiler throws an error, helping catch mistakes.
What is the Java annotation used to define a web service class and what does it do?
@WebService
It generates the code to accept SOAP requests, call the Java method, and return the result as XML.
What model does SOAP web service code follow? — check
Inversion of control – the framework controls the flow and calls your code. — check
what is a package and how should you come up with a globally unique package name
defines a namespace (way of uniquely defining services)
should all be in lowercase
Use your host name in reverse, e.g., uk.ac.swansea
.
What does "tightly coupled" mean in distributed systems?
what’s it best for? and what are the pros and cons?
the client depends heavily on the server API (e.g. defined method names, parameters, and return types)
specific methods for each data type e.g. getRainfall(Location, time)
pros:
good for when you have full control over both server and client
cons:
hard to switch providers - may require re-writing your client
What does "loosely coupled" mean in distributed systems?
what’s it best for? and what are the pros and cons?
the client depends only on the data structure not specific methods
eg. one method returns a full document
best for when you want flexibility, or might change providers
pros:
easier to change
easier to swap services
lower risk
cons:
more client responsibility - client must extract what it needs from a large document
What is the risk of using a tightly coupled service provider?
If the provider goes out of business or changes pricing, the client must potentially rewrite large parts of the system to adapt.
What does POJO stand for?
Plain Old Java Object – a simple Java class with no special restrictions or requirements.
Can you send Java objects over web services?
Not directly – only data is sent. Clients infer class structure from the data and reconstruct it.
What is a Java Bean?
restricted type of POJO:
must have:
private fields,
public no-argument constructor,
public set/get methods for each field.
often implements serializable
good for automatically converting between java and JSON/XML
Why are Java Beans useful in web services?
They allow automatic generation of code for serialization/deserialization of data structures.
What does the Java Reflection API allow?
It allows code to inspect the accessible parts of a class at runtime, including getters/setters.
What’s the key limitation when using POJOs in web services?
You can only "send" data; any methods added won't be usable on the client.
What is a Java Record?
A quick way to create immutable data classes with:
auto generates:
constructor,
getters,
equals(), hashCode(), toString().
can’t be used where frameworks need to set fields after creation
Can you use Records in REST APIs?
Not always – many REST libraries require set methods and a no-arg constructor, which records do not have.
What is a Spring Bean?
In Spring, it's any object managed by the Spring framework, not necessarily a Java Bean
what does RPC mean?
Remote Procedure Call
includes the method name in the SOAP message
only supports simple return types
used in tight coupling
what is binding and what are the two types?
defines how the client and server communicate
tells the system:
how to format XML
what transfer protocol to use
types:
RPC (Remote Procedure Call)
Document style
explain document style for binding
you send a document / structured XML
supports complex data types
used in loose coupling