hi to all,
i had make wcf services, what when i try invoke insert method using jquery, it's not work:
here is my code :
WCF code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Data;
[ServiceContract]
public interface IService
{
[OperationContract]
void addnewcategory(string name, int price, int type);
[OperationContract]
DataTable selectcategory();
[OperationContract]
void updatecategory(string Name, int price, int type, int id);
[OperationContract]
Boolean deletecategory(int id);
}
service.cs code :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using Bal;
using System.Data;
public class Service : IService
{
public void addnewcategory(string name, int price, int type)
{
Bal.insertcategory obbalinsertcategory = new Bal.insertcategory();
obbalinsertcategory.inserttocategory(name, price, type);
}
public DataTable selectcategory()
{
Bal.insertcategory obbalinsertcategory = new Bal.insertcategory();
return obbalinsertcategory.selectcategory();
}
public void updatecategory(string Name, int price, int type, int id)
{
Bal.insertcategory obbalinsertcategory = new Bal.insertcategory();
obbalinsertcategory.updatecategroy(Name, price, type, id);
}
public Boolean deletecategory(int id)
{
Bal.insertcategory obdelte = new Bal.insertcategory();
return obdelte.deletecategory(id);
}
}
web.config
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http:
-->
<configuration>
<connectionStrings>
<add name="Con" connectionString="Data Source=.;Initial Catalog=market;User ID=sa;Password=market;Trusted_Connection=false;Pooling=false"/>
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
</configuration>
aspx code:
hi need here jquery method that invoke addnewcategory from webserice please help