Differences

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

Link to this comparison view

public:howto:synapsesoap [2009/03/30 13:38]
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 (soNoValueForEmptySOAPAction in FInvokeOptions) and (SoapAction '') then + 
-      ActionHeader := SHTTPSoapAction + ':' +    if FBindingType btMIME then 
-    else if SoapAction = '"";' then +    begin 
-      ActionHeader := SHTTPSoapAction + ': "";' +      SynaHttp.MimeType := Format(ContentHeaderMIME, [FMimeBoundary])
-    else +      SynaHttp.Headers.Add(MimeVersion); 
-      ActionHeader := SHTTPSoapAction + ': ' + '";' + FSoapAction + '";';+    end 
 +    else { Assume btSOAP } 
 +    begin 
 +      SynaHttp.MimeType := sTextXML; 
 +      SynaHttp.Headers.Add(GetSOAPActionHeader); 
 +    end;
  
     SynaHttp.UserName := FUserName;     SynaHttp.UserName := FUserName;
     SynaHttp.Password := FPassword;     SynaHttp.Password := FPassword;
-    +
     if FProxy <> '' then     if FProxy <> '' then
     begin     begin
Line 149: Line 153:
       SynaHttp.ProxyPass := pPass;       SynaHttp.ProxyPass := pPass;
     end;     end;
-    SynaHttp.Headers.Add(ActionHeader); + 
-    SynaHttp.MimeType := 'text/xml';   { do not localize } +    SynaHttp.Protocol := '1.0'; 
-    SynaHttp.Protocol := '1.0' ; +    SynaHttp.UserAgent := 'CustomSoap';
-    SynaHttp.UserAgent := Self.FAgent;+
   end;   end;
- 
  
   procedure PostData(const Request: TStream; Response: TStream);   procedure PostData(const Request: TStream; Response: TStream);
Line 163: 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 +      if SynaHTTP.HTTPMethod('POST', FURL) then 
-          Response.CopyFrom(SynaHTTP.Document, 0) +      begin 
-        else +        Response.CopyFrom(SynaHTTP.Document, 0)
-          raise ESOAPHTTPException.Create(SInvalidHTTPResponse);         + 
-      finally +        FContentType := SynaHTTP.Headers.Values[SContentType]; 
-      end;+        FMimeBoundary := GetMimeBoundaryFromType(FContentType); 
 + 
 +        CheckContentType; 
 +      end 
 +      else 
 +        raise ESOAPHTTPException.Create(SInvalidHTTPResponse); 
 +        
     finally     finally
       FreeAndNil(SynaHTTP);       FreeAndNil(SynaHTTP);
public/howto/synapsesoap.1238413125.txt.gz · Last modified: 2009/03/30 13:38 by tibard
Driven by DokuWiki Recent changes RSS feed