• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

minOccurs=0 i can remove tag?

 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 1051
5
Hibernate Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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


 
Ranch Hand
Posts: 734
7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When in doubt, refer to the documentation of the WS. If there is none, proceed with caution :-)
 
I am mighty! And this is a mighty small ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic