Monday, 8 October 2012

WCF 4.5 - Host Unreachabl​e when calling a WCF service from soapUI

The WCF Test Client (WCFTestClient.exe) is Visual Studio's disappointingly basic tool for testing your WCF services. If you have your hopes up that the the Visual Studio 2012 WCF Client tool for .NET 4.5 is any better, forget about it. It is still so simple that it doesn't support client X509 Certificates or even username and passwords. Other tools like Fiddler and Wireshark are also compulsory items on the toolbelt (along with .NET coded integration unit tests). Fiddler supports client certificates out of the box and works a charm (especially for REST services).
I have used soapUI (http://www.soapui.org/) extensively for the past few years for basic integration testing of WCF (with basic endpoint bindings) and SAP web services. I've been using those also to test out connections to my current client's back-end banking systems.

soapUI isn't perfect though - as there are differences in interpretations of the WS-* standards between the Java and the .NET worlds - and soapUI is based on a Java stack. One such problem that you'll find with calling Microsoft WCF services with wsHttpBinding soapUI is that you get the following exception when you use the default settings:



    
      http://www.w3.org/2005/08/addressing/soap/fault
   
    
      
         
            s:Sender
            
               a:DestinationUnreachable
             
         
         
            The message with To '' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher.  Check that the sender and receiver's EndpointAddresses agree.
          
      
   

This is because there is no "To" entry in the header of the message. The fix for this is to go to the soapUI WS-A tab and ensure that the "add default wsa-To address is checked on" as per the screenshot below:

31 comments:

  1. Thanks, was looking for this setting!

    ReplyDelete
  2. Do you have a working model of using wcf transport message with credentials using the wshttpbinding that works with SoapUI? I have a working in .net version but I can't get SoapUI to work with it. My clients need to be able to setup their services to work with mine and the Java side of the house won't work with this current WCF service. Any ideas?
    Thanks in advance!!!

    ReplyDelete
  3. On more part I missed before... We are using a certificate for the signature... Current setup that works with .net -







    ReplyDelete
  4. wsHttpBinding
    binding name="wsHttpEndpointBinding"
    security mode="TransportWithMessageCredential"
    transport clientCredentialType="None"
    message clientCredentialType="Certificate" establishSecurityContext="false" negotiateServiceCredential="false"
    security
    binding
    wsHttpBinding

    ReplyDelete
  5. I have the same configuration as sf49ersfan above. Any suggestions?

    ReplyDelete
  6. I have a word document that has the settings needed to make SoupUI work with a certificate WCF service.

    Hopefully save you the time. I spent 4 weeks getting tho work....

    I'll send it to your email.

    ReplyDelete
  7. Guess you have to send me your email address as I can't pull it up. lmcguffee@gmail.com

    ReplyDelete
  8. Hi,

    I have service hosted in server which I cannot control it. it is highly secured by ssl. I did the changes in soapui you recommended but I'm seeing this error

    The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs

    When I check the service logs I don't really see the input params and any request regarding this.

    If you have detailed config and idea how to test in service client please send me an email. rajarajananis@gmail.com

    Thanks

    ReplyDelete
  9. I am facing the same problem .
    Can anybody send the configuration setting document to shobhakamal.1989@gmail.com

    ReplyDelete
  10. Please, can anybody send the configuration setting document to goblini@gmail.com ?

    ReplyDelete
  11. Please, can anybody send the configuration setting document to jorgealberto.ortiz@gmail.com ?
    thanks in advance

    ReplyDelete
  12. I have a vs2015 solution that has the client app to send the request and I also have the server service and serviceModel node for the web config that I can send out if anybody needs to use a certificate wcf service. It will make it so much easier.

    ReplyDelete
  13. Hi sf49ersfan ,

    Can you send document to shobhakamal.1989@gmail.com
    Would be a great help.

    ReplyDelete
  14. Hi, sf49ersfan.
    Can you send a word document that has the settings needed to make SoupUI work with a certificate WCF service to zaikins@gmail.com ?
    Thanks in advance.

    ReplyDelete
  15. This comment has been removed by the author.

    ReplyDelete
  16. Please provide the word document to srimals@gmail.com

    ReplyDelete
  17. I really appreciate information shared above. It’s of great help. If someone want to learn Online (Virtual) instructor lead live training in Windows foundation communication, kindly contact us http://www.maxmunus.com/contact
    MaxMunus Offer World Class Virtual Instructor led training on Windows foundation communication. We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 100000+ trainings in India, USA, UK, Australlia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.
    For Demo Contact us:
    Name : Arunkumar U
    Email : arun@maxmunus.com
    Skype id: training_maxmunus
    Contact No.-+91-9738507310
    Company Website –http://www.maxmunus.com



    ReplyDelete
  18. Can someone please send me the setting to make SoupUI work with a certificate to do peer trust
    with WCF cient and WCF service.

    my email id is ash123.ac@gmail.com
    Thanks.

    ReplyDelete
    Replies
    1. Tried to send you an email and I got it bounced back... let me know a good email and I'll send it again.

      Delete
  19. Hi, can someone please send the document/setting to amilselc@gmail.com ? Thank you in advance.

    ReplyDelete
    Replies
    1. I tried to s be it to that email and it was rejected... can you verify the email and let me know a valid one and I'll send along the docs

      Delete
  20. Please send the word document to jonas.ronngren@findity.com

    Br Jonas

    ReplyDelete
  21. Please send me a configuration settings document to gnarra15@gmail.com

    Thanks for the help..

    ReplyDelete
  22. Please send the word document to grkbala@gmail.com

    Thanks and Regards,
    bala

    ReplyDelete
  23. Please send the word document to geffrey.sun@gmail.com

    ReplyDelete
  24. Please send the word document to j.mad.rod@gmail.com

    ReplyDelete
  25. Please send the word document to eduaran1@gmail.com

    ReplyDelete
  26. Please send the word document to skumapathyssk@gmail.com

    ReplyDelete

  27. Uma6 January 2020 at 10:19
    Please send the word document to kkshyamprasad@gmail.com

    ReplyDelete
  28. I am stuck trying to get this to work, could you please please please send me the word document. chris_kezza@hotmail.com

    ReplyDelete