Developer Forum [ All Topics | New Topic ]

Thread: Update and Remove diamonds from Rapnet

Hi all,
I'm building a site to sell and buy diamonds,
I've downloaded the WSDL in your site and worked based on your example in the site.
Unfortunately you only supply Upload example but no Update and Remove.

I've looked at the function your WSDL have and found 2 functions I think I can use
1- UpdateLot
2- DeleteLots
but I have some problems 
1- In both function I don't see where I can put the diamond ID(your ID)
2- In update It's seems you want me to update per field. can't I send you a string like table with all fields to update?


>> add a comment
Gal avidan
01/19/2016 08:41


3 Replies:

code sample:

DiamondManager _manag = new DiamondManager();

_manag.Login("Username", "Password");

DeleteLotParameters dl = new DeleteLotParameters();

dl.ByField = ByFieldTypes.RapnetLotID;

dl.FieldValueList = "DiamondID_1,DiamondID_2.....,DiamondID_10";

_manag.DeleteLots(dl);



>> add a comment
Reuven
1/19/2016 10:06:00 AM
Thank you very much, But I still have problem with the Update 

>> add a comment
Gal avidan
1/19/2016 10:38:00 AM

public void weserviceUploadDelete()

{

DiamondManagerSoapClient webServiceManager = new DiamondManagerSoapClient();

AuthenticationTicketHeader ticket = webServiceManager.Login("UserName", "password");

UploadLotsParameters uploadManager = new UploadLotsParameters();

DeleteLotParameters d = new DeleteLotParameters();

d.FieldValueList = "aa-s";

d.ByField = ByFieldTypes.StockNum;

var ressult = webServiceManager.DeleteLots(ticket, d);

}

public void weserviceUploadUpdate()

{

DiamondManagerSoapClient webServiceManager = new DiamondManagerSoapClient();

//This must be done in HTTPS protocol

AuthenticationTicketHeader ticket = webServiceManager.Login("username", "password");

UploadLotsParameters uploadManager = new UploadLotsParameters();

UpdateLotParameters u = new UpdateLotParameters();

Lot Diamond = new DiamondManager.Lot();

u.ByField = ByFieldTypes.RapnetLotID;

u.FieldValue = "68624099";

Diamond.CertificateID = "3454565456";

Diamond.Lab = "GIA";

Diamond.Color = "E";

Diamond.Clarity = "IF";

Diamond.Weight = new decimal(4.4);

Diamond.Shape = "Pear";         

u.Lot = Diamond;

var ressult = webServiceManager.UpdateLot(ticket, u);

}



>> add a comment
Reuven
1/20/2016 9:09:00 AM