I\'m trying to consume a web service exposed by a provider. The Provider has a strict checking at his end that the request xml should not contain tags which don\'t have valu
This is a problem of the XML Serializer that you are using (If you did not do something special it should be JAXB).
The "null policy" of the serializer should be configurable, but I think is not possible with JAXB. If you use MOXy you can use XmlMarshalNullRepresentation.ABSENT_NODE to do not write the node if it is null. The implementation should be something like this:
class MyClass {
// ... here are your other attributes
@XmlElement (name = "strIpAddress")
@XmlNullPolicy(nullRepresentationForXml = XmlMarshalNullRepresentation.ABSENT_NODE)
String strIpAddress = null;
}
PS: Maybe you need to define also the emptyNodeRepresentsNull param of the @XmlNullPolicy.
For more information about this subject, please check this question