Support Forum [ All Topics | New Topic ]

Thread: Failed to connect to technet.rapaport.com port 449

I am getting above error when i try to get response rapaportprices.
Error: HTTP Error: cURL ERROR: 7: Failed to connect to technet.rapaport.com port 449 after 0 ms: Connection refused

url: https://technet.rapaport.com:449/webservices/prices/rapaportprices.asmx
content_type:
http_code: 0
header_size: 0
request_size: 0
filetime: -1
ssl_verify_result: 0
redirect_count: 0
total_time: 0.000696
namelookup_time: 0.000378
connect_time: 0
pretransfer_time: 0
size_upload: 0
size_download: 0
speed_download: 0
speed_upload: 0
download_content_length: -1
upload_content_length: -1
starttransfer_time: 0
redirect_time: 0
redirect_url:
primary_ip:
certinfo: Array
primary_port: 0
local_ip:
local_port: 0
http_version: 0
protocol: 0
ssl_verifyresult: 0
scheme:
appconnect_time_us: 0
connect_time_us: 0
namelookup_time_us: 378
pretransfer_time_us: 0
redirect_time_us: 0
starttransfer_time_us: 0
total_time_us: 696


>> add a comment
Jaydip Patel
12/21/2021 12:06


9 Replies:

Hi 
please can you send us the code you are using 

POST /HTTP/JSON/Prices/GetPriceSheet.aspx HTTP/1.1
Host: technet.rapaport.com
Content-Type: application/x-www-form-urlencoded
Cookie: ASP.NET_SessionId=1f03niq5rzeyt20skbsijswe
Content-Length: 165
{
"request": {
"header": {
"username": "",
"password": ""
},
"body": {
'shape' : 'round',
'size' : 2.10,
'color' : 'E',
'clarity' : 'VS2'
}
}
}






>> add a comment
RapNet Technical
12/21/2021 5:08:00 AM
require_once('../../nusoap-0.9.5/lib/nusoap.php');
$rap_soapUrl = "https://technet.rapaport.com/webservices/prices/rapaportprices.asmx?wsdl";
$soap_Client = new nusoap_client($rap_soapUrl, 'wsdl');
$rap_credentials['Username'] = $Rusername;
$rap_credentials['Password'] = $Rpassword;
$result = $soap_Client->call('Login', $rap_credentials);
$err_msg = $soap_Client->getError();
if ($err_msg) {
// Print error msg
echo 'Error: '.$err_msg;
} else {
// Print result
echo 'Result: ';
print_r($result);
}
$rap_auth_ticket = $soap_Client->getHeaders();


>> add a comment
Jaydip Patel
12/22/2021 11:06:00 PM
Try This code 


<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://technet.rapaport.com/HTTP/JSON/Prices/GetPriceSheet.aspx');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/x-www-form-urlencoded'
));
$request->setBody('\n{\n"request": {\n"header": {\n"username": "", \n"password": ""\n\n}, \n"body": {\n\'shape\' : \'round\',\n\'size\' : 2.10,\n\'color\' : \'E\',\n\'clarity\' : \'VS2\'\n\n}\n}\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}


>> add a comment
RapNet Technical
12/23/2021 9:05:00 AM
The username and password should be the Access key provided by the client 

see article 

https://help.rapnet.com/en/articles/4769280-access-keys-video-tutorial
Thanks 

>> add a comment
RapNet Technical
12/23/2021 9:07:00 AM
Already try the above code but didn't get success.

Actually, the problem was when I try to get a response from the above end-point 449 port is blocked from the server side so I am not getting response.

I have also another server and try with that server and the above code is working well.

Is there any different ways to get a response from the above end-point.

>> add a comment
Jaydip Patel
12/26/2021 11:37:00 PM
This is the only endpoint for this API 
I recommend you whitelist this end point 

Thanks 

>> add a comment
RapNet Technical
12/27/2021 4:19:00 AM
Try to getting price list with below code but didn't get it.

$auth_url = "https://technet.rapaport.com/HTTP/Authenticate.aspx";
$post_string = "username=106872&password=" . urlencode("Hetupriy999");
//create HTTP POST request with curl:
$request = curl_init($auth_url); // initiate curl object
curl_setopt($request, CURLOPT_HEADER, 0); // set to 0 to eliminate header info from response
curl_setopt($request, CURLOPT_RETURNTRANSFER, 1); // Returns response data instead of TRUE(1)
curl_setopt($request, CURLOPT_POSTFIELDS, $post_string); // use HTTP POST to send form data
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, FALSE); // uncomment this line if you get no gateway response.
$auth_ticket = curl_exec($request); // execute curl post and store results in $auth_ticket
echo "<pre>"; print_r($auth_ticket); echo "</pre>";
curl_close ($request);
//2 - prepare HTTP request for data.
$feed_url = "https://technet.rapaport.com/HTTP/JSON/Prices/GetPriceSheet.aspx";
// $feed_url .= "?ticket=".$auth_ticket; //add authentication ticket:
$ch = curl_init( $url );
# Setup request to send json via POST.
// $payload = json_encode( array( "Ticket"=> $auth_ticket, "shape"=> 'round' ) );
$payload = json_encode( array( "shape"=> 'round' ) );
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt( $ch, CURLOPT_POSTFIELDS, $payload );
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json','Ticket' => $auth_ticket));
# Return response instead of printing.
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
# Send request.
$result = curl_exec($ch);
curl_close($ch);
// Will dump a beauty json :3
echo "<pre>"; print_r(json_decode($result, true)); echo "</pre>"; exit();


>> add a comment
Jaydip Patel
12/29/2021 4:22:00 AM
Hi Jaydip 
Please can you give me your e-mail address so I can send you some code 
Thanks 

>> add a comment
RapNet Technical
12/29/2021 4:55:00 AM
Below is my email address.

jaydip.patel@triveniglobalsoft.com

>> add a comment
Jaydip Patel
12/29/2021 11:15:00 PM