asp.net - Multiple argument for a WCF web service -
i want create wcf webservice create user . implemented service , interface :
[operationcontract] [webinvoke(method="post" ,uritemplate = "adduser/{id}/{login}/{pwd}/{prenom}/{nom}/{email}")] void adduser(string id ,string login ,string pwd ,string prenom ,string nom ,string email);
and implementation of service :
public void adduser(string id, string login, string pwd, string prenom, string nom, string email) { int userid = convert.toint32(id); using (entities entities = new entities()) { usr user = new usr(); user.cin = userid; user.login = login; user.pwd = pwd; user.prenom = prenom; user.nom = nom; user.email = email; entities.users.add(user); entities.savechanges(); } }
this web config
<services> <service name="pfewebservices.projectwebservices" behaviorconfiguration="servicebehaviour"> <endpoint address="" binding="webhttpbinding" contract="pfewebservices.iprojectwebservices" behaviorconfiguration="web"> </endpoint> </service> </services>
but when run url :
http://localhost:53359/projectwebservices.svc/adduser/13206874/malek/malek/malek/malek/malek
i "method not allowed"
what may problem knowing same service contain operation , working fine?
when run browser url provided, fires of get-request on method, , not post-request. when method allows post, rest explains itself;) try run using post:)
Comments
Post a Comment