Web services Change

  • Thread starter Thread starter Sara
  • Start date Start date
S

Sara

How could i detect there is a change to web service that has already
accessed
 
Well you could verry easy implement a key mechanism ( a guid for
instance ) wich the client app can compare to a previous version it received
from the webservice

regards

Michel Posseth [MCP]
 
Well i asume you have control over the client and the server

so in this case you could provide a versioning mechanism , for instance a
public property that returns a version code ,,( i would use a guid for this
purpose )

a question from my side is why would you need to know if the webservice is a
newer version ??? because if you have problems reciving data from newer
versions someone did not do his job right :-)
a webservice should always hold backwards compatibility through his method
signatures.

in normall language this means that new methods can always be added ( new
names with different parameters ) however old methods may be altered in the
code behind, but the challenge and response signature must always be the
same this ensures that old clients can always connect to a new service
without problems

regards

Michel Posseth [MCP]
 
In my project webservice is done by other department, some times they
are adding overloaded methods and not informing us. though its a
communication gap, i want to know as soon as they done with the web
services changes.

i have compiled my proxy and having it with me
how can create a version number for that do you mean shared assembly
 
well when i rethink about this ,,,, it is pretty simple to detect such
changes even if you do not have anny control of the server side

retrieve the wsdl store it and compare it ,,, if the wsdl is changed the
webservice is changed simple ....


working example

Imports System.Net

Public Class Form1

Private url As String =
"http://www.nohausystems.nl/kenteken/kenteken.asmx?wsdl"

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

'create the reference file when a new version is released by the ws
department

GetReferenceFile(url)

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click

' call this method to check if nothing changed to the webservice

MsgBox(WsRefChanged(url).ToString)

'if it returns true you know a change has taken place since your last call
to GetReferenceFile(url)

End Sub

Private Sub GetReferenceFile(ByVal url As String)

'call this method to create a reference file

Dim Myweb As New WebClient

Dim response As String = Myweb.DownloadString(url)

Dim myWriteStream As New System.IO.StreamWriter("ws.ref")

myWriteStream.Write(response)

myWriteStream.Close()

End Sub

Private Function WsRefChanged(ByVal url As String) As Boolean

Dim myStream As New System.IO.StreamReader("ws.ref"), Myweb As New WebClient

Dim WsRef As String = myStream.ReadToEnd

myStream.Close()

Dim response As String = Myweb.DownloadString(url)

Return Not String.Equals(WsRef, response)

End Function


End Class

regards and a happy new year to all who read this thread

Michel Posseth [MCP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top