SOAP Web Services can be platform and language independent. And can accept parameters from client and can send response back to the client. Ex - I can pass a city as string parameter and get back weather information as response.
But what if I have to pass a java object - say person object and get back his credit score.
(say person object has atributes like name, age, ssn, address etc)
(and address itself can be another java object with attributes like - street, city, zip etc)
Can the SOAP service accept the object right away or the person object needs to be passed after extracting all the primitive information and this information needs to be passed to the service as strings or ints only - as (name, age, ssn, street, city, zip)
Can the SOAP service accept the object right away or the person object needs to be passed after extracting all the primitive information and this information needs to be passed to the service as strings or ints only ?
You need to know the below points:
(1) SOAP is a protocol with some predefined specifications/format (with header, body, etc. elements) for data exchange across two different applications (developed with the same or different programming languages).
(2) When you are consuming a SOAP service, you are the SOAP client.
(3) When you have exposed/provided a SOAP service for other users, you are the SOAP service provider.
(4) SOAP services do NOT use the java objects directly as they are. Rather, they will be converted into xml (called marshaling) and then sent/received.
(5) So, when you call a SOAP service provider, your
person java object will be marshalled into an xml format and sent to the SOAP service provider.
(6) SOAP service provider will receive the xml and convert into their representation (called unmarshalling) according to their platform i.e., it could be Java or .net or any other.
(7) After processing the request, SOAP service provider will prepare the response (Object/something converted to xml) and send it to the caller.
P.S.: I have just mentioned the message format as xml (which is common) for your understanding, but it could be any other format the applications could be agreed with.
You can look here for more details.