I have to consume asp.net web services in Delphi client.
For each web method the service has defined a soap header.
I was able to pass header information to the service using
THTTPRIO.SOAPHeaders.Send method. The service also sends a SOAP Header back. I am unable to retrieve the header information from the response.
Below is my code and soap messages from server.
h := MyMessageHeader.Create;
h.UserName := 'test';
h.Password := 'test';
R := THTTPRIO.Create(nil);
R.URL := ' s := (R as MyWebService);
Headers := s as ISOAPHeaders;
Headers.Send(h); {set the header here to be sent to server }
resp := s.MyWebMethod(req);
(s as ISOAPHeaders).Get(SedcMessageHeader, TSOAPHeader(h));
{After this statement the header object does not have the information sent by server}
Here is xml request sent to server
<SOAP-ENV:Envelope xmlns:SOAP-ENV=" xmlns:xsd=" xmlns:xsi=" xmlns=" ObjectsRemaining="0" UserName="test" Password="test"/></SOAP-ENV:Header><SOAP-ENV:Body><MyWebMethodRequest xmlns="
Here is the response from server
<soap:Envelope xmlns:soap=" xmlns:xsi=" xmlns:xsd=" ObjectsRemaining="656" UserName="test" Password="test" SessionId="C:\WINNT\TEMP\ATP_061912201387.txt~286500" xmlns=" /></soap:Header><soap:Body><MyWebMethodResponse xmlns="...
Why cannot I retrieve the header information sent by server? Is there anything special I have to do.
thanks for the help
For each web method the service has defined a soap header.
I was able to pass header information to the service using
THTTPRIO.SOAPHeaders.Send method. The service also sends a SOAP Header back. I am unable to retrieve the header information from the response.
Below is my code and soap messages from server.
h := MyMessageHeader.Create;
h.UserName := 'test';
h.Password := 'test';
R := THTTPRIO.Create(nil);
R.URL := ' s := (R as MyWebService);
Headers := s as ISOAPHeaders;
Headers.Send(h); {set the header here to be sent to server }
resp := s.MyWebMethod(req);
(s as ISOAPHeaders).Get(SedcMessageHeader, TSOAPHeader(h));
{After this statement the header object does not have the information sent by server}
Here is xml request sent to server
<SOAP-ENV:Envelope xmlns:SOAP-ENV=" xmlns:xsd=" xmlns:xsi=" xmlns=" ObjectsRemaining="0" UserName="test" Password="test"/></SOAP-ENV:Header><SOAP-ENV:Body><MyWebMethodRequest xmlns="
Here is the response from server
<soap:Envelope xmlns:soap=" xmlns:xsi=" xmlns:xsd=" ObjectsRemaining="656" UserName="test" Password="test" SessionId="C:\WINNT\TEMP\ATP_061912201387.txt~286500" xmlns=" /></soap:Header><soap:Body><MyWebMethodResponse xmlns="...
Why cannot I retrieve the header information sent by server? Is there anything special I have to do.
thanks for the help