VisualCron v8.4.1 Web API issue - VisualCron - Forum

Community forum

joel.wang
2019-02-19T00:43:11Z
Hi

I recently update VisualCron from v8.3.3 to v8.4.1, when I use web api I encountered the following error message:

"The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error."

my code is as following:
Quote:


BasicHttpBinding basicAuthBinding = new BasicHttpBinding(System.ServiceModel.BasicHttpSecurityMode.TransportCredentialOnly)
{
MaxBufferPoolSize = int.MaxValue,
MaxReceivedMessageSize = int.MaxValue,
MaxBufferSize= int.MaxValue,
ReaderQuotas = new XmlDictionaryReaderQuotas()
{
MaxArrayLength = int.MaxValue,
MaxStringContentLength = int.MaxValue,
MaxNameTableCharCount = int.MaxValue
},
SendTimeout = new TimeSpan(5, 0, 0),
ReceiveTimeout = new TimeSpan(5, 0, 0),
CloseTimeout = new TimeSpan(5, 0, 0),
OpenTimeout = new TimeSpan(5, 0, 0)
};
basicAuthBinding.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.Basic;
webClient = new VisualCronWebService.WebServiceClient(basicAuthBinding, new EndpointAddress("http://localhost:8001/VisualCron"));

if (webClient.ChannelFactory.Credentials != null)
{
webClient.ChannelFactory.Credentials.UserName.UserName = "joel";
webClient.ChannelFactory.Credentials.UserName.Password = "password";
}

foreach (OperationDescription op in webClient.ChannelFactory.Endpoint.Contract.Operations)
{
var dataContractBehavior = op.Behaviors.Find<DataContractSerializerOperationBehavior>();
if (dataContractBehavior != null)
{
dataContractBehavior.MaxItemsInObjectGraph = int.MaxValue;
}
}

VisualCronWebService.JobClass jc = null;
try
{
jc = webClient.Job_GetByName("job name");
}
catch (Exception ex)
{
jc = null;
}



the exception message comes with the red "ex"

when I use v8.3.3 the above code works fine.

Any useful information will be appreciated.

Thanks.
joel.wang
2019-02-19T05:50:21Z
Hi

I find out the fix,

var token = webClient.Logon("joel", "password", 3600);

need to executed above line before any wcf calls, this is because new version of wcf add another layer of token validation I think, which is not needed in v8.3.3

the topic can be closed now.
Support
2019-02-19T07:12:04Z
Originally Posted by: joel.wang 

Hi

I find out the fix,

var token = webClient.Logon("joel", "password", 3600);

need to executed above line before any wcf calls, this is because new version of wcf add another layer of token validation I think, which is not needed in v8.3.3

the topic can be closed now.



Yes, thanks, we added a parameter.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top