Adding DOCTYPE tag in request payload using apigee policies

amitkumar2091
Participant III

Hi All ,

Unfortunately , I have to consume a jsp as target through apigee , for that i am trying to create a text/xml or text/html request payload using apigee policies.There is doctype tag mandatory for request.

<!DOCTYPE someService PUBLIC "-//placeholder//DTD placeholder placeholder v1//EN" "http://dtd.paceholder.com/someService_v1.dtd">

Rest of the xml is fine but i am not able to add mentioned tag in request using AssignMessage or javascript policy.This is a static tag.

Getting Invalid xml error from assign message.

Full request payload needed for backend.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE someService PUBLIC "-//placeholder//DTD placeholder placeholder v1//EN" "http://dtd.paceholder.com/someService_v1.dtd">
<someService version="1.4" placeholder="hello"> 
   <submit>
	....
   </submit>
</someService>

Please let me know , if there is a way to achive this.

Solved Solved
0 2 399
1 ACCEPTED SOLUTION

You could use an XSLT that sets the doctype and use the XSL Transform Policy.

If you're thinking of using a javascript approach, this would also work, but how will your solution and backend work if the xml version isnt set? Should you also verify that's set or include it as part of a javascript solution too?

View solution in original post

2 REPLIES 2

You could use an XSLT that sets the doctype and use the XSL Transform Policy.

If you're thinking of using a javascript approach, this would also work, but how will your solution and backend work if the xml version isnt set? Should you also verify that's set or include it as part of a javascript solution too?

XSLT works perfectly !!! Thanks @dane knezic .