THttprio onBeforeExecute changing the soapRequest

前端 未结 2 566
南笙
南笙 2021-01-06 07:51

I\'ve imported some wsdl for a project. i want to change the SoapRequest on HttpRio onBeforeExecute event, but as i changed the request, im getting some errors how can i cha

2条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-06 08:29

    procedure TForm1.RiomBeforeExecute(const MethodName: string; SOAPRequest: TStream);
    var
      sTmp                                  : TStringList;
    
    begin
    
      sTmp:=TStringList.Create;
      SOAPRequest.Position := 0;
      sTmp.LoadFromStream(SOAPRequest);
      sTmp.Text := StringReplace(sTmp.Text,'blablaa','bla',[RfReplaceAll]);
       **SOAPRequest.Postion:=0**;// i forget this here, as i write the code that worked
      sTmp.SaveToStream(SOAPRequest);
      // blaa blaa...
    end;
    

提交回复
热议问题