![]() |
AW: Webservice
Zitat:
Wenn die Komponenten im Code dynamisch erzeugt werden, spart man sich auch die Package-Installation und kann neue Projekte parallel mit der neuen Version entwickeln. |
AW: Webservice
Zitat:
|
AW: Webservice
Habe es glaube ich rausgefunden.
Bis hierher schonmal danke an alle! |
AW: Webservice
Was ich aber noch nicht so richtig verstanden habe ist
was es mit der Try....Finally usw. Anweisung auf sich hat!? |
AW: Webservice
Ich möchte dir die offizielle Dokumentation ans Herz legen, auch für weitere allgemeinere Fragen zu Delphi und seinen Sprachkonstrukten:
![]() ![]() |
AW: Webservice
Liste der Anhänge anzeigen (Anzahl: 1)
Kann jemand mit folgender FM (siehe Screen-Shot Anhang) was anfangen?
Delphi-Quellcode:
Result: String;
Test:TIdHeaderInfo; //IdLogDebug: TIdLogDebug; procedure TForm1.Button1Click(Sender: TObject); begin IdHTTP1:=TIdHTTP.Create(nil); HTTP_Stream:= TStringStream.Create(''); Body:=TStringlist.Create; Body.Add('<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cim="http://cim.osram.ws.gefasoft.com/" xmlns:dat="http://cim.osram.ws.gefasoft.com/DataContracts">'); Body.Add('<soapenv:Header/>'); Body.Add('<soapenv:Body>'); Body.Add('<cim:GetLotInfoByLotName>'); Body.Add('<cim:requestMessage>'); Body.Add('<dat:ToolCode>?</dat:ToolCode>'); Body.Add(' <dat:CheckSlotPos>false</dat:CheckSlotPos>'); Body.Add('<dat:EquipmentValidation>false</dat:EquipmentValidation>'); Body.Add('<dat:LotName>R173419P</dat:LotName>'); Body.Add('<dat:ReturnBrokenWafers>true</dat:ReturnBrokenWafers>'); Body.Add('<dat:UseSlotPosition>false</dat:UseSlotPosition>'); Body.Add('</cim:requestMessage>'); Body.Add('</cim:GetLotInfoByLotName>'); Body.Add('</soapenv:Body>'); Body.Add('</soapenv:Envelope>'); Url:= 'http://tst-rbg14:8019/Lot.svc'; IdHTTP1.Post('http://tst-rbg14:8019/Lot.svc',Body,HTTP_Stream); IdHTTP1.ProtocolVersion:=pv1_1; try // IdHTTP1.ProtocolVersion:='1.1'; IdHTTP1.Request.AcceptEncoding:= 'gzip,deflate'; IdHTTP1.Request.ContentType:='text/xml'; IdHTTP1.Request.ContentEncoding:='UTF-8'; IdHTTP1.Request.ExtraHeaders.Add('http://cim.osram.ws.gefasoft.com/ILot/GetLotInfoByLotName'); IdHTTP1.Request.ContentLength:= 918; IdHTTP1.Host:= 'tst-rbg14:8019'; IdHTTP1.Request.Connection:='Keep-Alive'; IdHTTP1.Request.UserAgent:= 'Apache-HttpClient/4.1.1 (java 1.5)'; IdHTTP1.Port:=8019; // Body.SaveToStream(Stream); // Response:= IdHTTP1.Post('http://thomas-bayer.com/axis2/services/BLZService',Body,Stream); // IdHHTP1.Request. HTTP_Stream.Position:=0; //IdHTTP1.Get(URL_,Stream); // showMessage(IdHTTP1.Request.); // Stream.LoadFromStream(); memo1.Lines.Add(IdHTTP1.Response.Server); // Memo2.Lines.Add(Format('Response Code: %d', [IdHTTP1.ResponseCode])); //Memo2.Lines.Add(Format('Response Text: %s', [IdHTTP1.ResponseText])); Body.LoadFromStream(HTTP_Stream); Memo2.Lines.AddStrings(Body); finally HTTP_Stream.Free; end; end; end. |
AW: Webservice
Zitat:
Delphi-Quellcode:
IdHTTP1.Request.ContentType:='application/octet-stream';
|
AW: Webservice
Zitat:
|
AW: Webservice
application/octet-stream bedeuted das Du mit binär Daten arbeiten musst.
Ich vermute Dein Code basiert auf Text Inhalt, da sollest Du alles auf Binär umstellen damit ein Fernzugriff klappt. Also nicht nur das Transport Protocol "application/octet-stream" setzen, alles was damit zu tun hat muss entsprechend angepasst werden. Vor ein paar Tagen hab ich verschiedene Download Varianten mit GET() durchgekaut, schau da mal in den Thread rein, vielleicht kannst Du meinen Code ohne große Probleme nach Indy portieren, die Befehle sind fast identisch. (THttpClient) |
AW: Webservice
Zitat:
Vielleicht hilft Wireshark oder ein HTTP Proxy wie Fiddler2 bei der Aufklärung wie die gesendeten Requests aussehen. p.s. Host, Port, ContentLength anzugeben ist nicht sinnvoll, da diese Werte von TIdHTTP ermittelt werden. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 14:13 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz