I'm stuck with accessing to OTRS web services (via SOAP) from .NET application. I have OTRS installed over Apache/2.2.22 (Linux/SUSE) with Active Directory integration to authenticate users. I used WSDL файл from OTRS github to create needed classes to access OTRS web services. Then I create app.config (in attache app.txt) to connect to OTRS. A added small peace of test code:
Code: Select all
public class Test : OTRS_WebService.GenericTicketConnector_InterfaceClient
{
}
class Program
{
static void Main(string[] args)
{
Test tst = new Test();
OTRS_WebService.OTRS_SessionCreate sc = new OTRS_WebService.OTRS_SessionCreate();
sc.ItemElementName = OTRS_WebService.ItemChoiceType8.UserLogin;
sc.Item = "soap"; //Login to access SOAP
sc.Password = "1234567"; //Password to access SOAP
var rsp = tst.SessionCreate(sc);
}
}
Message: "The HTTP request is unauthorized with client authentication scheme 'Ntlm'. The authentication header received from the server was 'Negotiate'."
Inner exception: "The remote server returned an error: (401) Unauthorized."
If transport security is "Windows", then error message: "The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'Negotiate'."
In Fiddler i see, that application send:
POST http://server/otrs/nph-genericinterface ... tConnector HTTP/1.1
Content-Type: text/xml; charset=utf-8
VsDebuggerCausalityData: uIDPo2tfoPanyV1Jv/dArk4GAlYAAAAAor3hfiwdfUiXbw4v++F/XuOLDfsx8X1JjAnSfiTfksMACQAA
SOAPAction: "http://www.otrs.org/TicketConnector/SessionCreate"
Host: server
Content-Length: 369
Expect: 100-continue
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><Sess ... <UserLogin xmlns="http://www.otrs.org/TicketConnector/">s ... ><Password xmlns="http://www.otrs.org/TicketConnector/">1 ... s:Envelope>
Response is:
HTTP/1.1 302 Found
Date: Wed, 07 Jan 2015 18:26:59 GMT
Server: Apache/2.2.22 (Linux/SUSE)
Location: http://server/otrs/nph-genericinterface ... tConnector
Content-Length: 277
Connection: close
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="http://server/otrs/nph-genericinterface ... re</a>.</p>
</body></html>
Then next request in Fiddler is:
GET http://server/otrs/nph-genericinterface ... tConnector HTTP/1.1
Content-Type: text/xml; charset=utf-8
VsDebuggerCausalityData: uIDPo2tfoPanyV1Jv/dArk4GAlYAAAAAor3hfiwdfUiXbw4v++F/XuOLDfsx8X1JjAnSfiTfksMACQAA
SOAPAction: "http://www.otrs.org/TicketConnector/SessionCreate"
Accept-Encoding: gzip, deflate
Host: server
and response:
HTTP/1.1 401 Authorization Required
Date: Wed, 07 Jan 2015 18:26:59 GMT
Server: Apache/2.2.22 (Linux/SUSE)
WWW-Authenticate: Negotiate
Vary: accept-language,accept-charset
Accept-Ranges: bytes
Content-Length: 589
Content-Type: text/html; charset=iso-8859-1
Content-Language: en
Proxy-Support: Session-Based-Authentication
<!--#set var="TITLE" value="Authentication required!"
--><!--#include virtual="include/top.html" -->
This server could not verify that you are authorized to access
the URL "<!--#echo encoding="url" var="REDIRECT_URL" -->".
You either supplied the wrong credentials (e.g., bad password), or your
browser doesn't understand how to supply the credentials required.
<!--#include virtual="include/spacer.html" -->
In case you are allowed to request the document, please
check your user-id and password and try again.
<!--#include virtual="include/bottom.html" -->
and that's all.
