Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MS's WebService example - i've done something funny to it.
Message
From
28/02/2003 06:06:43
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Web Services
Title:
MS's WebService example - i've done something funny to it.
Miscellaneous
Thread ID:
00759301
Message ID:
00759301
Views:
55
MS show an example of how to build a basic webservice on http://support.microsoft.com/?kbid=321512. I managed to get this working a few weeks ago using calling code of :

oMSSoapClient = CreateObject("MSSOAP.SoapClient30")
oMSSoapClient.ClientProperty("ServerHTTPRequest") = .T.
=oMSSoapClient.mssoapinit("HTTP://localhost/dd/MyWebService.WSDL", "MyWebService", "MyWebServiceSoapPort")

?oMSSoapClient.GetMachineName()
oMSSoapClient = .NULL.

Only problem was that it didnt always work - I would run the program (say) 5 times in a row and the first 4 would work and then it would stop and cease. I wondered if this was because I was using beta code so was looking forward to having release version in (as of yesterday it is). I've rebuilt the MTDLL and regenerated the WDSL but at the GetMachineName call I constantly get

"OLE IDispatch exception code 0 from Client: Client:Loading the request into SoapReader failed. HRESULT=0x80070057: The parameter is incorrect."

If I DO give it any parameters, it sensibly gives "incorrect number of parameters supplied".

Any advice would be welcomed!

JC

* For reference, this is what we pulled from the MS page and plugged straight in. We also have a lot more complicated versions that work like a dream in a non-webservice environment ;-)

DEFINE CLASS MyWebService AS SESSION OLEPUBLIC

PROCEDURE INIT
*!* If you do any work with SQL Pass-Through
*!* these settings are a good idea.
SQLSetProp(0,"DispLogin",3)
SQLSetProp(0,"DispWarnings",.F.)
ENDPROC

PROCEDURE GetMachineName AS STRING
LOCAL lcThisMachineName AS STRING
lcThisMachineName = LEFT(SYS(0),ATC("#",SYS(0))-1)
RETURN lcThisMachineName
ENDPROC

PROCEDURE Error(nError, cMethod, nLine)
COMRETURNERROR([method "] + cMethod + ["], MESSAGE())
ENDPROC

ENDDEFINE
Next
Reply
Map
View

Click here to load this message in the networking platform