roy_sanu
asked on
Testing of the web services
I have a method which insert record into the database using entity framework.
We are build a Soap based web services. I would like to know how we are going to test
this web service as project object as a parameter. Any tool or any way to do that.
We are build a Soap based web services. I would like to know how we are going to test
this web service as project object as a parameter. Any tool or any way to do that.
public IHttpActionResult PostProject(ProjectDTO project)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
Project entity = new Project()
{
ProjectNumber = project.ProjectNumber,
ProjectDescription = project.ProjectDescription,
CreateDate = DateTime.Now,
CreateUser = project.CreateUser,
Latitude = project.Latitude,
Longitude = project.Longitude,
ProjectStatus = project.ProjectStatus,
HoursPerShift = project.HoursPerShift,
TimeZone = project.TimeZone,
StandByWBSElementNumber = project.StandByWBSElementNumber,
};
db.Projects.Add(entity);
try
{
db.SaveChanges();
}
catch (DbUpdateException)
{
if (ProjectExists(project.ProjectNumber))
{
return Conflict();
}
else
{
throw;
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.