Step 5: Change the target endpoint

This page applies to Apigee and Apigee hybrid.

View Apigee Edge documentation.

Change your proxy's target endpoint to one that returns more meaningful data.

  1. Expand the helloworld API proxy bundle and click default.xml in the targets folder to open the file in the editor.

    default.xml target endpoint file

  2. Update the <URL> element to append xml to the existing URL:
    <TargetEndpoint name="default">
      <HTTPTargetConnection>
         <URL>https://mocktarget.apigee.net/xml</URL>
      </HTTPTargetConnection>
    </TargetEndpoint>
  3. Select File > Save or ⌘S to save your edits.
  4. To redeploy the environment, position your cursor over the dev environment folder and click Deploy icon to redeploy an Apigee environment.

    Deploy icon displays when you position the cursor over dev environment folder

  5. When prompted to select a test bundle to export, click Deploy without a test bundle because the test bundle has already been exported.

    Prompt to export test bundle

  6. Run your API in the Terminal tab.
    curl 0:8998/helloworld?apikey=ZQA5euYtNeJ7ZCGCJMpvd6F2BZOmxOzY

    The following response is returned:

    <?xml version="1.0" encoding="UTF-8"?>
      <root>
        <city>San Jose</city>
        <firstName>John</firstName>
        <lastName>Doe</lastName>
        <state>CA</state>
      </root>
    

In the next step, you'll add a new policy to your API.

1 2 3 4 5 (NEXT) Step 6: Attach a policy 7 8