usr4896260
usr4896260

Reputation: 1507

How to view soap service data from my browser

I'm completely new to how soap services work, please correct me if my understanding is wrong. I would like to pass parameters and call a function from a soap service by typing in a url on my browser (Chrome) and then would like to see the results. I tried searching and following the information from here, but I'm not sure what I'm doing wrong. I have tried the following variations:

http://<servername>/apppath/MyService.asmx?op=GetData?loc=01&status=OPEN

http://<servername>/apppath/MyService.asmx/GetData?loc=01&status=OPEN

This is what I get when I go to the url.

http:/<servername>/apppath/MyService.asmx?op=GetData?

enter image description here Please help.

Upvotes: 3

Views: 8863

Answers (3)

usr4896260
usr4896260

Reputation: 1507

So the error was my understanding of SOAP and host to use Postman. In short, I wasn't able to accomplish a SOAP request through the browser. Also, the picture supplied, it showed I was missing 2 things. 1) The SoapAction 2) The parameters were not supplied in the url but rather in the <soap:Body> tag. These were supplied in the POST and I was able to view my results in Postman

Upvotes: 1

nnunes10
nnunes10

Reputation: 550

You have to send an HTTP POST request in order to call your web service GetData.

Your JS code should be something like:

//url should be MyService.asmx/GetData
function callWS(url) {
    var loc = "01";
    var status = "OPEN";

    var options = { error: function(msg) { alert(msg.d); },
                    type: "POST", url: "webmethods.aspx/UpdatePage",
                    data: JSON.stringify({ loc: loc, status: status }),
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    async: true, 
                    success: function(response) { alert(response); } 
                  }; 

    $.ajax(options);
}

Upvotes: 1

n.prokhorov
n.prokhorov

Reputation: 930

Maybe you are requesting wrong urls? If you have .asmx in your application - you should be able to see the description page on the url

http://{servername}/{apppath}/MyService.asmx

Of course you should replace {servername} the {apppath} with your values.

Upvotes: 1

Related Questions