Authorization - WSDL File, Proxy class in C# - Visual Studio Desktop App
Hello,
I have received a SOAP application with the SOAP_UI from my customer.
I was able to create a proxy class for C# via a WSDL file. I integrate this into my project and get these errors.
C:\Users\Freitag\source\repos\TEST\SOAP\_WSDL>wsdl /par VUISTADASERVER_WSDL.wsdl
Visual Studio 2017, C# WPF Desktop App
What could be the cause?
How can I solve this?
Can I create a new WSDL file on my own and can I adapt the ContentType? If so, where?
private void btnGet_Order_Queue_Click(object sender, EventArgs e)
{
using (STADAService dMES = new STADAService()
{
Credentials = new NetworkCredential("pds", "pds"),
PreAuthenticate = true,
Url = "http://ADDXACDD4:8080/orawsv/PDS/",
})
{
try
{
First error is
Error when requesting with HTTP status 401: Unauthorized.
Second error is
The request content type found by the client is 'text/html; charset=iso-8859-1', expected was 'text/xml'.
Error in request with the following error message:
--
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>Server</faultcode>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
--.
Inside the wrapper, proxy class, I have this
dMES.RequestEncoding =
I can't set this. Is not available.
request.Accept = "text/xml";
request.ContentType = "text/xml";
request.Headers.Add("Content-Encoding", "utf-8");
How I can change the ContentType and so on.
Is the failure, a wrong WSDL file?
How can I solve it?
Thanks for your help.
Best regards Markus