views:

375

answers:

2

Delphi 2009 imported the UPS WSDL without any errors, and I managed to invoke the web service with my account information and an example parcel ID. The response from the server is:

<detail>
  <err:Errors xmlns:err="http://www.ups.com/XMLSchema/XOLTWS/Error/v1.1"&gt;
    <err:ErrorDetail>
      <err:Severity>Hard</err:Severity>
      <err:PrimaryErrorCode>
        <err:Code>9150002</err:Code>
        <err:Description>Invalid or missing inquiry number - TrackingNumber, ShipmentIdentificationNumber, or ReferenceNumber</err:Description>
      </err:PrimaryErrorCode>
    </err:ErrorDetail>
  </err:Errors>
</detail>

Has somebody already sucessfully used the UPS Parcel Tracking web service with a Delphi client, and knows what is wrong?

Here is the client code:

var
  Service: TrackPortType;
  MyRequest: TrackRequest;
  Security: UPSSecurity;
  MyResponse: TrackResponse;
  ReqOpt: Array_Of_string;
begin
  Service := (HTTPRIO1 as TrackPortType);

  Security := UPSSecurity.Create;
  Security.UsernameToken := UsernameToken.Create;
  Security.UsernameToken.Username := 'username';
  Security.UsernameToken.Password := 'password';
  Security.ServiceAccessToken := ServiceAccessToken.Create;
  Security.ServiceAccessToken.AccessLicenseNumber := 'licensenumber';

  MyRequest := TrackRequest.Create;
  SetLength(ReqOpt, 1);
  ReqOpt[0] := '0';
  MyRequest.Request := Request.Create;
  MyRequest.Request.RequestOption := ReqOpt;
  MyRequest.TrackingOption := '02';
  MyRequest.InquiryNumber := '1Z...'; 

  try
    (Service as ISoapHeaders).Send(Security);
    MyResponse := Service.ProcessTrack(MyRequest, nil);
  except
    on E:ERemotableException do
    begin
      Memo1.Lines.Text := FormatXmlData(E.FaultDetail);
    end;    
  end;
A: 

Nsoftware made this !

Hugues Van Landeghem
they make this: $$$ :)
mjustin
A: 

Solved it with the Java API for XML Web Services (JAX-WS).

To integrate with Delphi, I proxy it as an Intranet Servlet. The Delphi GUI application then can use a simple HTTP request to query the tracking status.

mjustin