Need help in SOAP to get Customers

Hi All,

I am first time working with SOAP. I made Customer Entity [imported from excel sheet] who contains some records.



Then, I Created Web Service Method under SOAP to Get Customers.


And I also assigned my aggregate to Customers output parameter

But when I request in "POSTMAN" i got the status as 200 OK but i am not getting the result.  What i am doing wrong i don't understand.

Please help me here



How are you invoking it on POSTMAN ? Since it's soap you'll need to send the "Envelope" in the request

Pedro Neto wrote:

How are you invoking it on POSTMAN ? Since it's soap you'll need to send the "Envelope" in the request

 I paste the URL

.com/WebService2ForSOAP/mySOAPWebService.asmx?op=GetCustomers 

clicked SEND.

Method is GET & Post both tested. 

I don't know how to send Envelope.

 

Shailendra Phadke wrote:

Pedro Neto wrote:

How are you invoking it on POSTMAN ? Since it's soap you'll need to send the "Envelope" in the request

 I paste the URL

.com/WebService2ForSOAP/mySOAPWebService.asmx?op=GetCustomers 

clicked SEND.

Method is GET & Post both tested. 

I don't know how to send Envelope.

 

Then your web operation is fine, it is the way you are calling it through postman.

You have to go to that url environment.com/WebService2ForSOAP/mySOAPWebService.asmx?op=GetCustomers  there you will have the details for soap 1.1. and soap 1.2

Then you should make a request in POSTMAN with:

Request Type : POST

Resques URL: Host + Post of the previous picture

You should go to body of Postman and choose raw and there paste the envelope you copied from previos picture in this case : 

<?xml version="1.0" encoding="utf-8"?><soap12\:Envelope xmlns\:xsi="http\://www.w3.org/2001/XMLSchema-instance" xmlns\:xsd="http\://www.w3.org/2001/XMLSchema" xmlns\:soap12="http\://www.w3.org/2003/05/soap-envelope">    <soap12\:Body>        <WebMethod1 xmlns="http\://www.outsystems.com" />    </soap12\:Body></soap12\:Envelope>

In my Postman I also had to replace header content-type with: 

Content-Type : application/soap+xml; charset=utf-8


If this is too complicated , just Consume the soap in outsystems and display it's results in a screen.

Hello Shailendra Phadke

I can suggest you that you can user Soap UI in order to test Soap Api , i known its possible in Postman , but can try in Soap UI its a open source u can download it form internet 


Regarding your question :  did you cheeked your entity that its contains data,(go to your entity click view data) , if  you have data , then put a break  point on aggregate in your exposed api , you can call this api either soap ui or postman then it will hit the break point , at this stage you verify your date its empty or not 

Please tell me sing POSTMAN only

Shailendra Phadke wrote:

No My Entity does not have any data that I want Save it using SOAP and then want to retrieve it. Please tell using POSTMAN only


My previous response tells how to use POSTMAN. 

Pedro Neto wrote:

Shailendra Phadke wrote:

Pedro Neto wrote:

How are you invoking it on POSTMAN ? Since it's soap you'll need to send the "Envelope" in the request

 I paste the URL

.com/WebService2ForSOAP/mySOAPWebService.asmx?op=GetCustomers 

clicked SEND.

Method is GET & Post both tested. 

I don't know how to send Envelope.

 

Then your web operation is fine, it is the way you are calling it through postman.

You have to go to that url environment.com/WebService2ForSOAP/mySOAPWebService.asmx?op=GetCustomers  there you will have the details for soap 1.1. and soap 1.2

Then you should make a request in POSTMAN with:

Request Type : POST

Resques URL: Host + Post of the previous picture

You should go to body of Postman and choose raw and there paste the envelope you copied from previos picture in this case : 

<?xml version="1.0" encoding="utf-8"?><soap12\:Envelope xmlns\:xsi="http\://www.w3.org/2001/XMLSchema-instance" xmlns\:xsd="http\://www.w3.org/2001/XMLSchema" xmlns\:soap12="http\://www.w3.org/2003/05/soap-envelope">    <soap12\:Body>        <WebMethod1 xmlns="http\://www.outsystems.com" />    </soap12\:Body></soap12\:Envelope>

In my Postman I also had to replace header content-type with:

Content-Type : application/soap+xml; charset=utf-8


If this is too complicated , just Consume the soap in outsystems and display it's results in a screen.

 

Hi Pedro,

 I did it what you said. But i am getting 500Internal Server Error


 


Turn on the debugger and see if the requests get there.
Also you should disable in the headers the default content type.

Also You are sending the example response.

You should send what is the requeest something more like this :

<?xml version="1.0" encoding="utf-8"?><soap12\:Envelope xmlns\:xsi="http\://www.w3.org/2001/XMLSchema-instance" xmlns\:xsd="http\://www.w3.org/2001/XMLSchema" xmlns\:soap12="http\://www.w3.org/2003/05/soap-envelope">    <soap12\:Body>        <WebMethod1 xmlns="http\://www.outsystems.com" />    </soap12\:Body></soap12\:Envelope>


In this link you should have both example request and example response:
environment.com/WebService2ForSOAP/mySOAPWebService.asmx?op=GetCustomers

Pedro Neto wrote:

Also You are sending the example response.

You should send what is the requeest something more like this :

<?xml version="1.0" encoding="utf-8"?><soap12\:Envelope xmlns\:xsi="http\://www.w3.org/2001/XMLSchema-instance" xmlns\:xsd="http\://www.w3.org/2001/XMLSchema" xmlns\:soap12="http\://www.w3.org/2003/05/soap-envelope">    <soap12\:Body>        <WebMethod1 xmlns="http\://www.outsystems.com" />    </soap12\:Body></soap12\:Envelope>


In this link you should have both example request and example response:
environment.com/WebService2ForSOAP/mySOAPWebService.asmx?op=GetCustomers

 

 

I used the Request Type  :GET

And I got status as 200 OK


For POST i got 500 internal Server error


And where to check the data.


It is too complex as compare to JSON


Solution
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <GetCustomers xmlns="http://www.outsystems.com" />
  </soap12:Body>
</soap12:Envelope>

Copy that to the request body and try again please

Solution

Pedro Neto wrote:

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <GetCustomers xmlns="http://www.outsystems.com" />
  </soap12:Body>
</soap12:Envelope>

Copy that to the request body and try again please

 YES!!!! got the data


 

thanks a lot!!! 

Do I use methodology for insert, update and delete?



Now for that you must implement a web method that does that, maybe for simplicity sake create a new method for each operation you'd like to perform.

Then if you use SoapUI it will be much more easier to handle SOAP webservices like Srinivas Singadi suggested.

You'll just need to create a new project and feed it the WSDL and it will automatically generate sample requests for all existing operations.

You can get the WSDL here:
https://shailendra-phadke.outsystemscloud.com/WebService2ForSOAP/mySOAPWebService.asmx?wsdl

Try it if you can you'll see it's much easier.



Pedro Neto wrote:

Now for that you must implement a web method that does that, maybe for simplicity sake create a new method for each operation you'd like to perform.

Then if you use SoapUI it will be much more easier to handle SOAP webservices like Srinivas Singadi suggested.

You'll just need to create a new project and feed it the WSDL and it will automatically generate sample requests for all existing operations.

You can get the WSDL here:
https://shailendra-phadke.outsystemscloud.com/WebService2ForSOAP/mySOAPWebService.asmx?wsdl

Try it if you can you'll see it's much easier.



 

 I cannot download this software on this laptop. But will try it