I get error while connecting to my web service:
javax.xml.ws.soap.SOAPFaultException: Unmarshalling Error: unexpected element (uri:"", local:"OrderID"). Expected elements are <{}Login>,<{}CrewId>,<{}OrderID >,<{}OrderNumber >
Service is exposed using org.apache.cxf.transport.servlet.CXFServlet
and jaxws:endpoint
annotation. The client is generated using CXF. Firstly, suprising for me is that I'm using the same technology on both ends and the solution is not working, secondly, this mysterious {} in error messages.
So, what is wrong and how to understand this {}?
Have you noted space between OrderID and '>'? Expected is <{}OrderID > and you send >"OrderID". Check if you don't have spaces in your element names.
While the above answer from Stepan Vihor helped you get what you needed, let me answer your question of what the "{}" means:
It means that the JAX-B Unmarshaller is expecting your OrderID element to have no namespace, i.e. the namespace uri for that element needs to be equal to "".
See here for a brief intro on XML Namespaces
Have you noted space between OrderID
and '>'? Expected is <{}OrderID >
and you send "OrderID"
. Check if you don't have spaces in your element names.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With