Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Client: Incorrect Number of Parameters Supplied Error
Message
De
16/05/2006 15:42:53
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Web Services
Titre:
Client: Incorrect Number of Parameters Supplied Error
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:
01122410
Vues:
762
Error returned is:"Client: Incorrect number parameters supplied for SOAP request
HRESULT = 0x80070057: The parameter is incorrect..."
Here is my code:
LOCAL loPrime2006WS AS "XML Web Service"
* LOCAL loPrime2006WS AS "MSSOAP.SoapClient30"
* Do not remove or alter following line. It is used to support IntelliSense for your XML Web service.
*__VFPWSDef__: loPrime2006WS = http://ourserver/oursite/Service.asmx?WSDL , Prime2006WS , Prime2006WSSoap
LOCAL loException, lcErrorMsg, loWSHandler
TRY
   loWSHandler = NEWOBJECT("WSHandler",IIF(VERSION(2)=0,"",HOME()+"FFC\")+"_ws3client.vcx")
   loPrime2006WS = loWSHandler.SetupClient("http://oursever/oursite.financesrvc/Service.asmx?WSDL", "Prime2006WS", "Prime2006WSSoap")
   * Call your XML Web service here.  ex: leResult = loPrime2006WS.SomeMethod()
   cxml = FILETOSTR("C:\cxml.txt")
   clogin = 'loginname' && <---Actual login substituted for this of course
   cpass = 'password'   && <---Actual password substituted for this of course
   loPrime = loPrime2006WS.CalcFinancing(clogin,cpass,cxml)
   *^^^^ Error occurs in line above
   IF TYPE('loPrime') = "O" .and. !ISNULL(loPrime)   
      =AMEMBERS(gaprops,loPrime,1)   && <-------- Problem here
      ********** loprime is an object, not null here but no props
      ********** gaprops does not exist here
      set STEP on
   ENDIF
   cresult = loPrime.document   && this property should exist but it does not
   IF !EMPTY(cresult)
      =MESSAGEBOX(cresult)
   ELSE
      =MESSAGEBOX('No results were returned.')
   ENDIF
   RELEASE loPrime2006WS
   RELEASE loWSHandler

CATCH TO loException
   lcErrorMsg="Error: "+TRANSFORM(loException.ERRORNO)+" - "+loException.MESSAGE
   DO CASE
      CASE VARTYPE(loPrime2006WS)#"O"
         * Handle SOAP error connecting to web service
      CASE !EMPTY(loPrime2006WS.FaultCode)
         * Handle SOAP error calling method
         lcErrorMsg=lcErrorMsg+CHR(13)+loPrime2006WS.DETAIL
      OTHERWISE
         * Handle other error
   ENDCASE
   * Use for debugging purposes
   MESSAGEBOX(lcErrorMsg)
FINALLY
ENDTRY
Here is the webservice service description:
 <?xml version="1.0" encoding="utf-8" ?> 
 <?xml version="1.0" encoding="utf-8" ?> 
- <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
 xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
 xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
 xmlns:tns="www.oursite.net/FinanceSrvc"
 xmlns:s="http://www.w3.org/2001/XMLSchema"
 xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
 xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
 targetNamespace="www.oursite.net/FinanceSrvc"
 xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
  <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Our
    Web Services</wsdl:documentation> 
- <wsdl:types>
- <s:schema elementFormDefault="qualified" targetNamespace="www.oursiteonline.net/FinanceSrvc">
- <s:element name="CalcFinancing">
- <s:complexType>
- <s:sequence>
  <s:element minOccurs="0" maxOccurs="1" name="LoginID" type="s:string" /> 
  <s:element minOccurs="0" maxOccurs="1" name="LoginPassword" type="s:string" /> 
  <s:element minOccurs="0" maxOccurs="1" name="aDoc" type="s:string" /> 
  </s:sequence>
  </s:complexType>
  </s:element>
- <s:element name="CalcFinancingResponse">
- <s:complexType>
- <s:sequence>
  <s:element minOccurs="0" maxOccurs="1" name="CalcFinancingResult" type="tns:TSrvcResponse" /> 
  </s:sequence>
  </s:complexType>
  </s:element>
- <s:complexType name="TSrvcResponse">
- <s:sequence>
  <s:element minOccurs="1" maxOccurs="1" name="Status" type="tns:TResponseStatus" /> 
  <s:element minOccurs="0" maxOccurs="1" name="Document" type="s:string" /> 
  </s:sequence>
  </s:complexType>
- <s:simpleType name="TResponseStatus">
- <s:restriction base="s:string">
  <s:enumeration value="sOK" /> 
  <s:enumeration value="sBusy" /> 
  <s:enumeration value="sFailed" /> 
  <s:enumeration value="sLoginFailed" /> 
  </s:restriction>
  </s:simpleType>
.·*´¨)
.·`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"
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform