var binding = new System.ServiceModel.WSHttpBinding();
endpointAddress = new System.ServiceModel.EndpointAddress(serviceAddress);
sisAXIntegrationServiceClient = new CMCSISIntegration.ServiceReference.SISDynamicsAXService.DynamicsAxServiceClient(binding, endpointAddress);
fundSource = CMCFundSource::find(_cmcINTGFundSource.FundSourceCode, true);
addUpdateFundSourceInMsg = new CMCSISIntegration.ServiceReference.SISDynamicsAXService.AddUpdateFundSourceInMsg();
addUpdateFundSourceInMsg.set_Code(_cmcINTGFundSource.FundSourceCode);
addUpdateFundSourceInMsg.set_Description(fundSource.Description);
addUpdateFundSourceInMsg.set_TypeCode(CMCFundSourceType::findByRecId(fundSource.FundSourceType).FundSourceTypeCode);
addUpdateFundSourceInMsg.set_Active(_cmcINTGFundSource.IsActive);
addUpdateFundSourceInMsg.set_IncludeRemainNeed(true);
addUpdateFundSourceInMsg.set_GraceDays(0);
addUpdateFundSourceInMsgs = new CMCSISIntegration.ServiceReference.SISDynamicsAXService.AddUpdateFundSourceInMsg[1]();
addUpdateFundSourceInMsgs.SetValue(addUpdateFundSourceInMsg, 0);
addUpdateFundSourceRequest = new CMCSISIntegration.ServiceReference.SISDynamicsAXService.AddUpdateFundSourceRequest();
addUpdateFundSourceRequest.set_TokenId(tokenId);
addUpdateFundSourceRequest.set_AddUpdateFundSourceInMsgs(addUpdateFundSourceInMsgs);
addUpdateFundSourceResponse = sisAXIntegrationServiceClient.AddUpdateFundSource(addUpdateFundSourceRequest);
Please find the code Above... to give you a small insignt,
we have created a new serviceClient "sisAXIntegrationServiceClient" which is our Wcf Service hosted on another Server using a wshttpbinding.
The below is the method we are calling from the service after filling in the inmesage and data contract details..
addUpdateFundSourceResponse = sisAXIntegrationServiceClient.AddUpdateFundSource(addUpdateFundSourceRequest);
Just to give a note here, we are consuming Soap Service and WCF service, this issue is happening only for WCF service, Soap Service is working fine.
Let me know if you need more details....