I need to add this header to a webservices client written in delphi because the server reject the request:
<!--<soap:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
<To soap:mustUnderstand="1" xmlns="http://www.w3.org/2005/08/addressing">http://srvweh01:8081/ISPWebService/IspOrderWs.svc</To>
</soap:Header>-->
The WSDL importer have created the standard code:
function GetIspOrderWs(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): IspOrderWs;
const
defWSDL = 'C:\Sources\SoapClientXWEH\IspOrderWs.xml';
defURL = 'http://srvweh01:8081/ISPWebService/IspOrderWs.svc';
defSvc = 'IspOrderWs';
defPrt = 'WSHttpBinding_IspOrderWs';
var
RIO: THTTPRIO;
begin
Result := nil;
if (Addr = '') then
begin
if UseWSDL then
Addr := defWSDL
else
Addr := defURL;
end;
if HTTPRIO = nil then
RIO := THTTPRIO.Create(nil)
else
RIO := HTTPRIO;
try
Result := (RIO as IspOrderWs);
if UseWSDL then
begin
RIO.WSDLLocation := Addr;
RIO.Service := defSvc;
RIO.Port := defPrt;
end else
RIO.URL := Addr;
finally
if (Result = nil) and (HTTPRIO = nil) then
RIO.Free;
end;
end;
and this is my call to the server:
getIspOrderWs().addOrder(pippoPRT);
So my question is: how can I insert the missing header (and the proper way to do it) before I call so the SOAP message can be compiled well?
All suggest are welcome, Thanks!