Creating a .net SOAP client in Visual Studio

B Mo 61 Reputation points
2022-07-30T11:32:00.187+00:00

I'm usually a php & javacript developer on Linux systems running Apache. We're trying to consume a SOAP API that's running on a Windows server. It uses p7b certificates for message level encryption and we're having trouble getting that working in a Linux/Apache environment. We've therefore decided it may be easier to build an API middleware in .net and run it on a Windows server or Azure. Part of the decision was, reading various blogs etc, it seemed easy in Visual Studio as there are various templates/wizards to help. Most of these examples seem to use WCF and speak of WCF templates.

I've installed the latest version of Visual Studio and selected to install WCF. However, when I look for templates or service references I can't find anything for consuming SOAP API's. Can anyone point me in the direction for getting started consuming a message level encrypted SOAP API with a WSDL?

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,905 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jiayao Wu-MSFT 176 Reputation points Microsoft Vendor
    2022-08-01T08:59:06.447+00:00

    Hi @B Mo ,

    For a reference, follow these steps:

    1. File - New - Project - WCF service application
    2. One service contract file along with a service file (.svc) is created automatically. We can modify the default contract file and service file.
    3. Right-click the Solution and click "Add Service Reference"
    4. Click “Discover” and choose “Services in Solution”.
    5. Then it will list the existing service “Service1.svc”. We can double click on it. It will install the service reference to the project.

    So far a basic program has been created. For more detailed information, check out the official documentation.

    Best Regards,
    Jiayao Wu

    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Castorix31 85,706 Reputation points
    2022-07-30T12:31:27.313+00:00

    A way is with HttpWebRequest
    (I had posted a sample in this thread : Possibilities to include a SOAP interface in C# WinForm)

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.