Differences

This shows you the differences between two versions of the page.

Link to this comparison view

public:howto:synapsesoap [2009/04/03 09:20]
tibard
public:howto:synapsesoap [2009/04/03 09:23] (current)
tibard
Line 128: Line 128:
   procedure SetupSyna(SynaHttp: THTTPSend);   procedure SetupSyna(SynaHttp: THTTPSend);
   var   var
-    ActionHeader: string; 
     Protocol, Host, Path, Port, Para, pUser, pPass: string;     Protocol, Host, Path, Port, Para, pUser, pPass: string;
   begin   begin
 +
     if FBindingType = btMIME then     if FBindingType = btMIME then
     begin     begin
Line 144: Line 144:
     SynaHttp.UserName := FUserName;     SynaHttp.UserName := FUserName;
     SynaHttp.Password := FPassword;     SynaHttp.Password := FPassword;
-    +
     if FProxy <> '' then     if FProxy <> '' then
     begin     begin
Line 153: Line 153:
       SynaHttp.ProxyPass := pPass;       SynaHttp.ProxyPass := pPass;
     end;     end;
-    SynaHttp.Protocol := '1.0' ; + 
-    SynaHttp.UserAgent := Self.FAgent;+    SynaHttp.Protocol := '1.0'; 
 +    SynaHttp.UserAgent := 'CustomSoap';
   end;   end;
- 
  
   procedure PostData(const Request: TStream; Response: TStream);   procedure PostData(const Request: TStream; Response: TStream);
Line 165: Line 165:
     try     try
       SetupSyna(SynaHttp);       SetupSyna(SynaHttp);
 +      
       Request.Position := 0;       Request.Position := 0;
       SynaHTTP.Document.LoadFromStream(Request);       SynaHTTP.Document.LoadFromStream(Request);
       SynaHTTP.Document.Position := 0;       SynaHTTP.Document.Position := 0;
-      try 
-        if SynaHTTP.HTTPMethod('POST', FURL) then 
-        begin 
-          Response.CopyFrom(SynaHTTP.Document, 0); 
  
-          FContentType := SynaHTTP.Headers.Values[SContentType]; +      if SynaHTTP.HTTPMethod('POST', FURL) then 
-          FMimeBoundary := GetMimeBoundaryFromType(FContentType); +      begin 
-           +        Response.CopyFrom(SynaHTTP.Document, 0); 
-          CheckContentType; + 
-        end +        FContentType := SynaHTTP.Headers.Values[SContentType]; 
-        else +        FMimeBoundary := GetMimeBoundaryFromType(FContentType); 
-          raise ESOAPHTTPException.Create(SInvalidHTTPResponse);         + 
-      finally +        CheckContentType; 
-      end;+      end 
 +      else 
 +        raise ESOAPHTTPException.Create(SInvalidHTTPResponse); 
 +        
     finally     finally
       FreeAndNil(SynaHTTP);       FreeAndNil(SynaHTTP);
public/howto/synapsesoap.txt · Last modified: 2009/04/03 09:23 by tibard
Driven by DokuWiki Recent changes RSS feed