Is there a sample available to create a SOAP front end for a REST service?

Not applicable

Recently replaced a legacy SOAP application with REST service (Rest service is hosted in apigee; SOAP service is not). Would like to create a SOAP proxy in apigee that takes the incoming SOAP call, converts it to REST, then converts the rest response to SOAP for the reply.

Example:

In coming SOAP request -

<LookupDetails>
  <MethodParameters>
    <request>
      <IdentificationNumber>12345678</IdentificationNumber>
      <RequestingUserName>USER</RequestingUserName>
      <RequestingUserPassword>PASSWORD</RequestingUserPassword>
      <RequestingUserClient>CLIENT</RequestingUserClient>
      <RequestingUserRole isNull="false"/>
      <APIKEY isNull="false"/>
    </request>
  </MethodParameters>
</LookupDetails>


Need the proxy to validate the user name and password then convert request to REST and do a post to my existing REST API with the request body below.

<Search xmlns="http://schema.search.com">
  <Fields>
    <string>DetailList</string>
  </Fields>
  <Id>
    <string>12345678</string>
  </Id>
</Search>

I would appreciate any assistance you can provide.

Solved Solved
0 2 930
1 ACCEPTED SOLUTION

Yes, this is a really common thing to do with Apigee Edge.

If you give me the REAL soap message, I can produce an example that does basically what you want, I think.

If you'd prefer to do it yourself, then here's what I suggest:

  • use the ExtractVariables policy to extract the various fields from the inbound XML
  • verify the user credentials (however you'd like to do that) . Maybe via a ServiceCallout policy.
    Maybe with an LDAP call. Maybe a different way.
  • upon successful user authentication, use XSLT to produce the payload to be sent to the backend.
  • POST to the REST backend.
  • With the response, apply an XSLT to produce a SOAP envelope + response
  • send that SOAP response to the original caller

This is basically the reverse of the "SOAP-to-REST proxy" pattern, something that is done really commonly in Apigee Edge.

View solution in original post

2 REPLIES 2

Yes, this is a really common thing to do with Apigee Edge.

If you give me the REAL soap message, I can produce an example that does basically what you want, I think.

If you'd prefer to do it yourself, then here's what I suggest:

  • use the ExtractVariables policy to extract the various fields from the inbound XML
  • verify the user credentials (however you'd like to do that) . Maybe via a ServiceCallout policy.
    Maybe with an LDAP call. Maybe a different way.
  • upon successful user authentication, use XSLT to produce the payload to be sent to the backend.
  • POST to the REST backend.
  • With the response, apply an XSLT to produce a SOAP envelope + response
  • send that SOAP response to the original caller

This is basically the reverse of the "SOAP-to-REST proxy" pattern, something that is done really commonly in Apigee Edge.

Thank you. The suggestion you provided points me in the correct direction. I think I will give it a try on my own.