Topic
  • 4 replies
  • Latest Post - ‏2013-03-21T16:26:54Z by SystemAdmin
zimo85
zimo85
3 Posts

Pinned topic Consuming Maximo WebServices from .NET and SPNEGO

‏2012-07-10T15:36:05Z |
Hi,
I am a .NET developer and I am working on an integration project with Maximo.
I have to call some webservices exposed by Maximo. Everything works fine with basic HTTP authentication.
Now the Single Sign-On SPNEGO has been activated and I not able to authenticate to those services.

This is my service invocation

POST <url> HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction: "urn:processDocument"
Host: <host>
Content-Length: 428
Expect: 100-continue
Connection: Keep-Alive

and this is the first response

HTTP/1.1 401 Unauthorized
Date: Tue, 10 Jul 2012 13:00:15 GMT
Server: Apache/2.2.3 (Red Hat)
WWW-Authenticate: Negotiate
Content-Length: 154
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/html;charset=ISO-8859-1
Content-Language: it-IT
Proxy-Support: Session-Based-Authentication

Then I send the authentication message

POST <url> HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction: "urn:processDocument"
Authorization: Negotiate TlRM...<token>
Host: <host>
Content-Length: 0

But then I receive this response

HTTP/1.1 401 Unauthorized
Date: Tue, 10 Jul 2012 13:00:15 GMT
Server: Apache/2.2.3 (Red Hat)
Transfer-Encoding: chunked
Content-Type: text/html;charset=ISO-8859-1
Content-Language: it-IT

The .NET exception is:
The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was ' '.

It seems that .NET cannot understand the authentication method.

Is there anyone that can help me?

P.S.: sorry for my enghlish...
Updated on 2013-03-21T16:26:54Z at 2013-03-21T16:26:54Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    5842 Posts

    Re: Consuming Maximo WebServices from .NET and SPNEGO

    ‏2012-07-11T10:20:15Z  
    Hello;

    Here is an example with VB.Net..

    Hope it works:)

    Dim maximoSvc As New Maximo.MXSR()
    Dim maximoSRArr(0) As Maximo.MXSR_SRType
    Dim maximoSR As New Maximo.MXSR_SRType()
    Dim changeDate As New Maximo.MXDateTimeType
    Dim DESCRIPTION_LONGDESCRIPTION As New Maximo.MXStringType
    Dim REPORTEDBY As New Maximo.MXStringType
    Dim IMPACT As New Maximo.MXLongType
    Dim reply(0) As Maximo.SRKeyType
    Dim cred As New System.Net.NetworkCredential

    Dim actLabCost As New Maximo.MXDoubleType

    cred.UserName = "maxadmin"
    cred.Password = "maxadmin"
    maximoSvc.Credentials = cred
    DESCRIPTION_LONGDESCRIPTION.Value = "longdesc"
    REPORTEDBY.Value = "USER"
    IMPACT.Value = 4
    maximoSR.DESCRIPTION_LONGDESCRIPTION = DESCRIPTION_LONGDESCRIPTION
    maximoSR.REPORTEDBY = REPORTEDBY
    maximoSR.AFFECTEDPERSON = REPORTEDBY
    maximoSR.IMPACT = IMPACT
    changeDate.Value = System.DateTime.Now
    maximoSR.CHANGEDATE = changeDate
    maximoSR.URGENCY = IMPACT
    actLabCost.Value = 0
    maximoSR.ACTLABCOST = actLabCost
    maximoSRArr(0) = maximoSR
    reply = maximoSvc.CreateMXSR(maximoSRArr, System.DateTime.Now, True, "", "EN", "11111", "7.0")
    Dim MaximoTicketid As String
    MaximoTicketid = reply(0).TICKETID.Value
  • zimo85
    zimo85
    3 Posts

    Re: Consuming Maximo WebServices from .NET and SPNEGO

    ‏2012-07-11T12:53:07Z  
    Hello;

    Here is an example with VB.Net..

    Hope it works:)

    Dim maximoSvc As New Maximo.MXSR()
    Dim maximoSRArr(0) As Maximo.MXSR_SRType
    Dim maximoSR As New Maximo.MXSR_SRType()
    Dim changeDate As New Maximo.MXDateTimeType
    Dim DESCRIPTION_LONGDESCRIPTION As New Maximo.MXStringType
    Dim REPORTEDBY As New Maximo.MXStringType
    Dim IMPACT As New Maximo.MXLongType
    Dim reply(0) As Maximo.SRKeyType
    Dim cred As New System.Net.NetworkCredential

    Dim actLabCost As New Maximo.MXDoubleType

    cred.UserName = "maxadmin"
    cred.Password = "maxadmin"
    maximoSvc.Credentials = cred
    DESCRIPTION_LONGDESCRIPTION.Value = "longdesc"
    REPORTEDBY.Value = "USER"
    IMPACT.Value = 4
    maximoSR.DESCRIPTION_LONGDESCRIPTION = DESCRIPTION_LONGDESCRIPTION
    maximoSR.REPORTEDBY = REPORTEDBY
    maximoSR.AFFECTEDPERSON = REPORTEDBY
    maximoSR.IMPACT = IMPACT
    changeDate.Value = System.DateTime.Now
    maximoSR.CHANGEDATE = changeDate
    maximoSR.URGENCY = IMPACT
    actLabCost.Value = 0
    maximoSR.ACTLABCOST = actLabCost
    maximoSRArr(0) = maximoSR
    reply = maximoSvc.CreateMXSR(maximoSRArr, System.DateTime.Now, True, "", "EN", "11111", "7.0")
    Dim MaximoTicketid As String
    MaximoTicketid = reply(0).TICKETID.Value
    Hi,

    it's seems that the code you have posted is a regular web service request.
    With the single sign-on I receive an HTTP 401 unauthorized if I try with a similiar code.
    Actually, I'm trying it using a WCF Client with this security configuration:
    <security mode="TransportCredentialOnly">
    <transport clientCredentialType="Windows"/>
    </security>
  • zimo85
    zimo85
    3 Posts

    Re: Consuming Maximo WebServices from .NET and SPNEGO

    ‏2012-07-11T12:54:40Z  
    • zimo85
    • ‏2012-07-11T12:53:07Z
    Hi,

    it's seems that the code you have posted is a regular web service request.
    With the single sign-on I receive an HTTP 401 unauthorized if I try with a similiar code.
    Actually, I'm trying it using a WCF Client with this security configuration:
    <security mode="TransportCredentialOnly">
    <transport clientCredentialType="Windows"/>
    </security>
    and this code in the client initialization:
    getInfoService.ClientCredentials.Windows.ClientCredential = new NetworkCredential("user", "password", "domain");
    getInfoService.ClientCredentials.Windows.AllowNtlm = false;
    getInfoService.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;
  • SystemAdmin
    SystemAdmin
    5842 Posts

    Re: Consuming Maximo WebServices from .NET and SPNEGO

    ‏2013-03-21T16:26:54Z  
    were you able to solve this ?