4

So my WS-Trust server deployed on JDK1.8.0_161 environment is expecting a request which will contain xml nodes of type org.apache.xerces.dom.ElementNSImpl, but when the request comes, the nodes are of type com.sun.org.apache.xerces.internal.dom.ElementNSImpl, which is not making me not read the data from request. I am using xerces:xercesImpl:2.11.0 library, but wondering if JDK is messing up with the request parsing on server end. Currently I only see rt.jar that contains com.sun.org.apache.xerces.internal.dom.ElementNSImpl. What am I missing? Have anyone seen this error?

yogsma
  • 10,142
  • 31
  • 97
  • 154
  • [yogsma] It seems you make ws-trust work with Java. Could you share your knowledge? :) – mzy Jun 16 '20 at 13:41
  • 1
    @mzy - I have number of posts on my blog betterjavacode.com for WS-Trust. – yogsma Jun 16 '20 at 13:46
  • I found only one article https://betterjavacode.com/category/apache-cxf. Do I search in right category? – mzy Jun 16 '20 at 13:55
  • 1
    Send me email from the website. Website is currently going through maintenance, so you are not seeing all search results – yogsma Jun 16 '20 at 14:10

1 Answers1

5

I solved this problem by using Element as interface rather than using implementation ElementNSImpl. This will make the implementation environment independent.

So the code looks like this

if(object instanceof org.w3c.dom.Element)

instead of

if(object instanceof ElementNSImpl)
yogsma
  • 10,142
  • 31
  • 97
  • 154