Hi Seetha,

Try with XML payload factory as below:

<payloadFactory media-type="xml">
                  <format>
                      <soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/";>
                          <soapenv:Body>
                              <root xmlns="">

<grant_type>client_credentials</grant_type>
                              </root>
                          </soapenv:Body>
                      </soapenv:Envelope>
                  </format>
                  <args>
                  </args>
              </payloadFactory>

Hopefully, it will work.

Thanks & Kind regards,
*Waqas Ali Razzaq*




On Fri, Oct 18, 2019 at 7:21 AM seetha1 <[email protected]> wrote:

> Hi All ,
>           im not able to invoke the Token API from the WSO2 ESB, im using
> api manager 2.6.0 with the ESB tooling plugin.
>
> the code  i use is
>
> <?xml version="1.0" encoding="UTF-8"?>
> <sequence name="callTokenService_flow" trace="disable"
> xmlns="http://ws.apache.org/ns/synapse";>
>     <log level="custom">
>         <property name="insideToken" value="inside the token esb"/>
>     </log>
>     <property name="messageType" scope="axis2" type="STRING"
> value="application/x-www-form-urlencoded"/>
>     <property
>     expression="fn:concat('Basic
>
> ','WnRJQWVNUHdiR1dVcnRueE5hRWtnanhuVGNrYTplRkwwSUJ4MXRNU25SSmgwTGtySFNNVXF4akVh')"
>     name="Authorization" scope="transport" type="STRING"
> xmlns:ns="http://org.apache.synapse/xsd"/>
>     <property name="grant_type" scope="axis2" type="STRING"
> value="client_credentials" />
>     <payloadFactory media-type="json">
>         <format>{"grant_type":"client_credentials"}</format>
>     </payloadFactory>
>     <call>
>         <endpoint>
>             <http method="POST"
> uri-template="https://localhost:8243/token"/>
>         </endpoint>
>     </call>
>     <enrich>
>         <source clone="true" type="body"/>
>         <target property="response" type="property"/>
>     </enrich>
>     <log level="custom">
>         <property expression="$ctx:response"
> name="MESSAGE###########################3"/>
>         <property expression="get-property('ENDPOINT_PREFIX')"
> name="Endpoint"/>
>         <property expression="get-property('transport', 'Content-Type')"
> name="Content-Type"/>
>     </log>
> </sequence>
>
>
> exception i get is
>
> <ns:binary xmlns:ns="http://ws.apache.org/commons/ns/payload";></ns:binary>
>
> TID: [-1] [] [2019-10-18 04:57:11,682] DEBUG
> {org.apache.synapse.transport.http.wire} -  HTTPS-Sender I/O dispatcher-4
> >>
> "HTTP/1.1 415 Unsupported Media Type[\r][\n]"
> {org.apache.synapse.transport.http.wire}
> TID: [-1] [] [2019-10-18 04:57:11,681] DEBUG
> {org.apache.synapse.transport.http.wire} -  HTTPS-Listener I/O dispatcher-4
> << "X-Frame-Options: DENY[\r][\n]" {org.apache.synapse.transport.http.wire}
>
>
>
>
>
> --
> Sent from:
> http://wso2-oxygen-tank.10903.n7.nabble.com/WSO2-Development-f3.html
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to