Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Accessing a vfp web service
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Accessing a vfp web service
Divers
Thread ID:
00808073
Message ID:
00808073
Vues:
64
I've started down the vb.net road and seem to have encountered a speed bump. I've got a pure vfp web service running at: http://www.shelbycountyjail.com/scsoweb/showdls.wsdl

It has two methods: getdlsbyno and getdlsbyname

I can call them from a remote vfp program and it works, but I'm at a loss on how to make it work with vb.net

Here is the code I've tried but failed at in vb.net:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim lcDATA As DataSet = New DataSet
Dim service As com.shelbycountyjail.www.showdls
Dim lcstr As String
lcstr = service.getdlsbyname(Me.txtname.Text)
lcDATA.ReadXml(lcstr)
Me.DataGrid1.DataSource = lcDATA
End Sub

I get an error on an object reference. Dang, I hate being at the bottom of the ladder again!

If you try the getdlsbyname method, pass WILLIAMS,L% (UPPER CASE). In VFP, I get back a cursor using the following code
LOCAL loshowdls AS "XML Web Service"
* LOCAL loshowdls AS "MSSOAP.SoapClient30"
* Do not remove or alter following line. It is used to support IntelliSense for your XML Web service.
*__VFPWSDef__: loshowdls = http://www.shelbycountyjail.com/scsoweb/showdls.wsdl , showdls , showdlsSoapPort
LOCAL loException, lcErrorMsg, loWSHandler
TRY
	loWSHandler = NEWOBJECT("WSHandler",IIF(VERSION(2)=0,"",HOME()+"FFC\")+"_ws3client.vcx")
	loshowdls = loWSHandler.SetupClient("http://www.shelbycountyjail.com/scsoweb/showdls.wsdl", "showdls", "showdlsSoapPort")
	* Call your XML Web service here.  ex: leResult = loshowdls.SomeMethod()
LOCAL lcXML, lcAlias AS String
LOCAL loXMLAdapter AS XMLAdapter

lcXML = loShowdls.getdlsbyno('71795764')

loXMLAdapter = CREATEOBJECT("XMLAdapter")
loXMLAdapter.LoadXML(lcXML)

lcAlias = loXMLAdapter.Tables.Item(1).Alias
loXMLAdapter.Tables.Item(1).ToCursor()

SELECT(lcAlias)
BROWSE
CLOSE DATABASES ALL

CATCH TO loException
	lcErrorMsg="Error: "+TRANSFORM(loException.Errorno)+" - "+loException.Message
	DO CASE
	CASE VARTYPE(loshowdls)#"O"
		* Handle SOAP error connecting to web service
	CASE !EMPTY(loshowdls.FaultCode)
		* Handle SOAP error calling method
		lcErrorMsg=lcErrorMsg+CHR(13)+loshowdls.Detail
	OTHERWISE
		* Handle other error
	ENDCASE
	* Use for debugging purposes
	MESSAGEBOX(lcErrorMsg)
FINALLY
ENDTRY
John Harvey
Shelbynet.com

"I'm addicted to placebos. I could quit, but it wouldn't matter." Stephen Wright
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform