Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Build WebService Client App
Message
From
18/07/2005 05:11:39
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Web Services
Title:
How to Build WebService Client App
Environment versions
Visual FoxPro:
VFP 8
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01033446
Message ID:
01033446
Views:
54
Hi,
I try to build webservice client application.
I use taskpane to generate proxy class. It returns

When I try to understand this code... I got questions:

1) LineItem As ArrayOf_LineItem - where the ArrayOf_LineItem is defined? I check in WSDL file - it complex type
          <xsd:complexType name="__LineItem">
            <xsd:sequence>
              <xsd:element name="MaterialNumber" nillable="true" type="xsd:string"/>
              <xsd:element name="Quantity" nillable="true" type="xsd:string" minOccurs="0"/>
            </xsd:sequence>
          </xsd:complexType>
          <xsd:complexType name="ArrayOf__LineItem">
            <xsd:complexContent>
              <xsd:restriction base="SOAP_ENC:Array">
                <xsd:attribute ref="SOAP_ENC:arrayType" wsdl:arrayType="tns:__LineItem[]"/>
              </xsd:restriction>
May I createobject("ArrayOf_LineITem") using FFC? and proxy class or I need create something other?

2) line where written * Call your XML Web service here
Should I there write "checkPriceAvailability(....)" - as written in Syntax? or what?


3) How to pass complex parameters like ArrayOf_LIneITem and LIneItemResults?


Thanks.
Denis.


P.S.
There is TaskPane generated code
Syntax: 
checkPriceAvailability(PartnerCountryCode AS string, StockType AS string, LineItem AS ArrayOf__LineItem, LineItemResults AS ArrayOf__LineItemResults) AS string 
 
Sample Code: 
LOCAL loActWebServices_PriceAvailabilityPort0 AS "XML Web Service"
* LOCAL loActWebServices_PriceAvailabilityPort0 AS "MSSOAP.SoapClient30"
* Do not remove or alter following line. It is used to support IntelliSense for your XML Web service.
*__VFPWSDef__: loActWebServices_PriceAvailabilityPort0 = http://localhost/checkPriceAvailability_Test.wsdl , ActWebServices_PriceAvailabilityService , ActWebServices_PriceAvailabilityPort0
LOCAL loException, lcErrorMsg, loWSHandler
TRY
	loWSHandler = NEWOBJECT("WSHandler",IIF(VERSION(2)=0,"",HOME()+"FFC\")+"_ws3client.vcx")
	loActWebServices_PriceAvailabilityPort0 = loWSHandler.SetupClient("http://localhost/checkPriceAvailability_Test.wsdl", "ActWebServices_PriceAvailabilityService", "ActWebServices_PriceAvailabilityPort0")
	* Call your XML Web service here.  ex: leResult = loActWebServices_PriceAvailabilityPort0.SomeMethod()
	
CATCH TO loException
	lcErrorMsg="Error: "+TRANSFORM(loException.Errorno)+" - "+loException.Message
	DO CASE
	CASE VARTYPE(loActWebServices_PriceAvailabilityPort0)#"O"
		* Handle SOAP error connecting to web service
	CASE !EMPTY(loActWebServices_PriceAvailabilityPort0.FaultCode)
		* Handle SOAP error calling method
		lcErrorMsg=lcErrorMsg+CHR(13)+loActWebServices_PriceAvailabilityPort0.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