srinivas74
New member
- Joined
- Jul 18, 2012
- Messages
- 2
- Programming Experience
- 10+
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.
<code>
<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=""XML Schema"" "
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
</code>
Any help appreciated, The xml response which i get is "Invalid Token",
I m literally stuck, can someone let me know what is wrong in the above code.
Thanks
Srini
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.
<code>
<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=""XML Schema"" "
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
</code>
Any help appreciated, The xml response which i get is "Invalid Token",
I m literally stuck, can someone let me know what is wrong in the above code.
Thanks
Srini