Skip to main content
11-Garnet
April 28, 2017
Solved

Executing a service by "Using a Custom Reports from Windchill" throws error in ThingWorx

  • April 28, 2017
  • 13 replies
  • 5661 views

I created a new service to execute Windchill Report Manager Report and fetch the result in ThingWorx. But when I execute the service, I get the following error. All out of the box services in "ptc-windchill-demo-thing" works without any issue. I do not see any error in Windchill logs as well. pls help.

Error Message:

Wrapped com.sun.xml.ws.encoding.soap.DeserializationException: Failed to read a response: javax.xml.bind.UnmarshalException - with linked exception: [com.ctc.wstx.exc.WstxUnexpectedCharException: Illegal character (NULL, unicode 0) encountered: not valid in any content at [row,col {unknown-source}]: [42,207]] Cause: Failed to read a response: javax.xml.bind.UnmarshalException - with linked exception: [com.ctc.wstx.exc.WstxUnexpectedCharException: Illegal character (NULL, unicode 0) encountered: not valid in any content at [row,col {unknown-source}]: [42,207]]

13 replies

20-Turquoise
April 28, 2017

The error is caused by an illegal character in the response returned and is related to the source data. The XML library is halting its interpretation of the data because of the invalid data. The problem that causes these XmlExceptions is that the data being read or loaded contains characters that are illegal according to the XML specifications. Almost always, these characters are in the ASCII control character range (for example, characters like null, bell, backspace, etc). They’re illegal characters that should be removed, usually having found their way into the data from file format conversions, like when someone tries to create an XML file from Excel data, or export their data to XML from a format that may be stored as binary.

The above exception seems to occur because of string containing zeros in the last chunk. In the last continous zeros make null[as in ascii/utf-8] so it is throwing and exception . To troubleshoot I'd recommend the following:

  • Copy into a text editor
  • Enable the display of all extended characters
  • Review the data and determine where the malformed data is and remove it from the source data
11-Garnet
April 28, 2017

Polina, Thank you so much for your reply. This really is helpful to understand why I get this error. My question with regards to your reply is


1. I am able to run the exact Windchill - Report Manager report with same exact input criteria and i get the result with no issue. I also did not see any error in Windchill error log. Does this fact change any of your rationale for this error?

2. The troubleshoot steps you mentioned is flying on top of my head . I could not understand. What should I copy in to the text editor? any help on how to copy will also help.

Thanks again for your help in this issue!

20-Turquoise
April 28, 2017

I'm honestly not too familiar with the nuances of Windchill, I'm just analyzing this particular error in general, from the XML perspective. I apologize for being unclear. Perhaps, Windchill Report Manager is not manipulating  XML and that's why the problem doesn't occur. I was thinking of copying the source data and, again judging by the error, looking at this line especially - [row,col {unknown-source}]: [42,207] to check for funky characters. I hope this helps!

11-Garnet
May 2, 2017

No worries, and thanks for the clarifications!

Do you know how to get the XML response that ThingWorx is reading while throwing this error?

20-Turquoise
May 2, 2017

Perhaps, you could try fiddler Fiddler - Free Web Debugging Proxy - Telerik to see what is being returned? There also should be an entry in Apache access.log for Windchill - the URL can be used to call in the browser and should give the xml source.

Also, you open your browser tools (f12 in chrome) and watch activity in network and console tabs - are you able to see any errors that might give more details?