Developer Forum [ All Topics | New Topic ]

Thread: Delphi support arrived! Last few questions...

  Hi Guys!

OK, I now managed to write successful Delphi code to connect to technet! I am sussing out the last few bugs and need some technical assistance:

1. Login issues:
   Once I coded my Service.Login() function it logs on fine, but when I create an instance of RapaportProcesSoap and pass the 4Cs variables, I get one of two different AV's:
      a) When I call the GetPrice() function AFTER calling the Login() function I get: "Unable to process             request -> You are not logged in"
      b) or I get: "Access Violation...."
2. Upon Importing the WSDL Data types, Delphi converted xsd:decimal types to TXSDecimal, which has several sub-properties declared, such as DecimalString and BCD - none of which accept standard String/WideString or Float values respectively. This created yet another AV.

I am using HTTPS for the Login() calls and currently remain on HTTPS for subsequent calls. Is this the problem?

Any advice would be appreciated!


>> add a comment
Hendrik Potgieter
04/13/2010 03:21


5 Replies:

Hi
when you call get prices do you pass the ticket?

In the xml it looks something like this:

<?xml version="1.0" encoding="UTF-8"?>

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">

  <Header>

    <AuthenticationTicketHeader xmlns="http://technet.rapaport.com/">

      <Ticket>D872C1BF14D7C25E2FAA444295D4D89B7BC537C68F48D4C5923662117619C183B3364100EDE971822B75ADFE9489383ABAAF4AD6F6B7632E2D1073F772EA9F850E5D6CDCE8EA14CE45B2BB70A38D64FC14868D6FF4D99914E94BA12426C0D936DF2326DB4DDE270A63A08F6AEE7BD1E2FCFA5C407690C7B8E3597A016F0B330E001F1F804CB3ACA158D631B0D104B224</Ticket>

    </AuthenticationTicketHeader>

  </Header>

  <Body>

…..

…..

  </soap:Body>

</soap:Envelope>

 



>> add a comment
Ahaliav Fox
4/14/2010 1:02:00 AM
Hi Ahaliav,

I actually do not. I assumed that the ticket is return within the context of the Login() function and subsequently passed as such to calls following the login process? I guess not.

I have test generated a authentication ticket on your site, but I have now return values/parameters from the Delphi function calls with which to access this ticket. Any idea how I can get my hands on the ticket generated on every Login() call?

Looking forward to your assistance!


>> add a comment
Hendrik Potgieter
4/14/2010 1:55:00 AM

You’re supposed to received from the login  something like this:

 

<?xml version="1.0" encoding="UTF-8"?>

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"

  xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <soap:Header>

    <AuthenticationTicketHeader xmlns="http://technet.rapaport.com/">

      <Ticket>D872C1BF14D7C25E2FAA444295D4D89B7BC537C68F48D4C5923662117619C183B3364100EDE971822B75ADFE9489383ABAAF4AD6F6B7632E2D1073F772EA9F850E5D6CDCE8EA14CE45B2BB70A38D64FC14868D6FF4D99914E94BA12426C0D936DF2326DB4DDE270A63A08F6AEE7BD1E2FCFA5C407690C7B8E3597A016F0B330E001F1F804CB3ACA158D631B0D104B224</Ticket>

    </AuthenticationTicketHeader>

  </soap:Header>

  <soap:Body>

    <LoginResponse xmlns="http://technet.rapaport.com/"/>

  </soap:Body>

</soap:Envelope>



>> add a comment
Ahaliav Fox
4/14/2010 2:07:00 AM
Hi There,

Delphi, upon importing the WSDL file, converted the function calls and Type Declarations to the closest compatible Delphi Data Types (String, DateTime, Double/Float). It successfully imported the three main functions, namely:

/* DELPHI CODE START */

// ************************************************************************ //
  // Namespace : http://technet.rapaport.com/
  // soapAction: http://technet.rapaport.com/%operationName%
  // transport : http://schemas.xmlsoap.org/soap/http
  // binding   : RapaportPricesSoap
  // service   : RapaportPrices
  // port      : RapaportPricesSoap
  // URL       : http://technet.rapaport.com/webservices/prices/rapaportprices.asmx
  // ************************************************************************ //
  RapaportPricesSoap = interface(IInvokable)
  ['{368D9022-99D0-8862-9B60-F53D44E2F49A}']
    procedure Login(const Username: WideString; const Password: WideString); stdcall;
    function  GetPriceSheet(const shape: Shapes): RapaportPriceSheet; stdcall;
    function  GetPrice(const shape: WideString; const size: Single; const color: WideString; const clarity: WideString): RapaportPrice; stdcall;
  end;

/* DELPHI CODE END */

When calling the Login() function, I am only able to pass the Username and Password. The login function seems to work fine, but I get an error (not authenticated) when calling any subsequent functions. I can access the AuthenticationTickerHeader, but I get AV's when attempting to read the TICKET property... Herewith the Delphi code after translating from XML, for the AuthenticationTicketHeader within the NameSpace of http://technet.rapaport.com

/* DELPHI CODE START */

// ************************************************************************ //
  // Namespace : http://technet.rapaport.com/
  // ************************************************************************ //
  AuthenticationTicketHeader = class(TSOAPHeader)
  private
    FTicket: WideString;
  published
    property Ticket: WideString read FTicket write FTicket;
  end;

/* DELPHI CODE END */

My problem is this: Even if I could successfully access the Ticket (WideString), how do i send it with my Login() call? OR Do I need to include this Ticket in the other functions and if so How? Neither of them [GetPrice(), GetPriceSheet()] accept a Ticket parameter/variable to go to the server. Any ideas on how I can fix this? Are there hidden functions lurking somewhere on the Rapaport server that the standard WSDL file does not expose?

******************************************************************************************************************

Then, assuming that I was eventually able to make successful calls to GetPrice() and/or GetPriceSheet(), how do i import the Sheet.Prices dataset into a SQL Server/MS Access table? What is the official structure of the Rapaport Pricelist DB Table? I cannot seem to access rows/columns in the Prices returned variable... Unless "Prices" is actually sent as a Serialized string (like CSV), which I need to programmatically parse and break up into Rows/Columns?

My apologies for the many many questions, but it is very important for me to complete my software, as it will revolutionary for the international Diamond Trading Industry.

I look forward to any assistance, thank you very very very much!

Adios - Hendrik.


>> add a comment
Hendrik Potgieter
4/14/2010 10:12:00 AM


LogIn()
Xml sent

<?xml version="1.0" encoding="UTF-8"?>

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">

 <Body>

    <Login xmlns="http://technet.rapaport.com/">

      <Username>user</Username>

      <Password>pass</Password>

    </Login>

 </Body>

</Envelope>

Xml received

<?xml version="1.0" encoding="UTF-8"?>

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"

 xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

 <soap:Header>

    <AuthenticationTicketHeader xmlns="http://technet.rapaport.com/">

      <Ticket>5288BEE9C66738560BC41DD71BC2E503A44B7F7FD6D743EF9CCDF9E8924BA4CA60227FB0E8EA97D98F6E93A8E4E8D3FBAED4F3EC1BFF112E20A69CBE13C8A82A0BA019EC06E98603F352AF93B054AB970F786FA57FDDED692DBCB34C1FAE5E0A81DB2387AFC9569961B4E6F1C90FD3336801693A7C907B29384B18349408A5DD1E9310CB0E7DA78D909D16F0E0F9ED50</Ticket>

    </AuthenticationTicketHeader>

 </soap:Header>

 <soap:Body>

    <LoginResponse xmlns="http://technet.rapaport.com/"/>

 </soap:Body>

</soap:Envelope>

Now for example i will call the function GetPrice()

Xml sent

<?xml version="1.0" encoding="UTF-8"?>
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
  <Header>
    <AuthenticationTicketHeader xmlns="http://technet.rapaport.com/">
      <Ticket>5288BEE9C66738560BC41DD71BC2E503A44B7F7FD6D743EF9CCDF9E8924BA4CA60227FB0E8EA97D98F6E93A8E4E8D3FBAED4F3EC1BFF112E20A69CBE13C8A82A0BA019EC06E98603F352AF93B054AB970F786FA57FDDED692DBCB34C1FAE5E0A81DB2387AFC9569961B4E6F1C90FD3336801693A7C907B29384B18349408A5DD1E9310CB0E7DA78D909D16F0E0F9ED50</Ticket>
    </AuthenticationTicketHeader>
  </Header>
  <Body>
    <GetPrice xmlns="http://technet.rapaport.com/">
      <shape>Round</shape>
      <size>1.0</size>
      <color>E</color>
      <clarity>VS1</clarity>
    </GetPrice>
  </Body>
</Envelope>

Xml received

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soap:Body>
    <GetPriceResponse xmlns="http://technet.rapaport.com/">
      <GetPriceResult Date="2010-03-19T00:00:00">
        <shape>Round</shape>
        <low_size>1.00</low_size>
        <high_size>1.49</high_size>
        <color>E</color>
        <clarity>VS1</clarity>
        <price>10500.0000</price>
      </GetPriceResult>
    </GetPriceResponse>
  </soap:Body>
</soap:Envelope>



>> add a comment
Ahaliav Fox
4/15/2010 3:27:00 AM