わかった、
サービスをセットアップすると、wsdl が生成されますが、アクセスしようとすると 404 が返されます。
http://localhost:51902/TestService/DoWork
私のWSDL:
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" name="TestService" targetNamespace="http://tempuri.org/">
<wsdl:types>
<xsd:schema targetNamespace="http://tempuri.org/Imports">
<xsd:import schemaLocation="http://localhost:51902/TestService.svc?xsd=xsd0" namespace="http://tempuri.org/"/>
<xsd:import schemaLocation="http://localhost:51902/TestService.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="TestService_DoWork_InputMessage">
<wsdl:part name="parameters" element="tns:DoWork"/>
</wsdl:message>
<wsdl:message name="TestService_DoWork_OutputMessage">
<wsdl:part name="parameters" element="tns:DoWorkResponse"/>
</wsdl:message>
<wsdl:message name="TestService_SayHello_InputMessage">
<wsdl:part name="parameters" element="tns:SayHello"/>
</wsdl:message>
<wsdl:message name="TestService_SayHello_OutputMessage">
<wsdl:part name="parameters" element="tns:SayHelloResponse"/>
</wsdl:message>
<wsdl:portType name="TestService">
<wsdl:operation name="DoWork">
<wsdl:input wsaw:Action="http://tempuri.org/TestService/DoWork" message="tns:TestService_DoWork_InputMessage"/>
<wsdl:output wsaw:Action="http://tempuri.org/TestService/DoWorkResponse" message="tns:TestService_DoWork_OutputMessage"/>
</wsdl:operation>
<wsdl:operation name="SayHello">
<wsdl:input wsaw:Action="http://tempuri.org/TestService/SayHello" message="tns:TestService_SayHello_InputMessage"/>
<wsdl:output wsaw:Action="http://tempuri.org/TestService/SayHelloResponse" message="tns:TestService_SayHello_OutputMessage"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:service name="TestService"/>
</wsdl:definitions>
コード:
/// <summary>
/// This is a very basic service
/// </summary>
[ServiceContract]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class TestService
{
[OperationContract]
[WebGet(ResponseFormat = WebMessageFormat.Json)]
public void DoWork()
{
return;
}
[OperationContract]
[WebGet(ResponseFormat = WebMessageFormat.Json)]
public string SayHello()
{
return "Hello";
}
}