Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Webservice error
Message
General information
Forum:
Visual FoxPro
Category:
Web Services
Title:
Webservice error
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01298256
Message ID:
01298256
Views:
159
I am having difficulty connection to a commercial webservice with foxpro. Here is the error I am getting:
Error: 1429 - OLE IDispatch exception code 0 from Client: Client:Type conversion failure for element MultipleANR HRESULT=0x80020005: Type mismatch. - Client:Unspecified client error. HRESULT=0x80020005: Type mismatch.Client:Type conversion failure for element MultipleANR HRESULT=0x80020005: Type mismatch. - Client:Unspecified client error. HRESULT=0x80020005: Type mismatch.

I can see that loPhoneNotify.falutcode = "Client:Incorrect number of parameters supplied for SOAP request"

Here is the wsdl: http://ws.cdyne.com/NotifyWS/PhoneNotify.asmx?wsdl

Here is their sample: http://ws.cdyne.com/NotifyWS/PhoneNotify.asmx?op=NotifyMultiplePhoneAdvanced

And here is my code. Thanks for the help. Pat
CRLF = CHR(13)+CHR(10)
cXML = SPACE(0)
cXML = cXML + "<MultipleANR>" + CRLF
  cXML = cXML + "<AdvancedNotifyRequest>" + CRLF
    cXML = cXML + "<PhoneNumberToDial>5551112222</PhoneNumberToDial>" + CRLF
    cXML = cXML + "<TransferNumber></TransferNumber>" + CRLF
    cXML = cXML + "<VoiceID>0</VoiceID>" + CRLF
    cXML = cXML + "<CallerIDNumber>5552223333</CallerIDNumber>" + CRLF
    cXML = cXML + "<CallerIDName>Company Name</CallerIDName>" + CRLF
    cXML = cXML + "<TextToSay>Hello this is a test.</TextToSay>" + CRLF
    cXML = cXML + "<LicenseKey>MyKey</LicenseKey>" + CRLF
    cXML = cXML + "<TryCount>1</TryCount>" + CRLF
    cXML = cXML + "<NextTryInSeconds>60</NextTryInSeconds>" + CRLF
    cXML = cXML + "<UTCScheduledDateTime>2008-02-28T18:40:00Z</UTCScheduledDateTime>" + CRLF
    cXML = cXML + "<TTSrate>10</TTSrate>" + CRLF
    cXML = cXML + "<TTSvolume>100</TTSvolume>" + CRLF
    cXML = cXML + "<MaxCallLength>60</MaxCallLength>" + CRLF
    cXML = cXML + "<StatusChangePostUrl></StatusChangePostUrl>" + CRLF
  cXML = cXML + "</AdvancedNotifyRequest>" + CRLF
  cXML = cXML + "<AdvancedNotifyRequest>" + CRLF
    cXML = cXML + "<PhoneNumberToDial>5551113333</PhoneNumberToDial>" + CRLF
    cXML = cXML + "<TransferNumber></TransferNumber>" + CRLF
    cXML = cXML + "<VoiceID>0</VoiceID>" + CRLF
    cXML = cXML + "<CallerIDNumber>5552223333</CallerIDNumber>" + CRLF
    cXML = cXML + "<CallerIDName>Company Name</CallerIDName>" + CRLF
    cXML = cXML + "<TextToSay>Hello this is a test.</TextToSay>" + CRLF
    cXML = cXML + "<LicenseKey>MyKey</LicenseKey>" + CRLF
    cXML = cXML + "<TryCount>1</TryCount>" + CRLF
    cXML = cXML + "<NextTryInSeconds>60</NextTryInSeconds>" + CRLF
    cXML = cXML + "<UTCScheduledDateTime>2008-02-28T18:40:00Z</UTCScheduledDateTime>" + CRLF
    cXML = cXML + "<TTSrate>10</TTSrate>" + CRLF
    cXML = cXML + "<TTSvolume>100</TTSvolume>" + CRLF
    cXML = cXML + "<MaxCallLength>60</MaxCallLength>" + CRLF
    cXML = cXML + "<StatusChangePostUrl></StatusChangePostUrl>" + CRLF
  cXML = cXML + "</AdvancedNotifyRequest>" + CRLF
cXML = cXML + "</MultipleANR>"
LOCAL loPhoneNotify AS "XML Web Service"
* LOCAL loPhoneNotify AS "MSSOAP.SoapClient30"
* Do not remove or alter following line. It is used to support IntelliSense for your XML Web service.
*__VFPWSDef__: loPhoneNotify = http://ws.cdyne.com/NotifyWS/PhoneNotify.asmx?wsdl , PhoneNotify , PhoneNotifySoap
LOCAL loException, lcErrorMsg, loWSHandler
TRY
	loWSHandler = NEWOBJECT("WSHandler",IIF(VERSION(2)=0,"",HOME()+"FFC\")+"_ws3client.vcx")
	loPhoneNotify = loWSHandler.SetupClient("http://ws.cdyne.com/NotifyWS/PhoneNotify.asmx?wsdl", "PhoneNotify", "PhoneNotifySoap")
	* Call your XML Web service here.  ex: leResult = loPhoneNotify.SomeMethod()
	x = loPhoneNotify.NotifyMultiplePhoneAdvanced(cXML)
	?x.context.xml

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

Click here to load this message in the networking platform