none
Send SOAP with WS Security using X509 certificate in Visual Studio 2015 RRS feed

  • Question

  • Problem Statement:

     

    I have a SOAP request, which requires WS security (timestamp and signature) to be added to execute it successfully. Now this I implement using SOAP UI , by adding keystore and including signature and timestamp in my SOAP request. I have mentioned the steps for SOAP UI below.

     

     

    This same SOAP request , I need to fire, using Visual Studio 2015. I am not sure, how I can include the keystore and add the WS security to the SOAP request before sending it to the endpoint. It will be really helpful if you could help me with this issue as this is blocking our execution.


    SOAP UI simulation steps:

     

    Reference: ws-security on www.soapui.org 

    1. Create a new SOAP project in SOAP UI using WSDL
    2. Add keystore to the SoapUI project

    1. Add "Outgoing WS-Security Configurations" to the test project
    1. After having created Andeby, make sure it's selected, and click on the + marked in the screenshot below
    1. Add timestamp
    1. Add signature
    1. After adding timestamp and signature it should be as below
    1. Fire the SOAP request
    • Moved by 宝宝徐 Monday, July 31, 2017 2:32 AM
    Friday, July 28, 2017 6:40 AM

All replies

  • Hi,

    Welcome to MSDN forum.

    Our forum is to talk about visual studio IDE, I will move your thread to WCF forum for professional support. Thank you for understanding.

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, July 31, 2017 2:29 AM
  • Hi Kimaya,

    Did the service develop by c# or JAVA? How did you generate the client code?

    In VS 2015, will the request miss timestamp and signature for the client code which is generated by Adding Service Reference?

    For this requirement, I suggest you check below link to use custom binding.

    # How to make WCF Client conform to specific WS-Security - sign UsernameToken and SecurityTokenReference

    https://stackoverflow.com/questions/12832213/how-to-make-wcf-client-conform-to-specific-ws-security-sign-usernametoken-and

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, July 31, 2017 5:49 AM
  • Hi Edward,

    Please find response to your queries below:

    Did the service develop by c# or JAVA? How did you generate the client code?

    So the service is developed by Java. I have WSDL and Endpoint for the web service from which i have constructed SOAP request.

    In VS 2015, will the request miss timestamp and signature for the client code which is generated by Adding Service Reference?

    I need to add the timestamp and Signature while constructing the request in Visual Studio. The service reference wont take the Signature and timestamp automatically.

    Thanks!!

    Thursday, August 10, 2017 1:59 PM
  • Hi Kimaya,

    For adding timestamp and Signature, I suggest you try IClientMessageInspector with BeforeSendRequest to modify the request, and you could refer below link for more information.

    # WCF Extensibility – Message Inspectors

    https://blogs.msdn.microsoft.com/carlosfigueira/2011/04/18/wcf-extensibility-message-inspectors/

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, August 11, 2017 2:05 AM