|
Framework 2.0
Framework 4.0
Framework 2.0
string FileContent = @"StockNumber,Shape,Weight,Color,Clarity"
+
Environment.NewLine + "1234,Round,1.0,E,VVS1";
//CSV format
DiamondManager webServiceManager =
new DiamondManager();
webServiceManager.Login("myUser",
"myPassword");
webServiceManager.Url = "http" + webServiceManager.Url.Substring(5);
UploadLotsParameters uploadManager =
new UploadLotsParameters();
uploadManager.FirstRowHeaders = true;
uploadManager.LotList = FileContent;
uploadManager.LotListFormat = LotListFormatTypes.Rapnet;
uploadManager.ReplaceAll = true;
webServiceManager.UploadLots(uploadManager);
GetLotsResult lots = webServiceManager.GetLots();
|
Framework 4.0
closeTimeout="00:05:00" openTimeout="00:05:00"
receiveTimeout="00:10:00" sendTimeout="00:05:00"
maxBufferSize="65536" maxBufferPoolSize="5242880" maxReceivedMessageSize="655360"
<system.web>
<compilation debug="false"/>
<httpRuntime executionTimeout="2000000"/>
</system.web>
DiamondManagerSoapClient webServiceManager = new DiamondManagerSoapClient();
AuthenticationTicketHeader ticket = webServiceManager.Login("myUser", "myPassword");
string oldAddress = webServiceManager.Endpoint.Address.ToString();
string newAddress = "http"
+ webServiceManager.Endpoint.Address.ToString().Substring(5);
System.ServiceModel.EndpointAddress address = new System.ServiceModel.EndpointAddress(newAddress);
webServiceManager.Endpoint.Address = address;
UploadLotsParameters uploadManager =
new UploadLotsParameters();
uploadManager.FirstRowHeaders = true;
string fileContent = File.ReadAllText(@"FilePath\File.csv");
uploadManager.LotList = fileContent;
uploadManager.ReplaceAll = true;
UploadLotsResult ressult = webServiceManager.UploadLots(ticket,uploadManager);
GetLotsResult lots = webServiceManager.GetLots(ticket);
|
|