Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Client: Incorrect Number of Parameters Supplied Error
Message
De
17/05/2006 10:53:27
 
 
À
17/05/2006 10:19:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Web Services
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01122410
Message ID:
01122741
Vues:
35
I stripped out reserved characters, tried sending three null values, three empty char strings, etc to no avail:
CLOSE ALL
CLEAR ALL
RELEASE ALL
ON ERROR
ON ESCAPE
SET ASSERTS ON
LOCAL lotest2006WS AS "XML Web Service"
* Do not remove or alter following line. It is used to support IntelliSense for your XML Web service.
*__VFPWSDef__: lotest2006WS = http://testserver/test2006.financesrvc/Service.asmx?WSDL , test2006WS , test2006WSSoap
LOCAL loException, lcErrorMsg, loWSHandler, cxml, clogin, cpass, lcResults

TRY

   loWSHandler = NEWOBJECT("WSHandler",IIF(VERSION(2)=0,"",HOME()+"FFC\")+"_ws3client.vcx")
   lotest2006WS = loWSHandler.SetupClient("http://testserver/test2006.financesrvc/Service.asmx?WSDL", "test2006WS", "test2006WSSoap")
   cxml = FILETOSTR("C:\cxml.txt")
   cxml = STRTRAN(cxml,CHR(0), '')
   cxml = STRTRAN(cxml,CHR(13), '')
   cxml = STRTRAN(cxml,CHR(10), '')
   cvaluetosend = ''
   WAIT WINDOW "Decoding XML File..." NOWAIT
   FOR ivalue = 1 TO LEN(cxml)
      cvaluetosend = cvaluetosend + XmlDecode(SUBSTR(cxml,ivalue,1))
   ENDFOR
   WAIT WINDOW "Sending Information to webservice..." NOWAIT
   cxml = cvaluetosend
*   cxml   = STRCONV(cxml,13)
   clogin = "mylogin"
*   clogin = STRCONV(clogin,13)
   cpass  = "mypassword"
*   cpass  = STRCONV(cpass,13)

   IF VARTYPE(lotest2006WS) =="O" .AND. !ISNULL(lotest2006WS)
      lotest = lotest2006WS.CalcFinancing(clogin,cpass,cxml)
      *--Just to be complete, the next line returns the same error message!
      *lotest = lotest2006WS.CalcFinancing('','','')
   ENDIF
   WAIT CLEAR

CATCH TO loException

   lcErrorMsg="Error: "+TRANSFORM(loException.ERRORNO)+" - "+loException.MESSAGE
   DO CASE
      CASE VARTYPE(lotest2006WS)#"O"
         * Handle SOAP error connecting to web service
         lcErrorMsg=lcErrorMsg+CHR(13)+'Error connecting to web service'
      CASE !EMPTY(lotest2006WS.FaultCode)
         * Handle SOAP error calling method
         lcErrorMsg=lcErrorMsg+CHR(13)+lotest2006WS.DETAIL
      OTHERWISE
         * Handle other error
   ENDCASE
   * Use for debugging purposes
   MESSAGEBOX(lcErrorMsg)

FINALLY

   IF VARTYPE(lotest) == "O" .AND. !ISNULL(lotest)
      *lcResult = STRCONV(lotest,14) && sent base64
      =AMEMBERS(proparray,lotest,1)
      IF TYPE('ALEN(proparray,1)') <> "N"
         =MESSAGEBOX('lotest.Document property does not exist')
*--->>>  Here is where I end up there is the error in lotest2006ws.detail of incorrect # of parameters passed
         IF TYPE('lotest2006WS.detail')="C"
            ASSERT !EMPTY(lotest2006WS.DETAIL) MESSAGE 'Verify value of lotest2006WS.detail in debugger.'
         ENDIF
      ELSE
         IF PEMSTATUS(lotest,'Document',5)
            cresult = lotest.DOCUMENT  && this property should exist
            IF EMPTY(cresult)
               =MESSAGEBOX('No results were returned.')
            ELSE
               =MESSAGEBOX(cresult)
            ENDIF
         ELSE
            =MESSAGEBOX('lotest.Document property does not exist')
         ENDIF
      ENDIF
   ELSE
      =MESSAGEBOX('An Error Ocurred.')
   ENDIF

ENDTRY

IF TYPE('loWSHandler') <> "U"
   RELEASE loWSHandler
ENDIF
IF TYPE('lotest2006WS') <> "U"
   RELEASE lotest2006WS
ENDIF


*-----------------------------------------------------------------------
FUNCTION XmlEncode
LPARAMETERS teExpression

*-- Transfrom 5 Known reserved XML characters Courtesy of Rick Strahl

LOCAL lcReturn
lcReturn = TRAN(teExpression)

IF VARTYPE(teExpression) = 'C'
   lcReturn = ALLTRIM(lcReturn)
   lcReturn = STRTRAN(lcReturn, '&', '&')
   lcReturn = STRTRAN(lcReturn, '<', '&lt;')
   lcReturn = STRTRAN(lcReturn, '>', '>')
   lcReturn = STRTRAN(lcReturn, '"', '"')
   lcReturn = STRTRAN(lcReturn, "'", '&apos;')
ENDIF 

RETURN lcReturn

*-------------------------------------------------------------------------
FUNCTION XMLDeCode
LPARAMETERS cTXT

*-- Transfrom 5 Known reserved XML characters Courtesy of Rick Strahl

LOCAL i,ch
FOR i=1 TO 255
  ch=ALLTRIM(STR(i))
  cTXT=STRTRAN(cTXT,"&#"+ch+";",CHR(i))
ENDFOR 
RETURN cTXT
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform