You need to sign in to do that
Don't have an account?

Marshalling and Unmarshalling XML with Force WSC
Hi, I'm having some problems handling XML files with the Force WSC. First, an issue with unmarshalling CustomObject files:
com.sforce.ws.ConnectionException: UTF-8Not a valid enumeration for type: class com.sforce.soap.metadata.Encoding
I can see that the enumeration com.sforce.soap.metadata.Encoding is expecting "UTF_8" rather than "UTF-8", however the metadata is retrieved with the hyphen. Do I really have to find and replace this case before I can unmarshal the file properly? For the record, I used Force WSC to create these classes, Force WSC to retrieve the metadata, and I am using Force WSC to unmarshal the files. Is this framework incompatible with itself?
The issue with marshalling those CustomObject files is that I can't seem to save them in the same format that they were downloaded in. Whenever I marshall a metadata object to an XML file, it adds namespace prefixes ("n1:") to every tag, which is not how I want to store the data. So is there any way to marshal these files without the namespace prefixes, or will I have to do this myself after they are written?
Thanks in advance.
Hi JSandfort,
Were you able to resolved this issue ? I having this simillar exception while loading metedata from an object XML.
thanks,
Pradeep
I was wrong in the second issue (updated), it is possible to umarshal objects in this format with the WSC, but it's still less than ideal that it can't be written in the same format that it was loaded from.
Can you do me a favour, please help me with the changes you made to the parser in Force WSC ?
thanks in advance!!
1. Download the WSC source from github: https://github.com/forcedotcom/wsc
2. Add the whole shebang to your project (in principle, it should be enough to just add com.sforce.ws.bind.TypeMapper, since that's where the hack is).
3. In line around 620, replace this:
with this:
This will make the eliminate the UTF_8 error....
Error: com.sforce.ws.ConnectionException: UTF-8Not a valid enumeration for type: class com.sforce.soap.metadata.Encoding