Thema: Delphi Webservice

Einzelnen Beitrag anzeigen

InschenierSB

Registriert seit: 25. Apr 2018
Ort: Regensburg
39 Beiträge
 
#66

AW: Webservice

  Alt 7. Mai 2018, 15:51
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.
Miniaturansicht angehängter Grafiken
fault_message.png  
  Mit Zitat antworten Zitat