Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

consuming .net web services in delphi

Status
Not open for further replies.

phaniva

Programmer
Jun 19, 2007
1
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top