Parses a WSDL document file into an object with an easily accessible structure.
cInterface - Name of the class
cServerUrl - URL that handles this service
aMethods[x] - Array of Method objects
nCount - Number of methods
aTypes[x] - Array of custom types for this service
nTypeCount - Number of custom types
aMethods consists of Method objects which have the following structure:
cName - Name of the Method
aParameters - Array of parameters (2d: 1 - Name of parameter 2 - xsd type)
nCount - Count of parameters
cResultName - Name of the return value
cResultType - Type of the return value
cSOAPAction - The SOAP Action header for this method call
cMethodNamespaceURI - Namespace used for this method
cMethodNameSpace - The Namespace identifier
aTypes consists of all the custom types of the Web Service
cName - Name of the custome type
nCount - Number of custom properties
aProperties - Two dimensional array that contains each of the properties
1 - Name of the property
2 - XML type including namespace prefix (s:string for example)
o.ParseServiceWSDL(lcWSDLUrl,llParseTypes)
Return Value
WSDL object or .NULL.
Parameters
lcWSDLUrl
The URL of the WSDL file to process
llParseTypes
Parses any complex types into the aTypes[] property.
Example
CLEAR DO WCONNECT *lcWSDL = "http://westwindserver/codeservice/codewebservice.asmx?wsdl" *lcWSDL= "http://aspnet.lamaan.com/webservices/QuranVerse.asmx?WSDL" lcWSDL = "http://www.foxcentral.net/foxcentral.wsdl" LOCAL oSOAP as wwsoap oSOAP = CREATEOBJECT("wwSOAP") GoUrl(lcWSDL) *** Parse the WSDL with Type support loSDL = oSOAP.ParseServiceWSDL(lcWSDL,.t.) ? "Class: " + loSDL.cInterface ? "Server URL: " + loSDL.cServerUrl ? ? "METHODS:" ? "--------" *** Walk through methods FOR EACH oMethod IN loSDL.aMethods ? oMethod.cName + "(" FOR x=1 TO oMethod.nCount ?? oMethod.aParameters[x,1] + " AS " + oMethod.aParameters[x,2] IF x < oMethod.nCount ?? "," ENDIF ENDFOR ?? ")" + " AS " + oMethod.cResultType ENDFOR IF loSDL.nTypeCount < 0 RETURN ENDIF ? ? "CUSTOM TYPES:" ? "-------------" FOR EACH oType IN loSDL.aTypes ? oType.cName FOR x = 1 TO oType.nCount ? " " + oType.aProperties[x,1] + " AS " + oType.aProperties[x,2] ENDFOR ENDFOR RETURN
See also:
Class wwSoap© West Wind Technologies, 1996-2024 • Updated: 04/05/02
Comment or report problem with topic