In this article, creating custom services. we need to follow objects.
- Request Class
- Response Class
- Service Class
- Services
- Service Group
[DataContractAttribute]
class DAX_SalesOrderRequest
{
CustAccount CustAccount;
str Dataareaid;
[DataMemberAttribute("CustAccount")]
public CustAccount ParmCustAccount(CustAccount _CustAccount = CustAccount)
{
CustAccount = _CustAccount;
return CustAccount;
}
[DataMemberAttribute("Dataareaid")]
public Dataareaid parmdataareaid(Dataareaid _Dataareaid = Dataareaid)
{
Dataareaid = _Dataareaid;
return Dataareaid;
}
}
2. Response Class:-
[DataContractAttribute]
class DAX_SalesOrderRequest
{
salesId salesid;
str Dataareaid;
[DataMemberAttribute("CustAccount")]
public salesId ParmSalesId(salesId _salesid = salesId)
{
salesId = _salesid;
return salesId;
}
}
3. Service Class:
class DAX_SalesOrderBusinessService
{
public DAX_SalesOrderResponse SalesOrderFind(DAX_SalesOrderRequest Request)
{
SalesTable salesTable;
DAX_SalesOrderResponse Response = new DAX_SalesOrderResponse();
changecompany(Request.parmdataareaid())
{
while select salesTable
where SalesTable.CustAccount == Request.ParmCustAccount()
{
Response.ParmSalesId(str2con(salesTable.SalesId));
}
return Response;
}
}
Services:-
we have to add the service class name in the property of services.
we have to add service class method name in services.
No comments:
Post a Comment