I am stuck at this: I need to write Client for Web Service. As Input I have 1) WSDL file WebServ.wsdl. This service implement a lot of Methods. I need just one - GetInvoice 2) Also I know that here there is a Two-Factor Authentication and I need to pass into Web Service Token as Header for SOAP: Header Name: X-SPP-API-Token
and I know that it should be - HTTP post.
The question is - how can I combine WSDL with HTTP POST Header ? I even don't know how to start it...
I have something like that:
//----Request Set-Up
req.Method = "POST";
req.ContentType = "text/xml";
req.Host = "api.spp.org";
req.ContentLength = postBytes.Length;
req.ProtocolVersion = HttpVersion.Version11;
req.ClientCertificates.Add(certificates[0]);
req.Headers["X-SPP-API-Token"] = token;
req.KeepAlive = true;
//-----POST Request
Stream postStream = req.GetRequestStream();
postStream.Write(postBytes, 0, postBytes.Length);
postStream.Flush();
postStream.Close();