• Post Reply Bookmark Topic Watch Topic
  • New Topic

minOccurs=0 i can remove tag?  RSS feed

 
Dora Di Donato
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,
I am testing a request with optional tag, that I think those are minoccurs=0,but I have to leave those empty or I can remove those tags?


Thanks
D. Di Donato
 
James Boswell
Bartender
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by leave empty or remove? Leave or remove from what? The XML schema?
 
Dora Di Donato
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the request of soapUI I hava some tag optional like this :

<!--Optional:-->
<tem:userName>?</tem:userName>
when I test this request I can :
- to remove this tag from request of soapui ?
- i can leave this empty?
<!--Optional:-->
<tem:userName></tem:userName>


thanks

D. Di Donato


 
g tsuji
Ranch Hand
Posts: 697
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When an element be optional, the suggestion SOAPUI makes may look like what you showed and seen. That feature is controlled by the Preference > WSDL tab's Include Optional select box. If the box is unselected, that optional elements might even not appear in the template request. That may spare you some effort but the disconvenience is that you might not aware that optional elements could exist and of what names... and that, from time to time, you might want them to be there with data.

Now to the question itself,
I have to leave those empty or I can remove those tags?

If you do not have data to that regard to send as request, the proper thing to do is to "remove" them. If you leave them empty, it means the data of that tag be empty string, strictly speaking, it is not the same thing as it being removed.

Having said, some ws has a very approximative schema and that the behaviour in terms of response may very well be just the same as it being left there with empty (or even with some white spaces). This can only be qualified as a compromise between drafting a more rigorous schema and the convenience of drafting an approximative schema. That happens more often than one might think. But the proper thing to do if you mean no data at all is to remove them.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When in doubt, refer to the documentation of the WS. If there is none, proceed with caution :-)
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!