• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Unmarshalling Error: unexpected element

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,

I am getting "Unmarshalling Error: unexpected element" when I hit a web service SOAP xml request having unknown element.
It is known to me, this error is occurred due to missing element in xsd. It will work when unknown element will be defined in xsd.
My expectation: It shouldn't be happen, if unknown element is given from request, if it is then I want to understand/know the logical reason behind this scenario.

Help me to understand why this exception is raised when unknown element is passed through request.

Thanks in advance,
Prakash
 
Saloon Keeper
Posts: 15510
363
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The schema doesn't specify that the element is allowed, so you get an error when you send the element anyway. What else is there to understand?

If you want to send elements that you haven't explicitly described in the schema, you must add an <xs:any> element to your schema.
 
Kumar Prakash
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Thank you Stephan, it is helpful. But after adding <xs:any> I got below error in .xsd file.
cos-nonambig: "http://www.xyz.com/xml/Input":fieldName and WC[##any] (or elements from their substitution group) violate "Unique Particle Attribution". During validation against this schema, ambiguity would be
created for those two particles.
Could you please suggest something to handle above error.

Thanks in advance,
Prakash
 
Stephan van Hulst
Saloon Keeper
Posts: 15510
363
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What XML version is your schema? If it's 1.0, can you upgrade it to 1.1?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic