Friday, May 1, 2020

Connecting to external Web-Service(SOAP) via client (POSTMAN)

In this post, we will use POSTMAN as a client to connect to external SOAP Service. The reason behind explaining the client (POSTMAN) instead of Pega is: it is fundamental to learn how web-services work outside Pega. And then it is easy to co-relate it to Pega. This will help developers to debug the issues related to web-services easily.








Context: Objective of this post is to get hands-on POSTMAN and to understand on below:



- how we send a SOAP request to external service.
- how we get the SOAP response back from external service.

To proceed with this scenario: we can look at the public SOAP API's available online. In this post, we would use the below:
Service Name: Calculator
Operation Name: Multiply
Method: POST

#1 Use the below link which takes you to the list of Public SOAP API's available. And navigate to Introduction >> Calculator >> Multiply operation directly.

Click here to open the Public SOAP API's which we can use for this demo.



















2 In the above link, you would observe two things:
#2.1 Sample Multiply Request (as shown in below screeenshot) where you are passing below two values
        <intA>5</intA>
        <intB>5</intB>
#2.2 Copy CURL snippet






#3 Download Postman from web browser to your system. And open the POSTMAN in your system.
#4 Now we are ready with the POSTMAN to hit the external system.
#5 Follow the below steps in POSTMAN
     #5.1 Click on "Import"
     #5.2 Navigate to "Paste Raw Text"
     #5.3 Copy the raw text i.e. CURL snippet from step #2.2 and paste it here.
     #5.4 And click on Import

















#6 We have a request ready and just we need to pass the valid data in the request.
     #6.0 Observe the endpoint URL in POSTMAN
     #6.1 Click on Body of the request
     #6.2 Select "raw" radio button
     #6.3 And paste the sample request that you have collected as part of step #2.1
     #6.4 Click on Send (as highlighted in below screenshot)

#7 Observe the response generated.
    # 7.1 Observe that in the request you are passing two numbers 5 and 5 for multiplication.
    # 7.2 So it should generate the result 25 in the response as below
In this post we have seen and observed below points:
  • From client like POSTMAN how to invoke external public SOAP API.
  • SOAP API we used here has HTTP endpoint in the URL.
  • We have passed two numbers (5,5) in the request and observed that external SOAP Service has multiplied the inputs and gave a result of 25 in the SOAP Response.
Stay tuned: Below is the plan on the Integration: Web Services w.r.t HTTP/HTTPS (outside Pega i.e. POSTMAN and within Pega)
  1. How to call Public SOAP Service (HTTP endpoint) from client (POSTMAN). This is covered in this post already. Remaining below points will be covered in subsequent points.
  2. How to call same above Public SOAP API (HTTP endpoint) from Pega.
  3. How to call Public SOAP API (HTTPS endpoint) from POSTMAN. (Here knowledged on SSL/HTTPS would help, where we will talk about certificates)
  4. How to call Public SOAP API (HTTPS endpoint) from Pega. (Here knowledged on SSL/HTTPS would help, where we will talk about certificates)
  5. Once above combination for SOAP w.r.t HTTP && HTTPS is complete, we would cover similarly for REST.

Thanks,
HowToPega.info

1 comment:


HowToPega : All rights reserved and the contents are copyrighted to Pavan Kumar Naidu