Announcements
No record found.
Hi,I called a customer service by C# and i'm getting this error:System.ServiceModel.CommunicationException: 'An error occurred while receiving the HTTP response tourl/soap/services/XXCServices.
Hi Sir,
Do you also get the error if your url contains the name of the method on the service/class eg.
url/.../create
Can you show us the code in question, please?
Hi Judy,
Where do you suggest that to replace the service name ? in which URL?
Hi Martin
sessionInfo = ((XXCustService)channel).getDetails(new getDetails(callContext,request1));
using AuthenticationUtility; using SoapUtility.XXCustServiceReference; using SoapUtility.UserSessionServiceReference; using System; using System.ServiceModel; using System.ServiceModel.Channels; using CallContext = SoapUtility.XXCustServiceReference.CallContext; namespace SoapConsoleApplication { class Program { public const string UserSessionServiceName = "XXCustServices"; [STAThread] static void Main(string[] args) { var aosUriString = ClientConfiguration.Default.UriString; var oauthHeader = OAuthHelper.GetAuthenticationHeader(true); var serviceUriString = SoapUtility.SoapHelper.GetSoapServiceUriString(UserSessionServiceName, aosUriString); var endpointAddress = new System.ServiceModel.EndpointAddress(serviceUriString); var binding = SoapUtility.SoapHelper.GetBinding(); var client = new XXCustServiceClient(binding, endpointAddress); var channel = client.InnerChannel; getCusTDetailsResponse sessionInfo = null; CallContext callContext = new CallContext { Company = "AA" }; var request1 = new XXCustReqContract(); request1.AccountNum = "AA-000011"; request1.DataArea = "AA"; using (OperationContextScope operationContextScope = new OperationContextScope(channel)) { HttpRequestMessageProperty requestMessage = new HttpRequestMessageProperty(); requestMessage.Headers[OAuthHelper.OAuthHeader] = oauthHeader; OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = requestMessage; sessionInfo = ((XXCustServce)channel).getDetails(new getDetails(callContext,request1)); } Console.WriteLine(); Console.ReadLine(); } } }
Your code looks good to me.
Did you also change the setup in ClientConfiguration class?
Does it work if you call a standard custom service instead of your own?
Hi Martin,
yes i changed client config
It works when i call another custom service that I own.
One thing that I did, is that I changed the service group name but I did a build for it and changed the links accordingly (latest is what I'm showing you).. could this be the reason?
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 475 Most Valuable Professional
André Arnaud de Cal... 399 Super User 2026 Season 2
CU10121822-0 374