{ 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
    • 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 /
  • Developer Portal (Drupal-based) /
avatar image
0
Question by Lee Grey · Jan 09, 2015 at 03:45 AM · 2k Views SmartDocswadl

How do I create a WADL for a POST with a mediaType of application/x-www-form-urlencoded?

I have created a WADL for import into SmartDocs (see below).

When I place the param elements inside of the representation element, I cannot see any parameters at all in SmartDocs.

With the version below (params appear outside of the method element), I can see the parameters in SmartDocs, but they are sent in the querystring, rather than in the request body. And the params that have a default value are not sent at all, not even in the querystring.

How do I get all the parameters to be sent as form data?

<resource path="oauth/v2/accesstoken"> <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" name="grant_type" style="query" default="authorization_code"> </param> <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" name="code" style="query"> </param> <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" name="client_id" style="query" default="CxTsuE36CG0PVGnOhZiqJPw0x6uEAAiv"> </param> <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" name="client_secret" style="query" default="YteFcBy4814u8vUC"> </param> <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" name="redirect_uri" style="query" default="http://demo26-test.apigee.net/identity_app/callback"> </param> <method id="accesstoken" name="POST" apigee:displayName="Access Token"> <apigee:tags> <apigee:tag primary="true">Access Token</apigee:tag> </apigee:tags> <apigee:authentication required="false"/> <doc apigee:url="http://demo26-test.apigee.net/oauth/v2/accesstoken"> Returns an access token. </doc> <request> <representation mediaType="application/x-www-form-urlencoded"> <apigee:payload required="true"> <apigee:content> </apigee> </apigee> </representation> </request> </method> </resource>
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

3 Answers

  • Sort: 
avatar image
0
Best Answer

Answer by Lee Grey · Jan 09, 2015 at 04:08 AM

I'm sure this is not the "right" way, but I was able to get a successful response using this. The SmartDocs experience of providing the value for code is definitely not the way it should be.

I would like to know how an expert would do this.

        <resource path="oauth/v2/accesstoken">
          <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" name="grant_type" style="query" default="authorization_code">
          </param>
          <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" name="code" style="template">
          </param>
          <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" name="client_id" style="query" default="CxTsuE36CG0PVGnOhZiqJPw0x6uEAAiv">
          </param>
          <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" name="client_secret" style="query" default="YteFcBy4814u8vUC">
          </param>
          <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" name="redirect_uri" style="query" default="http://demo26-test.apigee.net/identity_app/callback">
          </param>
          <method id="accesstoken" name="POST" apigee:displayName="Access Token">
            <apigee:tags>
              <apigee:tag primary="true">Access Token</apigee:tag>
            </apigee:tags>
            <apigee:authentication required="false"/>
            <doc apigee:url="http://demo26-test.apigee.net/oauth/v2/accesstoken">
              Returns an access token.
            </doc>
            <request>
              <representation mediaType="application/x-www-form-urlencoded">
                <apigee:payload required="true">
                  <apigee:content>
                    <![CDATA[grant_type=authorization_code&client_id=CxTsuE36CG0PVGnOhZiqJPw0x6uEAAiv&client_secret=YteFcBy4814u8vUC&redirect_uri=http://demo26-test.apigee.net/identity_app/callback&code={code}]]>
                  </apigee:content>
                </apigee:payload>
              </representation>
            </request>
          </method>
        </resource>
Comment
Add comment Show 1 · 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
avatar image simplea · Oct 20, 2015 at 02:30 AM 0
Link

@Lee Grey I'm trying to implement the same thing, however it did not work fine. while trying to import it it display the error:

WADL is invalid. Expected element 'response@http://wadl.dev.java.net/2009/02' instead of 'doc@http://wadl.dev.java.net/2009/02' here in element method@http://wadl.dev.java.net/2009/02

any idea of suggestion?

avatar image
0

Answer by Lee Grey · Jan 09, 2015 at 03:55 AM

Here's a better code sample:

        <resource path="oauth/v2/accesstoken">
          <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" name="grant_type" style="query" default="authorization_code">
          </param>
          <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" name="code" style="query">
          </param>
          <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" name="client_id" style="query" default="CxTsuE36CG0PVGnOhZiqJPw0x6uEAAiv">
          </param>
          <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" name="client_secret" style="query" default="YteFcBy4814u8vUC">
          </param>
          <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" name="redirect_uri" style="query" default="http://demo26-test.apigee.net/identity_app/callback">
          </param>
          <method id="accesstoken" name="POST" apigee:displayName="Access Token">
            <apigee:tags>
              <apigee:tag primary="true">Access Token</apigee:tag>
            </apigee:tags>
            <apigee:authentication required="false"/>
            <doc apigee:url="http://demo26-test.apigee.net/oauth/v2/accesstoken">
              Returns an access token.
            </doc>
            <request>
              <representation mediaType="application/x-www-form-urlencoded">
              </representation>
            </request>
          </method>
        </resource>
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
avatar image
0

Answer by Lee Grey · Oct 20, 2015 at 11:21 PM

Hi, @simplea. It's been a while since I've used WADL; I'm focused on Swagger now, which I highly recommend. (You can create Swagger at http://apistudio.io )

I recall that I ran into an issue with the order of the elements, and the error message was similar to the one you posted. I found that I had to swap the order of the params and method elements within a resource for the API Console to be able to read the WADL. I'm not certain that this is related to what you are seeing, but I'm hoping that it might point you in the right direction.

If that hint is not helpful, I would suggest that you try to upload a simplified WADL here that recreates the problem.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

any automate process for wadl/swagger? 2 Answers

Unable to import WADL 5 Answers

Getting error in request and response during the dev testing 2 Answers

How do you delete a smardocs model revision? 2 Answers

How does Smartdocs interact with Edge? 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
© 2019 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
  • 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
  • Members
  • Badges