Chapter 7 - SOAP Services

0.0(0)
studied byStudied by 11 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/22

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

23 Terms

1
New cards

What was the historical problem with SOAP in Java?

Early versions were complex, with details very exposed to the programmer.

2
New cards

What does WSDL stand for and what’s its purpose?

Web Service Description Language

SOAP uses WSDL to define what the service does.

3
New cards

What format is a WSDL file written in?

XML

4
New cards

What are annotations in Java used for?

To tag code with metadata or instructions that the compiler or runtime can use.

5
New cards

What happens if you use @Override on a method that doesn’t override anything?

The compiler throws an error, helping catch mistakes.

6
New cards

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.

7
New cards

What model does SOAP web service code follow? — check

Inversion of control – the framework controls the flow and calls your code. — check

8
New cards

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.

9
New cards

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

10
New cards

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

11
New cards

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.

12
New cards

What does POJO stand for?

Plain Old Java Object – a simple Java class with no special restrictions or requirements.

13
New cards

Can you send Java objects over web services?

Not directly – only data is sent. Clients infer class structure from the data and reconstruct it.

14
New cards

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

15
New cards

Why are Java Beans useful in web services?

They allow automatic generation of code for serialization/deserialization of data structures.

16
New cards

What does the Java Reflection API allow?

It allows code to inspect the accessible parts of a class at runtime, including getters/setters.

17
New cards

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.

18
New cards

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

19
New cards

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.

20
New cards

What is a Spring Bean?

In Spring, it's any object managed by the Spring framework, not necessarily a Java Bean

21
New cards

what does RPC mean?

Remote Procedure Call

includes the method name in the SOAP message

only supports simple return types

used in tight coupling

22
New cards

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

23
New cards

explain document style for binding

  • you send a document / structured XML

  • supports complex data types

  • used in loose coupling