Quantcast
Channel: WCF, ASMX and other Web Services
Viewing all articles
Browse latest Browse all 555

Invalid Token

$
0
0

Hi

I have a third party secure webservice which i call in my internal webservice.

My internal webservice is like this when i call this i m getting invalid token, any idea what is causing it, there is no session timeout and the third party service works fine on their end.

<WebMethod()>
    Public Function sstest1() As String

        Dim Str As String

        Dim token As String

        Dim bauth As New AuthenticationAPIWebService
        Dim bauthresult As New AuthenticateResult
        Dim myProxy As New System.Net.WebProxy("http://91.1.15.3:8080", False)

        myProxy.Credentials = New System.Net.NetworkCredential("xxp", "Vf72CwMSvB72rk", "xx.com")
        bauth.Proxy = myProxy
        bauthresult = bauth.Authenticate("xx", "xx")

        bauth.PreAuthenticate = True

       token = bauthresult.Token.TokenString

str = "<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" "

        Str = Str + "xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">"

        Str = Str + "<soap:Body>"      

        Str = Str + "<ServiceRequest_Create xmlns=""http://systems.com/ServiceRequest_Create""

        Str = Str + "<token>" + token + "</token>"

        Str = Str + "<objCreateServiceRequest>"

        Str = Str + "<UPRN>000021089821</UPRN>"

        Str = Str + "</objCreateServiceRequest></ServiceRequest_Create></soap:Body></soap:Envelope>"

Dim req As System.Net.HttpWebRequest = System.Net.WebRequest.Create("https://systems.com/wcapi.asmx")       

req.ContentType = "text/xml;charset=utf-8"

        req.Accept = "text/xml"

        req.Method = "POST"

        req.Proxy = myProxy

        Using stm As Stream = req.GetRequestStream()
            Using stmw As New StreamWriter(stm)
                stmw.Write(Str)
            End Using
        End Using

Dim response As System.Net.HttpWebResponse

response = req.GetResponse()

Dim reader As New StreamReader(response.GetResponseStream())

Return reader.ReadToEnd()

End Function


Any help appreciated, The xml response which i get is "Invalid Token",

Thanks

Srini


Viewing all articles
Browse latest Browse all 555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>