c# - Interface and metadata errors in WCF service -
trying create first wcf service, 2 errors not allowing me go next level.
1) failed add service. service metadata may not accessible. make sure service running , exposing metadata.
2) error: cannot obtain metadata http://localhost:53238/smsgatewayportclient.svc if windows (r) communication foundation service have access, please check have enabled metadata publishing @ specified address. enabling metadata publishing, please refer client , service bindings may mismatched. remote server returned error: (415) cannot process message because content type 'application/soap+xml; charset=utf-8' not expected type 'text/xml; charset=utf-8'..http error uri: http://localhost:53238/smsgatewayportclient.svc html document not contain web service discovery information.
below class:
namespace wcfservice2 { public class service1 : iservice1 { public int add(int a, int b) { return + b; } sendmessageresponse1 sendmessage(sendmessagerequest request) { sendmessageresponse1 s = new sendmessageresponse1(); return s; } } }
below config :
<?xml version="1.0"?> <configuration> <appsettings> <add key="aspnet:usetaskfriendlysynchronizationcontext" value="true" /> </appsettings> <system.web> <compilation debug="true" targetframework="4.5" /> <httpruntime targetframework="4.5"/> </system.web> <system.servicemodel> <services> <service name="wcfservice2.service1" behaviorconfiguration="metadatabehavior"> <endpoint address="" binding="wshttpbinding" contract="wcfservice2.iservice1" /> <endpoint address="mex" binding="mexhttpbinding" contract="imetadataexchange" /> </service> </services> <behaviors> <servicebehaviors> <behavior name="metadatabehavior"> <servicedebug includeexceptiondetailinfaults="true" httphelppageenabled="true" /> <servicemetadata httpgetenabled="true"/> </behavior> </servicebehaviors> </behaviors> <protocolmapping> <add binding="basichttpsbinding" scheme="https" /> </protocolmapping> <servicehostingenvironment aspnetcompatibilityenabled="true" multiplesitebindingsenabled="true" /> </system.servicemodel> <system.webserver> <modules runallmanagedmodulesforallrequests="true"/> <directorybrowse enabled="true"/> </system.webserver> </configuration>
error 1 'wcfservice2.service1' not implement interface member 'wcfservice2.iservice1.sendmessage(wcfservice2.sendmessagerequest)'. 'wcfservice2.service1.sendmessage(wcfservice2.sendmessagerequest)' cannot implement interface member because not public. c:\users\phanikic\documents\visual studio 2013\projects\wcfservice2\wcfservice2\service1.svc.cs 12 18
as per knowledge these errors because of configurations , , body changes, make service run? in advance.
Comments
Post a Comment