Click here to Skip to main content
15,896,153 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
C#
<pre lang="c#"><pre lang="c#"><pre lang="c#"><pre lang="c#">
Hi,

Good Morning,
I am using restful wcf service concept and this is the method for the service in the interface.
C#
[OperationContract]
       [WebInvoke(Method = WebMethods.POST, UriTemplate = UriTemplates.CreateDoctorProfileUri, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
       hxResponseDTO CreateDoctorProfile(CreateDoctorProfileArg createDoctorProfileArg); 

 and implemented the service

public hxResponseDTO CreateDoctorProfile(CreateDoctorProfileArg createDoctorProfileArg)
        {
            hxResponseDTO response = null;
            try
             {
                bool actionResult;
                string actionOutcome;
                

                 if (createDoctorProfileArg != null)
                 {
                    DoctorProfileDTO doctorProfileDTO = new DoctorProfileDTO
                    {
                        Prefix = createDoctorProfileArg.Prefix,
                        FirstName = createDoctorProfileArg.FirstName,
                        LastName = createDoctorProfileArg.LastName,
                        MiddleName = createDoctorProfileArg.MiddleName,
                        Sufix = createDoctorProfileArg.Sufix,
                        Gender = createDoctorProfileArg.Gender,
                        DateOfBirth = createDoctorProfileArg.DateOfBirth,
                        MaritalStatus = createDoctorProfileArg.MaritalStatus,
                        Image = createDoctorProfileArg.Image,
                        AadhaarNumber = createDoctorProfileArg.AadharNumber,
                        EmailId = createDoctorProfileArg.EmailId,
                        MobileNumber = createDoctorProfileArg.MobileNumber,
                        RegistrationNumber = createDoctorProfileArg.RegisterNumber,
                        RegistrationAuthority = createDoctorProfileArg.RegistrationAuthority,
                        Qualification = createDoctorProfileArg.Qualification,
                        TypeOfMedice = createDoctorProfileArg.TypeOfMedicine,
                        Specialization = createDoctorProfileArg.Specialization,
                        GroupId = createDoctorProfileArg.GroupID,
                        NoofPatients = createDoctorProfileArg.NoofPatients,
                        PlanSelected = createDoctorProfileArg.PlanSelected,
                        PaymentFrequency = createDoctorProfileArg.Paymentfrequency,
                        DiscountsProvided = createDoctorProfileArg.DiscountsProvided,
                        AuthorizationNote = createDoctorProfileArg.AuthorizationNote,
                        BillingAddress = createDoctorProfileArg.BillingAddress,
                        City = createDoctorProfileArg.City,
                        State = createDoctorProfileArg.State,
                        Pincode = createDoctorProfileArg.Pincode,
                        Telephone = createDoctorProfileArg.TelephoneNumber


                    };

                  //  DoctorProfileResponseServiceDto response = new DoctorProfileResponseServiceDto();
                    actionResult = DoctorProfileController.CreateDoctorProfile(doctorProfileDTO, out actionOutcome);

                    response = new hxResponseDTO
                    {
                        Result = actionResult,
                        Message = actionOutcome

                    };

                    //MemoryStream = CommonUtils.serializeResponseObject<doctorprofileresponseservicedto>(response);
                }

            }
            catch (Exception ex)
            { 
                throw ex;
            }
            finally
            {

            }

            return response;
        }


where it is taking argument as the class file which accepts some parameters.

So now I need to pass the class file from aspx.cs with the properties same as the class.So I declared the class in the front end and I need to pass the data.

How can I do,please explain me with proper example?
Posted
Updated 5-Jan-14 21:46pm
v3
Comments
Anuja Pawar Indore 6-Jan-14 3:31am    
Always add you code under code block section, it makes much clear to read.
Member 8557048 6-Jan-14 3:47am    
Can you please give me clear solution to the above problem?

1 solution

 
Share this answer
 
Comments
Member 8557048 6-Jan-14 1:59am    
Actually I defined the hosted url in the aspx.cs code that accepts class with parameters.So for that I need to pass data to that wcf service

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900