{ Community }
  • Academy
  • Docs
  • Developers
  • Resources
    • Community Articles
    • Apigee on GitHub
    • Code Samples
    • Videos & eBooks
    • Accelerator Methodology
  • Support
  • Ask a Question
  • Spaces
    • Product Announcements
    • General
    • Edge/API Management
    • Developer Portal (Drupal-based)
    • Developer Portal (Integrated)
    • API Design
    • APIM on Istio
    • Extensions
    • Business of APIs
    • Academy/Certification
    • Adapter for Envoy
    • Analytics
    • Events
    • Hybrid
    • Integration (AWS, PCF, Etc.)
    • Microgateway
    • Monetization
    • Private Cloud Deployment
    • 日本語コミュニティ
    • Insights
    • IoT Apigee Link
    • BaaS/Usergrid
    • BaaS Transition/Migration
    • Apigee-127
    • New Customers
    • Topics
    • Questions
    • Articles
    • Ideas
    • Leaderboard
    • Badges
  • Log in
  • Sign up

Get answers, ideas, and support from the Apigee Community

  • Home /
  • Edge/API Management /
avatar image
0
Question by Mikael.Wozniak · Feb 01, 2016 at 05:32 PM · 1.3k Views soapjsonjson payloadsoap to restrest

Rest > Soap (using POST), json payload parameters are not propagated

Hi,

I need to use a Soap API and expose it as REST.

Something just like the Weather API discussed in the tutorial/doc

http://docs.apigee.com/tutorials/proxy-soap-service

However, in my case, instead of using GET, I have to use POST with the parameters in a json payload.

So instead of doing this

GET http://mikaelw-test.apigee.net/weatherrest/cityweatherbyzip?ZIP=07030

I need to do this:

POST http://mikaelw-test.apigee.net/weatherrest/cityweatherbyzip

{
    "ZIP":07030
}

with apigee taking the parameter from the posted json payload and making the normal SOAP call with it.

At the moment, it doesn't seem to work, the call reach the target but without the parameter. It returns:

{
    "GetCityWeatherByZIPResponse":{
        "GetCityWeatherByZIPResult":{
            "Success":"false",
            "ResponseText":"Invalid ZIP",
            "State":{
            },
            "City":{
            },
            "WeatherStationCity":{
            },
            "WeatherID":-1,
            "Description":{
            },
            "Temperature":{
            },
            "RelativeHumidity":{
            },
            "Wind":{
            },
            "Pressure":{
            },
            "Visibility":{
            },
            "WindChill":{
            },
            "Remarks":{
            }
        }
    }
}

What should i do to make sure parameters are taken from my json payload and propagated to the SOAP target call? Many Thanks

Comment
Add comment
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Close

1 Answer

  • Sort: 
avatar image
0
Best Answer

Answer by Mikael.Wozniak · Feb 01, 2016 at 05:47 PM

Actually, this is all related to those ExtractVariable block.

See this: http://docs.apigee.com/api-services/reference/extract-variables-policy

So in this case, something like this should be used:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ExtractVariables async="false" continueOnError="true" enabled="true" name="GetCityWeatherByZIP-extract-form-param">
    <DisplayName>GetCityWeatherByZIP Extract Form Param</DisplayName>
    <Source clearPayload="true|false">request</Source>
    <JSONPayload>
        <Variable name="ZIP" type="string">
            <JSONPath>$.ZIP</JSONPath>
        </Variable>
    </JSONPayload>
    <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
</ExtractVariables>

in Api > Develop > policy (the one corresponding to the first step of your PUT)

Comment
Add comment · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Follow this Question

Answers Answers and Comments

30 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Rest to Soap To Rest Conversion - Apigee strips out namespaces after editing AssignMessage Policy 0 Answers

SOAP to REST API - XML to jSON transformation issue 2 Answers

What does "ArrayElementCount" in JSON Threat Protection Policy means? 2 Answers

JSON string to be extracted from header 1 Answer

How do I send JSON body to my POST request in Javascript and same way do do I get JSON response in my APIGEE api proxy program 2 Answers

  • Products
    • Edge - APIs
    • Insights - Big Data
    • Plans
  • Developers
    • Overview
    • Documentation
  • Resources
    • Overview
    • Blog
    • Apigee Institute
    • Academy
    • Documentation
  • Company
    • Overview
    • Press
    • Customers
    • Partners
    • Team
    • Events
    • Careers
    • Contact Us
  • Support
    • Support Overview
    • Documentation
    • Status
    • Edge Support Portal
    • Privacy Policy
    • Terms & Conditions
© 2021 Apigee Corp. All rights reserved. - Apigee Community Terms of Use - Powered by AnswerHub
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • Product Announcements
  • General
  • Edge/API Management
  • Developer Portal (Drupal-based)
  • Developer Portal (Integrated)
  • API Design
  • APIM on Istio
  • Extensions
  • Business of APIs
  • Academy/Certification
  • Adapter for Envoy
  • Analytics
  • Events
  • Hybrid
  • Integration (AWS, PCF, Etc.)
  • Microgateway
  • Monetization
  • Private Cloud Deployment
  • 日本語コミュニティ
  • Insights
  • IoT Apigee Link
  • BaaS/Usergrid
  • BaaS Transition/Migration
  • Apigee-127
  • New Customers
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Badges