Rapaport Prices WebService

Framework 2.0
Framework 4.0



Framework 2.0

RapPricesWebService.RapaportPrices webServiceManager = new RapPricesWebService.RapaportPrices();

//This must be done in HTTPS protocol
webServiceManager.Login("myUser", "myPassword");

//After log in you will receive a encrypted ticket with your credentials. This will be used to authenticate your session.
//Now you can choose to change the protocol to HTTP so it works faster.
webServiceManager.Url = "http" + webServiceManager.Url.Substring(5);

//GetPrice() Function
RapPricesWebService.RapaportPrice RapPriceClass = webServiceManager.GetPrice("Round", 0.4f, "D", "VS1");

decimal price = RapPriceClass.price;
decimal high_size = RapPriceClass.high_size;
decimal low_size = RapPriceClass.low_size;
DateTime date = RapPriceClass.Date;

//GetPriceSheet() Function
RapPricesWebService.RapaportPriceSheet RapPriceSheetDataSet =
webServiceManager.GetPriceSheet(TechnetSamples.RapPricesWebService.Shapes.Round);

DateTime date_ps = RapPriceSheetDataSet.Date;
string shape_ps = RapPriceSheetDataSet.Shape;

DataSet ds = RapPriceSheetDataSet.Prices;

foreach(DataRow dr in ds.Tables[0].Rows)
{
string clarity_ps = dr["Clarity"].ToString();
string color_ps = dr["Color"].ToString();
decimal low_size_ps = Convert.ToDecimal(dr["LowSize"]);
decimal high_size_ps = Convert.ToDecimal(dr["HighSize"]);
decimal price_ps = Convert.ToDecimal(dr["Price"]);
}



Framework 4.0

//in your binding setting increacse the timeout and buffer sizes
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>


RapaportPricesSoapClient webServiceManager = new RapaportPricesSoapClient();

//This must be done in HTTPS protocol
AuthenticationTicketHeader ticket = webServiceManager.Login("myUser", "myPassword");

//After log in you will receive a encrypted ticket with your credentials. This will be used to authenticate your session.
//Now you can choose to change the protocol to HTTP so it works faster.
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;

//GetPrice() Function
RapaportPrice RapPriceClass = webServiceManager.GetPrice(ticket,"Round", 0.4f, "D", "VS1");

decimal price = RapPriceClass.price;
decimal high_size = RapPriceClass.high_size;
decimal low_size = RapPriceClass.low_size;
DateTime date = RapPriceClass.Date;

//GetPriceSheet() Function
RapaportPriceSheet RapPriceSheetDataSet =
webServiceManager.GetPriceSheet(ticket,Shapes.Round);

DateTime date_ps = RapPriceSheetDataSet.Date;
string shape_ps = RapPriceSheetDataSet.Shape;

DataSet ds = RapPriceSheetDataSet.Prices;

foreach(DataRow dr in ds.Tables[0].Rows)
{
string clarity_ps = dr["Clarity"].ToString();
string color_ps = dr["Color"].ToString();
decimal low_size_ps = Convert.ToDecimal(dr["LowSize"]);
decimal high_size_ps = Convert.ToDecimal(dr["HighSize"]);
decimal price_ps = Convert.ToDecimal(dr["Price"]);
}