-1

I have a web service that was created in c# in visual studio community 2019. When I launch the web service application on my development machine, the following page is displayed:

enter image description here

When I click on the "mq", this page is displayed:

enter image description here

When I enter a string of the appropriate layout into the input box next to mqRequest and click on invoke, the string that I entered is sent to the web service. The web service receives the string, process the string, and returns a string. This all works exactly as I anticipated.

Then, I deployed the web service to an AWS beanstalk instance. I verified that the instance is "green" by logging into the AWS account and viewing the beanstalk environment.

Now, I have a web application that is being developed in Visual Studio 2019 community MAC version and I need to have this web application send a string to the web service.

I have tried the following code:

HttpClient client = new HttpClient();
var APIResponse = client.GetStringAsync(url).Result;

with the url variable equal each of these:

http://mqxxxxxxxxx.elasticbeanstalk.com/WebService.asmx/mqRequest= http://mqxxxxxxxxx.elasticbeanstalk.com/WebService.asmx/mq/mqRequest=

In each case, I get an internal server error. I cant see what the internal server error is since the server is on AWS and is using a default config setting with custom Errors set to off.

What is the proper way to set up the url variable so that the is passed to the web service and processed by the mq action?

Thanks for any assistance.

Jonathan Small
  • 1,027
  • 3
  • 18
  • 40
  • https://www.c-sharpcorner.com/UploadFile/0c1bb2/consuming-web-service-in-Asp-Net-web-application/ – Chetan Jan 22 '22 at 20:49
  • Thanks for the link but that example shows how to set it up if you are developing the c# application on a windows machine. I am developing on a mac. One the Mac, I can add a reference (assuming that is the same as Add service reference) but when the reference screen is displayed, there is no advanced tab. So i get stuck at that spot. – Jonathan Small Jan 22 '22 at 20:55

1 Answers1

0

So, you're hosting a SOAP Service. All you have to do is, in the client application, right click the project file -> add -> service reference -> enter the url of the wsdl document.

After this, all dtos and services become available so you can call them in your code

Pieterjan
  • 2,738
  • 4
  • 28
  • 55
  • Im developing on a Mac. Visual Studio 2019 community mac does not have that as an option. There is no service reference option when I control click on the project and select Add. There is a "Reference" when I click on Add but as I mentioned above, when I do that, I am presented with a dialog with no entries. It has an All tab, a Packages tab, a Projects tab, and a .Net Assembly tab. All the tabs are empty so there are no references for me to add. – Jonathan Small Jan 22 '22 at 21:05