Common JAXRPC error - unexpected element name
If you are using JAXRPC, there is an error message that may be hard to connect back to the root cause of the problem. The error message reads something like:
unexpected element name: expected=FileMetadata, actual={urn:FileUpload}FileMetadata.
There may be multiple causes for this error message. The first you want to look at is the flavor of XML schema advertized in the WSDL.
The default value for the elementFormDefault attribute is unqualified (see the w3c spec), which is what the error message above is trying to convey. In the schema section of your WSDL, make sure you can find the declaration: elementFormDefault="qualified"
Sometime, this get lost in the edits of the WSDL file, and many Web Services toolkits wont validate on the consumer side (Axis and .NET are among those). If you cannot alter the original WSDL, make a local copy that you can use to generate your artifacts, then contact the service provider so that they can make the change. The WS-I tools should be able to help you detect this kind of issues with minimal efforts.
unexpected element name: expected=FileMetadata, actual={urn:FileUpload}FileMetadata.
There may be multiple causes for this error message. The first you want to look at is the flavor of XML schema advertized in the WSDL.
The default value for the elementFormDefault attribute is unqualified (see the w3c spec), which is what the error message above is trying to convey. In the schema section of your WSDL, make sure you can find the declaration: elementFormDefault="qualified"
Sometime, this get lost in the edits of the WSDL file, and many Web Services toolkits wont validate on the consumer side (Axis and .NET are among those). If you cannot alter the original WSDL, make a local copy that you can use to generate your artifacts, then contact the service provider so that they can make the change. The WS-I tools should be able to help you detect this kind of issues with minimal efforts.
Comments
You were right, the error was hard to relate with the solution of the problem especially with the error log that it gave. Anyways...
Thank you so much.