Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Accessing a vfp web service
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00808073
Message ID:
00808147
Views:
14
Hi John,

It appears like your service method is not returning a string. I woould start by testing just that portion to determine where the problem is.

>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
>
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Reply
Map
View

Click here to load this message in the networking platform