Working with my java colleagues I came to love SOAPUI for testing services. Now Microsoft seems to have catched up with the WCF Test Client. A blog post of dotNET colleague Rick van den Bosch made me search for it in the Common7 folder.
Adding a service is done by putting the URL to the WSDL in the inputbox. So I had to make sure my services expose the WSDL. See below for some configuration options for exposing the WSDL. In both cases the WSDL is exposed on http://SomeMachine/Some/Services/Calculator?wsdl
<!-- Make use of a named behavior configuration -->
<system.serviceModel> <services> <!-- Service with specified behavior, the behavior contains the address for the WSDL --> <service name = "SomeService.CalculateImplementation" behaviorConfiguration = "CaculateServiceWSDLBehavior" > <endpoint address = "http://SomeMachine/Some/Services/Calculator" binding = "basicHttpBinding" contract = "SomeService.ICalculate" /> </service> </services> <behaviors> <serviceBehaviors> <!-- Named behavior containing the WSDL URL (httpGetUrl) --> <behavior name = "CaculateServiceWSDLBehavior"> <serviceMetadata httpGetEnabled = "true" httpGetUrl = "http://SomeMachine/Some/Services/Calculator" /> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel>
<!-- Make use of baseAddress -->
<system.serviceModel> <services> <!-- Service with default behavior --> <service name = "SomeService.CalculateImplementation" > <!-- baseAddress used for WSDL url --> <host> <baseAddresses> <add baseAddress = "http://SomeMachine/Some/Services/Calculator" /> </baseAddresses> </host> <!-- Endpoint without address, because that is fully specified in the baseAddress --> <endpoint address = "" binding = "basicHttpBinding" contract = "SomeService.ICalculate" /> </service> </services> <behaviors> <serviceBehaviors> <!-- Default behavior for every service use of baseAddress needed for WSDL --> <behavior> <serviceMetadata httpGetEnabled = "true" /> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel>
Need some online service to get started with WCF Test Client? Check webservicex.