Announcement Announcement Module
No announcement yet.
XML Escape Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • XML Escape


    We have recently started out with Spring WS. We now have 2 (beta) services available for our clients. Today, accidentally, I discovered that xml entities are not escaped by Spring WS. So I guess we will have to do it our selves as our clients may call our webservices using "any" WS client, the latter perhaps not being able to escape xml entities.

    What would be the best way to solve this?

    any help on this matter would be greaty appreciated,


  • #2
    Converting characters like <, >, & to proper XML entities is the responsibility of the underlying XML mechanism (i.e. the DOM tree, or the marshaller). So the question here is: what mechanism are you using to create the XML response messages?


    • #3

      Sorry for the misunderstanding, my mistake. But I am talking about the incoming requests. What is your opinion about this? Should the client provide valid XML (with escaped entities) or else receive a SOAP Fault or should the WebService implementation (Spring WS with XML Beans marshaller) provide some kind of functionality to escape incoming XML? If so where or how should this be done (some kind of interceptor)?




      • #4
        In my opinion, clients should send valid XML. Unescaped entities are not valid XML. Using an interceptor will not help you, since the interceptor presupposes XML as well. The only way to do it is at the transport level, but I would not recommend that, since it will get ugly.