Home > Net >  What set the webserver need to pay attention to?
What set the webserver need to pay attention to?

Time:12-18

Web call webserver, front is normal, then the server update patch (KB4586830), is suggested to serialize, then I added a lot of the log, found that is not written in the program code, but to call the webservice times of wrong, invoke the webservice set what needs to be done?
Error log: UploadCheck - WEB address There was an error while trying to deserialize the parameter XX: UploadResult. Both Please see InnerException for more details.
 
//the server returns the Class
[WCF: : MessageContract (WrapperName="UploadDataResponse WrapperNamespace=" XX ")]
Public partial class UploadDataResponse
{
Private Wistron. LMS. BusinessEntities. GenericDataSet uploadResult;
Private Wistron. LMS. BusinessEntities. The Criteria the Criteria;

[WCF: : MessageBodyMember (Namespace="XX" and Name="UploadResult")]
Public Wistron. LMS. BusinessEntities. GenericDataSet UploadResult
{
The get {return uploadResult; }
The set {uploadResult=value; }
}

[WCF: : MessageBodyMember (Namespace="XX" and Name="Criteria")]
Public Wistron. LMS. BusinessEntities. The Criteria the Criteria
{
The get {return criteria; }
The set {criteria=value; }
}
}

//web receiving returns the Class
[System Diagnostics. DebuggerStepThroughAttribute ()]
[System.CodeDom.Com piler GeneratedCodeAttribute (" System. ServiceModel ", "4.0.0.0")]
[System. ServiceModel. MessageContractAttribute (WrapperName="UploadDataResponse WrapperNamespace=" XX ", IsWrapped=true)]
Public partial class UploadDataResponse {

[System. ServiceModel. MessageBodyMemberAttribute (Namespace="XX", the Order=0)]
The public System. Collections. Generic. Dictionary The Criteria;

[System. ServiceModel. MessageBodyMemberAttribute (Namespace="XX", the Order=1)]
Public Wistron. LMS. BusinessEntities. GenericDataSet UploadResult;

Public UploadDataResponse () {
}

Public UploadDataResponse (System. Collections. Generic. Dictionary The Criteria and Wistron. LMS. BusinessEntities. GenericDataSet UploadResult) {
Enclosing the Criteria=Criteria;
Enclosing UploadResult=UploadResult;
}
}

//server side methods
Public override UploadDataResponse UploadData (UploadDataRequest request)
{
The Criteria resultCriteria=null;
UploadDataResponse response=new UploadDataResponse ();
Try
{
Response. UploadResult=DispatcherLogic. UploadDataDispatcher ((UploadDataType) request. UploadDataType, request the Criteria, request. UploadData, out resultCriteria);
The response. The Criteria=resultCriteria;
}
The catch (Exception ex)
{
LogHelper. WriteLogs (DateTime. Now. The ToString () + "UploadDataDispatcher:" + ex. Message);
}
return response;
}

//web server-side method
Public GenericDataSet UploadCheck (string plant, the Criteria the Criteria, GenericDataSet genericDataTable)
{
PPServiceReference. PPServiceClient client=null;
Try
{
The client=ServiceClientManager . Take (plant);
PPServiceReference. UploadDataRequest request=new PPServiceReference. UploadDataRequest () {UploadData=https://bbs.csdn.net/topics/genericDataTable, UploadDataType=(int) UploadDataType. UploadCZCombineDN, Criteria=Criteria};
PPServiceReference. UploadDataResponse response=client. UploadData (request);
Return the response. UploadResult;
}
The catch (Exception ex)
{
LogHelper. WriteLogs (" UploadCheck - WEB "+ ex. Message);
return null;
}
The finally
{
If (client!=null) ServiceClientManager Return (ref client);
}
}

CodePudding user response:

Well, this thing, you make sure you received what,

Docking involves many things, you have to make sure no problem, in keep yourself no problem, if there is a change to the other party and you need to update the reference service, regenerated agent

CodePudding user response:

reference 1st floor wanghui0380 response:
well, the thing that you make sure you received what,

Docking involves many things, you have to make sure no problem, in keep yourself no problem, the other party if there is a change, you need to update the reference service, regenerated agent

Use their side, on which requires a web client and server side, the interface is a generic interface, the incoming returns are GenericDataSet class does not move, in DispatcherLogic. UploadDataDispatcher method in which there are judgment to determine which web access, and then write check method, so you should need not update the reference service
 
Public static GenericDataSet UploadDataDispatcher (UploadDataType UploadDataType, the Criteria the Criteria, GenericDataSet uploadData, out Criteria resultCriteria)
{
ResultCriteria=new Criteria ();
The switch (uploadDataType)
{
Case UploadDataType. WeeklyDemand:
Return EstimatedContainerDemandLogic. UploadEDCheck (uploadData, criteria, ref resultCriteria);
Case UploadDataType. CSDReutrnMaterial:
Return CSDFwdDeterminationLogic. UploadData (UploadData, criteria, ref resultCriteria);
Case UploadDataType. ContainerLoad:
Return ContainerLoadLogic. CrudContainerLoadData (uploadData, criteria, ref resultCriteria);
.
Default:
//No match the upload logic.
Throw new Exception (the string. Format (" {0}, No match the upload logic. ", uploadDataType. The ToString ()));
}
}

CodePudding user response:

  • Related