Layer7 API Management

 View Only
Expand all | Collapse all

API Gateway - redirecting SOAP Envelope

Jump to Best Answer
  • 1.  API Gateway - redirecting SOAP Envelope

    Posted Jul 06, 2018 10:18 AM

    Hello Guys, how are you doing ?

     

    The customer environment has a lot of legacy application (four) that they consume TEWS (IDM). 

    However, after the integration with SSO, these applications stopped and now they aren't authenticating, because IDM is requering SSO Headers.

     

    Well, The customer doesn't know how insert SSO Headers in the application Code and they don't want to do that. So, they are asking to the API Gateway to do that.

     

    I am very new in this Product and I am getting many issues to translate this idea.

     

    So, What Do I have ?

     

    1) I simulate this situation in the SOAP UI:

     

    (This is example, the applications will send a lot of TEWS commands)

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
    <TaskContext xmlns="http://tews6/wsdl">
    <admin_id>User</admin_id>
    <admin_password>senha</admin_password>
    <no_namespace_on_soapfaults_header>true</no_namespace_on_soapfaults_header>
    </TaskContext>
    <ModifyUserQuery xmlns="http://tews6/wsdl">
    <ModifyUserSearch>
    <Subject index="0">
    <FriendlyName>User</FriendlyName>
    </Subject>
    </ModifyUserSearch>
    </ModifyUserQuery>
    </soap:Body>
    </soap:Envelope>

    With this header:

    With this type of authentication:

     

    Response:

     

     

    2) I could simulate in the API Gateway (But I Used static values):

     

     

     

     

     

     

     

    Now, my challenge is the API Gateway capture this SOAP Envelope from SOAPUI. However, I don't know how!

    Is this possible the API capture the SOAP Envelope without transformation ? I mean, the entire package ? 

     

    Thank you!



  • 2.  Re: API Gateway - redirecting SOAP Envelope

    Broadcom Employee
    Posted Jul 08, 2018 08:08 PM

    Dear roded03 ,

    If you want to insert a header to a message (request/response,etc.), you can use Manage Transport Properties/Headers assertion,

    Manage Transport Properties/Headers Assertion - CA API Gateway - 9.3 - CA Technologies Documentation 

     

    Regards,

    Mark



  • 3.  Re: API Gateway - redirecting SOAP Envelope

    Posted Jul 09, 2018 07:20 AM

    Hey Zhijun He, thank you for the response.

     

    Well, I really inserted a header to my message. My problem now is transport the message without transformation or break in pieces. I want to receive the message from the Application (SOAP Envelope, like you see in my first post) and redirect them using the Http Routing, like a web proxy.

     

    So, is this possible ?

     

    Best Regards.



  • 4.  Re: API Gateway - redirecting SOAP Envelope

    Broadcom Employee
    Posted Jul 09, 2018 07:41 PM

    Dear roded03 ,

    Yes, you can.

    When you receive message from a client (Application), the default request context variable will have all the info of the incoming message.

    If you just need to route the incoming message to backend, then in the Route via HTTP (s) assertion, you select "<Default Request>" as Request Source. (this is by default)

     

    PS: ${request.mainpart} is the body of the incoming request message, ie, the SOAP Envelope, you can assign it to another message context variable if you don't want to use default request message, but just keep the body of request message.

     

    Regards,

    Mark



  • 5.  Re: API Gateway - redirecting SOAP Envelope

    Posted Jul 10, 2018 08:54 AM

    Well, I found a way:

     

    Publish SOAP Web Service Wizard - CA API Gateway - 9.1 - CA Technologies Documentation 

     

    So, I created a Web Service to the applications and published in http://******:8080/ssg/soap . Besides that, I inserted a Message routing to deliver the answers:

     

     

     

     

    And:

     

    So, last question, How Can I deliver all responses to the Host ?

     

    Thanks!



  • 6.  Re: API Gateway - redirecting SOAP Envelope
    Best Answer

    Broadcom Employee
    Posted Jul 10, 2018 07:13 PM

    You case only need one api call, when you have route via http assertion, you don't need return template response assertion, the route via http assertion will return the response to requestor.

     

    if you make multiple api calls in a policy, you can access/tailor each response body by ${<response variable>.mainpart}, and then you can put them together as body of return template response assertion.



  • 7.  Re: API Gateway - redirecting SOAP Envelope

    Posted Jul 11, 2018 07:28 AM

    Thank you!! You are right. Only the Route via Http Assertion is necessary. I tested in my soap UI and it is working!

     

    Have a nice day!



  • 8.  Re: API Gateway - redirecting SOAP Envelope

    Posted Jul 12, 2018 09:43 AM

    Mark_HE I have another question.

    In this sames code, is it possible to do this:

     

    IDM has a public Webservice where we can get all the procedures:

     

    To access, we only need to add "?wsdl" in the URL.

     

    Like you know, I configured a Webservice too, but i don´t have this service. How Can I provide this ?

     

    Thanks!



  • 9.  Re: API Gateway - redirecting SOAP Envelope

    Broadcom Employee
    Posted Jul 16, 2018 02:52 AM

    It's available by default(for soap service only), unless you disable WSDL download service on listen port.



  • 10.  Re: API Gateway - redirecting SOAP Envelope

    Posted Jul 16, 2018 07:39 AM

    Ahh, so, that's my problem Zhijun He. The customer will access using a GET (http) command, not by soap. How can I solve this ?



  • 11.  Re: API Gateway - redirecting SOAP Envelope

    Broadcom Employee
    Posted Jul 16, 2018 08:29 PM

    GET method has no problem. You published the soap service on gateway with wsdl, right?

    Then by default, you can access the wsdl file by,

    http(s)://<your gateway>:<port>/<your soap api>?wsdl

     

    if you cannot get it, that means configuration on <port> disable it, you can check the port settings from policy manager -> Tasks -> Transports -> Manage Listen Ports -> open a port properties, it should look like below, 

     

    You need to enable "WSDL download service" to allow wsdl download, otherwise you will get Bad Gateway error.



  • 12.  Re: API Gateway - redirecting SOAP Envelope

    Posted Jul 24, 2018 02:32 PM

    Thank you!! It is working!

     

    Cheers!