BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Passing array

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation
View previous topic :: View next topic  
Author Message
ghoogeboom
Guest





PostPosted: Wed Dec 29, 2004 7:25 am    Post subject: Passing array Reply with quote



Hello,

I am trying to use webservices and I have to pass an array of
TBerichtEersteOntvangstMelding to the webservice. When i compile it goes ok
but when I run this code I get a error "Invalid variant type conversion".

I also tried to pass the TArrayOfBerichtEersteOntvangstMelding direktly but
then I get the error when i compile "Type not allowed in OLE Automation
call.

I als tried to send it using a VarArrayof(['', '0472210000AG', False, True,
1416406, '', 0, '', '', '', 'Diverse locaties', '04722',1416406, 1416406, 0,
0, '170107', 'Gemengd puin', 'C.01', 15000, 1, '112004'])).

But then i get the error when i run the code "SoapMapper : Putting data into
SoapMapper MessageEersteOntvangsMelding failed HRESULT=0x80070057 : The
parameter is incorrect.

- SoapMapper : Savinf SoapMapper Meldingen failed HRESULT=0x80070057 The
parameter is incorrect.

- Client : Unspecified client error. HRESULT=0x80070057: The parameter is
incorrect.

Does anybode know how to pass the array ??



Thanks in advance

Gert Hooogeboom





:Code :





type

TBerichtEersteOntvangstMelding = class(TObject)

MeldingsNummerMelder: WideString;

AfvalstroomNummer: WideString;

RouteInzameling: Boolean;

InzamelaarsRegeling: Boolean;

Ontdoener: Integer;

LocatieHerkomstPostcode: WideString;

LocatieHerkomstHuisnummer: Integer;

LocatieHerkomstHuisnummerToevoeging: WideString;

LocatieHerkomstWoonplaats: WideString;

LocatieHerkomstStraatnaam: WideString;

LocatieHerkomstNabijheidsBeschrijving: WideString;

LocatieOntvangst: WideString;

Afzender: Integer;

Inzamelaar: Integer;

Handelaar: Integer;

Bemiddelaar: Integer;

Afvalstof: WideString;

GebruikelijkeNaamAfvalstof: WideString;

VerwerkingsMethode: WideString;

TotaalGewicht: Integer;

AantalVrachten: Smallint;

PeriodeMelding: WideString;

end;

TBerichtMaandelijkseOntvangstMelding = class(TObject)

MeldingsNummerMelder: WideString;

AfvalstroomNummer: WideString;

TotaalGewicht: Integer;

AantalVrachten: Smallint;

PeriodeMelding: WideString;

end;

TBerichtAfgifteMelding = class(TObject)

MeldingsNummerMelder: WideString;

LocatieHerkomst: WideString;

EersteAfnemer: Integer;

Afvalstof: WideString;

GebruikelijkeNaamAfvalstof: WideString;

WijzeVanNuttigeToepassing: WideString;

TotaalGewicht: Integer;

AantalVrachten: Smallint;

PeriodeMelding: WideString;

end;

TArrayOfBerichtEersteOntvangstMelding = Array of
TBerichtEersteOntvangstMelding;

TArrayOfBerichtMaandelijkseOntvangstMelding = Array of
TBerichtMaandelijkseOntvangstMelding;

TArrayOfBerichtAfgifteMelding = Array of TBerichtAfgifteMelding;









procedure TfAmice.Button5Click(Sender: TObject);

Var

// Service: MeldingServiceSoap;

BerichtEersteOntvangstMelding : TBerichtEersteOntvangstMelding;

Eersteonvangstmeldingarray : TArrayOfBerichtEersteOntvangstMelding;

BerichtMelding : Variant;

Melding : Boolean;

Val: Boolean;

S, WSDL, WSML : OleVariant;

Namespace, Poort, Service : String;

DatumVan, DatumTot : tDateTime;

begin

// Hier de nieuwe melding maken

if windows.MessageBox(self.Handle, 'Wilt U de eerste ontvangst melding
uitvoeren ?', 'Vraag',MB_YESNO)=IDYES then

begin

fMaand:=tFMaand.Create(Self);

fMaand.caption:='Maand uitkiezen voor het uitvoeren van de meldingen';

if fMaand.ShowModal=mrOk then

begin

try

DatumVan:=fMaand.Datumvan.Date;

DatumTot:=fMaand.Datumtotmet.date;

fProgressBar := tfProgressBar.Create(Self);

fProgressBar.Caption:='Bezig met uitvoeren van de eerste ontvangstmelding';

fProgressBar.Show;

Try

S := CreateOleObject('MSSOAP.SoapClient30');

WSDL:='G:administraties01WebServicesAmiceMeldingService.WSDL';

WSML:='';

Service:='MeldingService';

Poort:='MeldingServiceSoap';

Namespace:='http://amice.lma.nl/AmiceWebServices/';

S.MSSoapInit(WSDL,Service,Poort,WSML);

S.ConnectorProperty['WinHTTPAuthScheme']:=1;

S.ConnectorProperty['AuthUser']:='username';

s.ConnectorProperty['AuthPassword']:='password';

s.ConnectorProperty['SSLClientCertificateName']:='CURRENT_USERMYcertificat';

s.ConnectorProperty['EndPointURL']:='https://212.78.182.205/Amice.WebService/AmiceBedrijfsnummerService.asmx';

fProgressBar.ProgressBar1.Max:=10;

BerichtEersteOntvangstMelding:=TBerichtEersteOntvangstMelding.Create;

BerichtEersteOntvangstMelding.MeldingsNummerMelder:='2004-12';

BerichtEersteOntvangstMelding.AfvalstroomNummer:='0472210000AG';

BerichtEersteOntvangstMelding.RouteInzameling:=False;

BerichtEersteOntvangstMelding.InzamelaarsRegeling:=True;

BerichtEersteOntvangstMelding.Ontdoener:=1416406;

BerichtEersteOntvangstMelding.LocatieHerkomstPostcode:='';

BerichtEersteOntvangstMelding.LocatieHerkomstHuisnummer:=0;

BerichtEersteOntvangstMelding.LocatieHerkomstHuisnummerToevoeging:='';

BerichtEersteOntvangstMelding.LocatieHerkomstWoonplaats:='';

BerichtEersteOntvangstMelding.LocatieHerkomstStraatnaam:='';

BerichtEersteOntvangstMelding.LocatieHerkomstNabijheidsBeschrijving:='Diverse
locaties';

BerichtEersteOntvangstMelding.LocatieOntvangst:='04722';

BerichtEersteOntvangstMelding.Afzender:=1416406;

BerichtEersteOntvangstMelding.Inzamelaar:=1416406;

BerichtEersteOntvangstMelding.Handelaar:=0;

BerichtEersteOntvangstMelding.Bemiddelaar:=0;

BerichtEersteOntvangstMelding.Afvalstof:='170107';

BerichtEersteOntvangstMelding.GebruikelijkeNaamAfvalstof:='Gemengd puin';

BerichtEersteOntvangstMelding.VerwerkingsMethode:='C.01';

BerichtEersteOntvangstMelding.TotaalGewicht:=15000; // In kilogrammen

BerichtEersteOntvangstMelding.AantalVrachten:=1;

BerichtEersteOntvangstMelding.PeriodeMelding:='112004';

SetLength(Eersteonvangstmeldingarray, 1);

DynArrayToVariant(BerichtMelding,Eersteonvangstmeldingarray,typeinfo(
ArrayOfBerichtEersteOntvangstMelding ));

// Hier de uiteindelijk aanvraag

Val := s.EersteOntvangstMelding(BerichtMelding);




if Val=False then windows.messagebox(self.Handle, 'Let op melding is niet
goed verstuurd !!!, probeer opnieuw ', 'Waarschuwing', MB_ICONERROR)

except

raise;

end;

finally

fProgressBar.free;

end;

end;

end;


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.