Payload for Mock without Target- 6 MB XML Response with JavaScript

Hi,

Have a Mock for SOAP Service (in Cloud Apigee platform) which have to to return 3 to 6 MB of XML data. this SOAP data have X12 and HTML data inside it.

I have put the the Payloaad to Javascript

var responseobj='<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetRequiredResponse xmlns="https//mynamespace.com/"><GetRequiredResult><hello><world>1 -all big HTML Response<hello><world></GetRequiredResult></GetRequiredResponse>';

This is Mock responseobj from Java script with size of 3MB to 6MB in Apigee Cloud for Mock Response to requester

I wasn't sure if there is better way to implement it instead of handling this in java script any other alternative or Please suggest.

Reason is, if there is change in response information or full XML replacing or debugging any error resolution or saving such content takes time.

0 1 253
1 REPLY 1

I wouldn't use Javascript for this, as you will have many problems escaping certain characters.

Instead I would use API Mocker, as it supports XML too.

There is a great article written by Miren here: https://community.apigee.com/content/kbentry/27779/how-to-mock-a-target-backend-with-a-nodejs-api-pr...

I hope this helps!!