AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Webservice

Ein Thema von InschenierSB · begonnen am 25. Apr 2018 · letzter Beitrag vom 17. Mai 2018
 
InschenierSB

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

AW: Webservice

  Alt 14. Mai 2018, 06:53
Guten Morgen,
Noch eine letzte Frage dann kann ich glaube ich den Thread schließen. Mein Webservice läuft jetzt soweit, allerdings werden Zeichen wie ü, usw. im Ausgabefenster als Hieroglyphen dargestellt. Hat jemand eine Idee womit das zusammenhängt?!
Delphi-Quellcode:
unit Main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, IdBaseComponent, IdComponent, IdTCPConnection,
  IdTCPClient, IdHTTP;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Memo2: TMemo;
    IdHTTP1: TIdHTTP;
    GroupBox1: TGroupBox;
    ToolCode: TEdit;
    CheckSlotPos: TEdit;
    EquipmentValidation: TEdit;
    LotName: TEdit;
    ReturnBrokenWafers: TEdit;
    UseSlotPos: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    procedure Button1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

var
 Stream:TMemoryStream;
 //Url: String;
 //URL_:String;
    my_Request : TStringList;
    my_Response: TStringList;
  //SB Body: TStringStream;
 HTTP_Stream: TStringStream;


 //SB IdLogDebug: TIdLogDebug;


 procedure TForm1.Button1Click(Sender: TObject);
begin

  try
  //SB IdLogDebug := TIdLogDebug.Create;
  //SB IdLogDebug.Active := true;


  //SB IdHTTP1.Intercept:=IdLogDebug;
  IdHTTP1:=TIdHTTP.Create(nil);
  HTTP_Stream:= TStringStream.Create('');
  my_Request :=TStringList.Create;
  my_Response:=TStringList.Create;
  my_Request.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">');
  my_Request.Add('<soapenv:Header/>');
  my_Request.Add('<soapenv:Body>');
  my_Request.Add('<cim:GetLotInfoByLotName>');
  my_Request.Add('<!--Optional:-->');
  my_Request.Add(' <cim:requestMessage>');
  my_Request.Add(' <dat:ToolCode>' + ToolCode.Text + '</dat:ToolCode>');
  my_Request.Add(' <!--Optional:-->');
  my_Request.Add(' <dat:CheckSlotPos>' + CheckSlotPos.Text + '</dat:CheckSlotPos>');
  my_Request.Add(' <!--Optional:-->');
  my_Request.Add(' <dat:EquipmentValidation>' + EquipmentValidation.Text + '</dat:EquipmentValidation>');
  my_Request.Add(' <!--Optional:-->');
  my_Request.Add(' <dat:LotName>' + LotName.Text + '</dat:LotName>');
  my_Request.Add(' <!--Optional:-->');
  my_Request.Add(' <dat:ReturnBrokenWafers>' + ReturnBrokenWafers.Text + '</dat:ReturnBrokenWafers>');
  my_Request.Add(' <!--Optional:-->');
  my_Request.Add(' <dat:UseSlotPosition>' + UseSlotPos.Text + '</dat:UseSlotPosition>');
  my_Request.Add('</cim:requestMessage>');
  my_Request.Add('</cim:GetLotInfoByLotName>');
  my_Request.Add('</soapenv:Body>');
  my_Request.Add('</soapenv:Envelope>');

  IdHTTP1.Request.ExtraHeaders.SetText('SoapAction: "http://cim.osram.ws.gefasoft.com/ILot/GetLotInfoByLotName"');
  IdHTTP1.Request.Accept:='';
  IdHTTP1.Request.AcceptEncoding:='gzip,deflate';
  IdHTTP1.Request.Connection:='Keep-Alive';
  // SB IdHTTP1.Request.ContentType:='text/xml;charset=UTF-8';
  IdHTTP1.Request.ContentType:='application/soap+xml;charset=UTF-8';
  IdHTTP1.Request.UserAgent:= 'Apache-HttpClient/4.1.1(java 1.5)';
  IdHTTP1.Request.ContentLength:= 918;
  //IdHTTP1.Post('http://192.168.100.25:80/Lot.svc',my_Request,HTTP_Stream);
  //IdHTTP1.Request.ContentEncoding := 'utf-8';
  IdHTTP1.Post('http://tst-rbg14:8019/Lot.svc',my_Request,HTTP_Stream);



  HTTP_Stream.Position:=0;
// my_Request.LoadFromStream(HTTP_Stream);
  my_Response.LoadFromStream(HTTP_Stream);
  Memo1.Lines.AddStrings(my_Request);
  Memo2.Lines.AddStrings(my_Response);


    finally

   HTTP_Stream.Free;
   end;


end;

{$R *.dfm}

end.
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:19 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