locked
WCF ClientEndpoint Address Issue after .NET 4.5+ RRS feed

  • Question

  • We have a WCF Client with configuration for the ClientEndpoint Address with the following scheme ws://.  Everything works well with .NET 4.0 but after migrating to 4.5 we are having issue.  We notice that the ws:// applies to wsaTo is being replaced with http:// in 4.5 and the server is rejecting our soapHeader.
    Monday, August 15, 2016 3:45 PM

Answers

  • Hi stran,

    >> My requirement is to send the message to the https:// address and set the ws-addressing To header with the ws:// address

    To set ws-adderss, you will have to configure client endpoint to use a binding that supports it, such as WSHttpBinding. Then, you could set wsa:To to a specific URL in your client code through OperationContext.OutgoingMessageHeaders.To.

    You could refer the link below for more information.

    # How do I use WS-Addressing in WCF and set the wsa:replyto header?

    http://stackoverflow.com/questions/9129750/how-do-i-use-ws-addressing-in-wcf-and-set-the-wsareplyto-header

    If it did not work, it would be helpful if you could share us a simple demo which could reproduce your issue.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, August 19, 2016 5:42 AM

All replies

  • Hi stran,

    >> We have a WCF Client with configuration for the ClientEndpoint Address with the following scheme ws://.

    What do you mean with “scheme ws://”? Could you share us your server and client configure files.

    >> Everything works well with .NET 4.0 but after migrating to 4.5 we are having issue

    Did you migrate your WCF Server and Client project from .net 4.0 to 4.5? Could you share us your detailed information about migration? For migrating to .net 4.5 project, you could refer Migration Guide to the .NET Framework 4.6 and 4.5.

    >> We notice that the ws:// applies to wsaTo is being replaced with http:// in 4.5 and the server is rejecting our soapHeader.

    Could you share us detailed error message? Could you reproduce your issue with a simple WCF project?

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Tuesday, August 16, 2016 11:18 AM
  • At first we tried not migrating project from 4.0 to 4.5 as it is production code.  However, after experiencing the issue we thought migrating by setting our project target framework to 4.5+ would help.  We still have the issue. 

    The URL we sending to is in the following format:  https://ws-xxxxx-cert-qa.UU.com/services

    with the following in the client endpoint configuration

    <

    endpointaddress="ws://XXXXXwagenag.com/Retail/XXXXXXXXXXXSTARService/V1"binding="customBinding"bindingConfiguration="ME"behaviorConfiguration="ME"contract="XXXXXXXXXXXSTARContract.XXXXXXXXXXXSTARServicePortType"name="XXXXXXXXXXX"/>

    The client endpoint address is used to set the ws-addressing To.  That web socket (ws://) scheme is being rewritten to http://.

    Tuesday, August 16, 2016 12:24 PM
  • Hi stran,

    >> The URL we sending to is in the following format:  https://ws-xxxxx-cert-qa.UU.com/services with the following in the client endpoint configuration

    Could you share us more information about this? What do you mean web socket(ws://) is being rewritten to http://. I follow How to: Create a WCF Service that Communicates over WebSockets to make a test with WebSockets under .net 4.5, it works correctly at my side. It would be helpful if you could share us more information about creating your service and client, and steps you get the issue.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.



    Wednesday, August 17, 2016 9:47 AM
  • We are not communicating with Web Socket. As mention we are calling the service at https://ws-xxxxx-cert-qa.UU.com/services and the (ws-addressing To) soap header needs to be ws://XXXXXwagenag.com/Retail/XXXXXXXXXXXSTARService/V1.  However, .net 4.5+ is changing the ws:// to http://XXXXXwagenag.com/Retail/XXXXXXXXXXXSTARService/V1 for the ws-addressing To.  This cause the service to return a soap fault stating the ws-addressing To not matching on their system.
    Wednesday, August 17, 2016 11:58 AM
  • Hi stran,

    >> net 4.5+ is changing the ws:// to http://XXXXXwagenag.com/Retail/XXXXXXXXXXXSTARService/V1 for the ws-addressing To

    I am not sure what your senior is. Based on your original post, your ClientEndpoint address scheme is ws://, but in later reply, you call service at https://. Could you share us more information about how you create your service and client, and how did you send your request?

    If you call service with “ws://XXXXXwagenag.com/Retail/XXXXXXXXXXXSTARService/V1” as ClientEndpoint address, will it work? Or, do you mean you call with ws:// in client endpoint, but it will be rewrite with https?

    To custom message from client and service, I think you could try Message Inspectors, you could refer the link below for more information.

    # WCF Extensibility – Message Inspectors

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

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Thursday, August 18, 2016 8:35 AM
  • In my reply I was very clear. My requirement is to send the message to the https:// address and set the ws-addressing To header with the ws:// address. Everything was working fine with .net 4.0 and earlier and broke .4.5+. My company cannot wait on your assistance any longer so we will have to move on. Thanks anyways.
    Thursday, August 18, 2016 11:05 AM
  • Hi stran,

    >> My requirement is to send the message to the https:// address and set the ws-addressing To header with the ws:// address

    To set ws-adderss, you will have to configure client endpoint to use a binding that supports it, such as WSHttpBinding. Then, you could set wsa:To to a specific URL in your client code through OperationContext.OutgoingMessageHeaders.To.

    You could refer the link below for more information.

    # How do I use WS-Addressing in WCF and set the wsa:replyto header?

    http://stackoverflow.com/questions/9129750/how-do-i-use-ws-addressing-in-wcf-and-set-the-wsareplyto-header

    If it did not work, it would be helpful if you could share us a simple demo which could reproduce your issue.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, August 19, 2016 5:42 AM