c# - WCF From Class Library - hosting in IIS and wsdl generation -
allmost day today trying research on wcf , 1 of aim create wcf service manually (or so).
based on few articles on web on how structure wcf application have created contracts project contain service interfaces , implementation project. both have runtime.serialization
i have created app.config
<?xml version="1.0" encoding="utf-8" ?> <configuration> <system.servicemodel> <behaviors> <servicebehaviors> <behavior name="fulfillmentservicebehaviour"> <servicemetadata httpgetenabled="true" /> </behavior> </servicebehaviors> </behaviors> <services> <service behaviorconfiguration="fulfillmentservicebehaviour" name="project.services.fulfillment"> <endpoint address="http://localhost:8080/services" binding="basichttpbinding" bindingconfiguration="" contract="p.infrastructure.services.ifulfillment" /> <endpoint binding="mexhttpbinding" bindingconfiguration="" /> </service> </services> </system.servicemodel> </configuration>
1) how can host service in iis created virtual directory pointing folder containing project services (url http://localhost:8080/services)
2) how create wsdl file can use soapui test it
i tried adding file "fulfillment.svc" markup
<%@ servicehost language="c#" debug="true" service="project.services.fulfillment" codebehind="fulfillment.cs" %>
for purpose of testing gave error
the type project.services.fulfillment', provided service attribute value in servicehost directive not found.
update 1******
just found on net - may help. 1 imp ino need web.config
http://wncadmb026d.na-idm.na-gad.nec.com/services/fulfillment.svc?wsdl
update 2:*****
soap ui able generate soap request gers http 404 response...
for wsdl page have correct attribute:
<servicemetadata httpgetenabled="true" />
and can access adding ?wsdl url, ie http://localhost:8080/service.svc?wsdl
as error, think problem not using .svc extension:
<%@ servicehost language="c#" debug="true" service="project.services.fulfillment" codebehind="fulfillment.svc.cs" %>
you using .svc file, right?
if not using .svc file 1 thing use routing, see link example: http://geekswithblogs.net/michelotti/archive/2010/08/21/restful-wcf-services-with-no-svc-file-and-no-config.aspx
Comments
Post a Comment