|
I am trying to upload an inventory on rapnet using SOAP but i cant. please help me with sample code
|
>> add a comment
|
kirmal7115@gmail.com
01/10/2018 11:53
|
|
7
Replies:
|
Yogesh, Thank you for contacting the Developer forum and please let us know if you have further questions.
Please feel free to send a copy of the 'request' code you are using to tech@diamonds.net for us to check and which error you are getting.
Sample SOAP code is found here: https://technet.rapaport.com/webservices/Upload/DiamondManager.asmx?op=UploadLots
===================================================================== Below is an Uploadlots API SOAP example: First is the logon - change Username and Password. Then the Uploadlots API SOAP request.
Login:
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <Login xmlns="http://technet.rapaport.com/"> <Username>username</Username> <Password>password</Password> </Login> </soap:Body> </soap:Envelope> Uploadlots: <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header> <AuthenticationTicketHeader xmlns="http://technet.rapaport.com/"> <Ticket>1234abcde5678901234x5x6x7xx8x901 </Ticket> </AuthenticationTicketHeader> </soap:Header> <soap:Body> <UploadLots xmlns="http://technet.rapaport.com/"> <Parameters> <LotList>StockNum,CertID,StoneCount,Country,City,State,Shape,Weight,Clarity,Comments,Lab,Color,FancyColor,FCIntensity,FCOvertone,Cut,Polish,Symmetry,FluorescenceIntensity,FluorescenceColor,Length,Width,Height,Measurements,Depth,Table,Crown Height,Crown Angle,PavilionDepth,Pavilion Angle,GirdleThick,GirdleThin,Girdle Condition,GirdlePercent,Culet,Culet Condition,Treatment,Laser Inscription,RapnetDiscount,TotalPrice,PricePerCarat,IsMatchPair,PairStockNumber,IsPairSeparable,ClarityDescription,Black Inclusion,Milky,Shade,Center Inclusion,CertFilename,ImageFile,brand,CashAskingPrice,CashDiscountPercent ss,11016087003,1,Belgium,Antwerpen,,Emerald,5.3,VVS1,,HRD,I,,,,,EX,G,None,,6.06,4.79,3.58,6.06x4.79x3.58,74.7,66,20,0,50.5,0,,Medium,Polished,4,,Linear,,,-45,,,FALSE,,,,,,,,2165610174.pdf,,,, aa-s,11016910006,1,Israel,Ramat-Gan,,Round,5.03,SI2,,HRD,E,,,,F,VG,VG,Strong,,9.8,9.88,6.54,9.8x9.88x6.54,66.5,52,17.5,35.7,43.5,41.1,,Thick,Faceted,5.5,,Pointed,,,-53,,,FALSE,,,,,,,, 380-166.pdf,M-IL-401.jpg,Canada Mark,, aa124,11020492004,1,Belgium,Antwerpen,,Round,5.53,VVS2,,HRD,K,,,,VG,EX,VG,Faint,,7.32,7.33,4.66,7.32x7.33x4.66,63.7,59,15.5,36.7,44.5,41.8,,Medium,,3.5,,Pointed,,,-25,,,FALSE,,,,,,,,11020492004.pdf,Test.png,,,</LotList> <LotListFormat>Rapnet</LotListFormat> <ReplaceAll>false</ReplaceAll> <FirstRowHeaders>true</FirstRowHeaders> <ReportOption>None</ReportOption> </Parameters> </UploadLots> </soap:Body> </soap:Envelope>
|
>> add a comment
|
Tech customer support -Zalman
1/11/2018 9:28:00 AM
|
|
|
Hello Zalman,
Thanks for your reply and sorry to delay from my side, I generate "UploadLotsCreateFile" successfully and what to do after that to upload that created file into my inventory?.
Thanks Yogesh.
|
>> add a comment
|
yogesh
1/24/2018 6:35:00 AM
|
|
|
I used below code to upload the lot to my inventory.
<?php //prepare soap request to Rapaport: $rap_soapUrl = "https://technet.rapaport.com/webservices/Upload/DiamondManager.asmx?WSDL"; $soap_Client = new nusoap_client($rap_soapUrl, 'wsdl'); $client = new SoapClient('https://technet.rapaport.com/webservices/Upload/DiamondManager.asmx?WSDL'); $rap_credentials['Username'] = "86***"; $rap_credentials['Password'] = "*****jk*****"; //do login, and save authentication ticket for further use: $result = $soap_Client->call('Login', $rap_credentials); $rap_auth_ticket = $soap_Client->getHeaders(); $lot['RapnetLotID'] = ""; $lot['IndexLotID'] =""; $lot['SellerID'] = 105649; $lot['Shape'] = 'round'; $lot['Weight'] = 0.4; $lot['Color']= 'f'; $lot['FancyColor'] = 'round'; $lot['FancyColorIntensity'] = ""; $lot['FancyColorOvertone'] =""; $lot['Clarity'] = "if"; $lot['Measurements'] = "8.49 x 5.69 x 3.58"; $lot['MeasLength'] = ""; $lot['MeasWidth'] = ""; $lot['MeasDepth'] = ""; $lot['DepthPercent'] = "62.9"; $lot['TablePercent'] = "63.4"; $lot['GirdleMin'] = "Medium to Very Thick"; $lot['GirdleMax'] = "df"; $lot['GirdlePercent'] = 10.6; $lot['GirdleCondition'] = "sf"; $lot['CuletCondition'] = "ios"; $lot['CuletSize'] = "78"; $lot['Polish'] = "pol"; $lot['Symmetry'] = "sdfsf"; $lot['FluorescenceColor'] = "n"; $lot['FluorescenceIntensity'] = "n"; $lot['CrownHeight'] = ""; $lot['CrownAngle'] = ""; $lot['PavilionDepth'] = ""; $lot['PavilionAngle'] = ""; $lot['Make'] = ""; $lot['Cut'] = ""; $lot['Enhancement'] = ""; $lot['Comment'] = ""; $lot['Lab'] = ""; $lot['CertificateID'] = "9876543210"; $lot['CertificateImage'] = ""; $lot['LaserInscription'] = ""; $lot['VendorStockNumber'] = ""; $lot['MatchingVendorStockNumber'] = ""; $lot['IsMatchedPairSeparable'] = ""; $lot['ParcelStoneCount'] = ""; $lot['RapnetAskingPrice'] = ""; $lot['IndexAskingPrice'] = ""; $lot['Availability'] = ""; $lot['IsActive'] = ""; $lot['ShowOnRapnet'] = ""; $lot['ShowOnIndex'] = ""; $lot['Terms'] = ""; $lot['TradeShow'] = ""; $lot['CityLocation'] = ""; $lot['StateLocation'] = ""; $lot['CountryLocation'] = ""; $lot['SarinFile'] = ""; $lot['ClientRowID'] = ""; $lot['EyeClean'] = ""; $lot['MemberComments'] = ""; $lot['KeyToSymbols'] = ""; $lot['StarLength'] = ""; $Parameters = array(); $Parameters['LotList'] = $lot; $Parameters['LotListFormat'] = "RapXML"; $Parameters['ReplaceAll'] = 0; $Parameters['FirstRowHeaders'] = 0; $soap_Client->setHeaders($rap_auth_ticket); $result = $soap_Client->call('UploadLots' , array($Parameters)); echo "<pre>"; print_r($result); ?>
|
>> add a comment
|
yogesh
1/24/2018 6:39:00 AM
|
|
|
Cory, If you need additional assistance, contact tech@diamonds.net and I plan to get to you Sunday or Monday.
Did you try the 'UploadLots' endpoint example I posted above? Did you get errors? The file goes between <LotList>...csv here...</LotList>
|
>> add a comment
|
Tech customer support -Zalman
1/25/2018 11:31:00 AM
|
|
|
Hello Zalman, I sent mail on tech@diamonds.net but I didn't reply, and now i upload lots successfully but i need bit more help from you about update stone details on rapnet.
|
>> add a comment
|
yogesh
2/1/2018 1:56:00 AM
|
|
|
as you suggest me code above i try with that but i facing an error my code and error are below.
=================================== code ==================================
<?php require_once('lib/nusoap.php'); $rap_soapUrl = "https://technet.rapaport.com/webservices/Upload/DiamondManager.asmx?WSDL"; $soap_Client = new nusoap_client($rap_soapUrl, 'wsdl'); $rap_credentials['Username'] = "86025"; $rap_credentials['Password'] = "********"; //do login, and save authentication ticket for further use: $result = $soap_Client->call('Login', $rap_credentials); $rap_auth_ticket = $soap_Client->getHeaders(); $Parameters['LotList'] = 'StockNum,CertID,StoneCount,Country,City,State,Shape,Weight,Clarity,Comments,Lab,Color,FancyColor,FCIntensity,FCOvertone,Cut,Polish,Symmetry,FluorescenceIntensity,FluorescenceColor,Length,Width,Height,Measurements,Depth,Table,Crown Height,Crown Angle,PavilionDepth,Pavilion Angle,GirdleThick,GirdleThin,Girdle Condition,GirdlePercent,Culet,Culet Condition,Treatment,Laser Inscription,RapnetDiscount,TotalPrice,PricePerCarat,IsMatchPair,PairStockNumber,IsPairSeparable,ClarityDescription,Black Inclusion,Milky,Shade,Center Inclusion,CertFilename,ImageFile,brand,CashAskingPrice,CashDiscountPercent // ss,11016087003,1,Belgium,Antwerpen,,Emerald,5.3,VVS1,,HRD,I,,,,,EX,G,None,,6.06,4.79,3.58,6.06x4.79x3.58,74.7,66,20,0,50.5,0,,Medium,Polished,4,,Linear,,,-45,,,FALSE,,,,,,,,2165610174.pdf,,,, // aa-s,11016910006,1,Israel,Ramat-Gan,,Round,5.03,SI2,,HRD,E,,,,F,VG,VG,Strong,,9.8,9.88,6.54,9.8x9.88x6.54,66.5,52,17.5,35.7,43.5,41.1,,Thick,Faceted,5.5,,Pointed,,,-53,,,FALSE,,,,,,,, 380-166.pdf,M-IL-401.jpg,Canada Mark,, // aa124,11020492004,1,Belgium,Antwerpen,,Round,5.53,VVS2,,HRD,K,,,,VG,EX,VG,Faint,,7.32,7.33,4.66,7.32x7.33x4.66,63.7,59,15.5,36.7,44.5,41.8,,Medium,,3.5,,Pointed,,,-25,,,FALSE,,,,,,,,11020492004.pdf,Test.png,,,'; $Parameters['LotListFormat'] = 'RapXML'; $Parameters['ReplaceAll'] = 0; $Parameters['FirstRowHeaders'] = 1; $Parameters['ReportOption'] ='None'; $soap_Client->setHeaders($rap_auth_ticket); $result = $soap_Client->call('UploadLots',$Parameters); print_r($result);
============================ Error ================================
Array ( [faultcode] => soap:Server [faultstring] => System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.NullReferenceException: Object reference not set to an instance of an object. at DiamondManager.UploadLots(UploadLotsParameters Parameters) --- End of inner exception stack trace --- [detail] => )
I hope you get me.
|
>> add a comment
|
yogesh
2/2/2018 12:56:00 AM
|
|
|
Yogesh, I think this will be better if we talk thru email at Tech@diamonds.net. The PHP code above does not look to be correct, with some of the data commented out (//). Please let me know why the working SOAP example did not work for you.
Looking forward to your emailed response, Thank you.
|
>> add a comment
|
Tech customer support -Zalman
2/5/2018 10:45:00 AM
|
|