How can I leave margins from the answer to axis 2 soap?

I have an Axis2 web service that queries the status of some objects. Objects may or may not exist on the server.

The web service is implemented using POJO, and the wsdl is generated using the java2wsdl tool.

Suppose the relevant part of the SOAP response looks like this:

   string INT INT string ......

I want to do the following: - when the object is in the list of objects, I want all fields to have a value and be sent to the client. - when the object is not found in the list of objects, I want the objectName and objectStatus fields to have values ​​and be sent to the client. Other object property values ​​must not be present in the SOAP message.

How can i do this?



source to share

1 answer

I would add a flag boolean

to Response, something like isObjectPresent

. Then your clients can look at this flag to determine if the object is "present" or not. Any values ​​that you do not specify in the response object will have default values ​​(int = 0, String = ""), but this way you can signal the client to ignore these fields.



All Articles