****
DO shipserviceproxy
loProxy = CREATEOBJECT("ShipServiceProxy","V2")
lcResult = loproxy.processshipment("Parm1")
? loProxy.cErrorMsg <-- error says method not found shipmethod shipmethod.processshipment to found
looking at loproxy has none of the methods that are found in reflector...
***
*shipserviceproxy.prg**************************
DO wwDotNetBridge
SET PROCEDURE TO shipserviceproxy ADDITIVE
*************************************************************
DEFINE CLASS ShipServiceProxy AS Custom
*************************************************************
*: Generated with West Wind .NET Web Service Proxy Generator
*: Created: 07/15/13 08:40:17 AM
*:
*: It's recommended you don't modify this class as it may be
*: regenerated. If you need customization use a subclass in
*: separate PRG file that overrides behavior.
*************************************************************
*** Stock Properties
oBridge = null
oService = null
cServiceUrl = "https://wwwcie.ups.com/webservices/Ship"
cWsdlUrl = "http://telecom.shieldswired.us/WIREDWEB/ship.wsdl"
cAssemblyPath = LOWER(FULLPATH([shipserviceproxy.dll]))
cComClass = "ShipService.ShipService"
cErrorMsg = ""
cErrorDetailXml = ""
lError = .F.
*** Holds any array based results
DIMENSION aResult[1]
************************************************************************
* Init
****************************************
FUNCTION Init(lcDotNetVersion,llNoLoad)
IF !llNoLoad
IF !this.LoadService(lcDotNetVersion)
ERROR this.cErrorMsg
ENDIF
ENDIF
ENDFUNC
* Init
************************************************************************
* LoadService
****************************************
*** Function: Loads an instance of the .NET Runtime if not loaded
*** and loads wwDotnetBridge .NET component into the runtime.
*** Assume: .NET is available
*** Failure will throw a FoxPro error
*** Pass: lcDotnetVersion
*** "V2","V4" or explicit .NET version
*** defaults to V2
*** Return: .T. or .F.
************************************************************************
FUNCTION LoadService(lcDotNetVersion)
LOCAL loBridge as wwDotNetBridge
IF ISNULL(this.oBridge)
THIS.oBridge = CREATEOBJECT("wwDotNetBridge",lcDotNetVersion)
IF !this.oBridge.Loadassembly(this.cAssemblyPath)
this.cErrorMsg = this.oBridge.cErrorMsg
RETURN .F.
ENDIF
ENDIF
IF ISNULL(this.oService)
this.oService = this.oBridge.CreateInstance(this.cComClass)
IF ISNULL(this.oService)
this.cErrorMsg = this.oBridge.cErrorMsg
RETURN .F.
ENDIF
*** For some reason accessing URL directly doesnt work - use indirect referencing
*this.oService.Url = this.cServiceUrl
this.oBridge.SetProperty(this.oService,"Url",this.cServiceUrl)
ENDIF
RETURN .T.
ENDFUNC
* LoadService
************************************************************************
* HttpLogin
****************************************
*** Function: Sends authentication credentials to the server.
*** Assume: Negotiates the auth protocol requested by the server
*** Pass: username/password
*** OR pass "Windows" or empty for username to use
*** Windows default credentials (works only with Windows Auth)
*** Return: nothing
************************************************************************
FUNCTION HttpLogin(lcUserName, lcPassword, llPreAuthenticate)
IF EMPTY(lcUserName)
lcUserName = "Windows"
ENDIF
IF EMPTY(lcPassword)
lcPassword = ""
ENDIF
this.oService.HttpLogin(lcUsername, lcPassword, llPreAuthenticate)
************************************************************************
* ProcessShipment
****************************************
FUNCTION ProcessShipment(ShipmentRequest as ShipmentRequest) as ShipmentResponse
LOCAL loException as Exception, lvResult as ShipmentResponse
THIS.lError = .F.
this.cErrorMsg = ""
lvResult = .F.
TRY
lvResult = this.oBridge.InvokeMethod(this.oService, "ProcessShipment", ShipmentRequest)
CATCH to loException
THIS.GetErrorDetail(loException)
ENDTRY
RETURN lvResult
ENDFUNC
* ProcessShipment
************************************************************************
* ProcessShipConfirm
****************************************
FUNCTION ProcessShipConfirm(ShipConfirmRequest as ShipConfirmRequest) as ShipConfirmResponse
LOCAL loException as Exception, lvResult as ShipConfirmResponse
THIS.lError = .F.
this.cErrorMsg = ""
lvResult = .F.
TRY
lvResult = this.oBridge.InvokeMethod(this.oService, "ProcessShipConfirm", ShipConfirmRequest)
CATCH to loException
THIS.GetErrorDetail(loException)
ENDTRY
RETURN lvResult
ENDFUNC
* ProcessShipConfirm
************************************************************************
* ProcessShipAccept
****************************************
FUNCTION ProcessShipAccept(ShipAcceptRequest as ShipAcceptRequest) as ShipAcceptResponse
LOCAL loException as Exception, lvResult as ShipAcceptResponse
THIS.lError = .F.
this.cErrorMsg = ""
lvResult = .F.
TRY
lvResult = this.oBridge.InvokeMethod(this.oService, "ProcessShipAccept", ShipAcceptRequest)
CATCH to loException
THIS.GetErrorDetail(loException)
ENDTRY
RETURN lvResult
ENDFUNC
* ProcessShipAccept
************************************************************************
* GetErrorDetail
****************************************
*** Function: Internal method to pick up error information
*** from exceptions
************************************************************************
PROTECTED FUNCTION GetErrorDetail(loException,laError)
LOCAL loException, loType, lcTypeName
this.lError = .T.
this.cErrorDetailXml = ""
this.cErrorMsg = loException.Message
IF AT("OLE ",this.cErrorMsg) > 0 AND AT(":",this.cErrorMsg) > 0
this.cErrorMsg = ALLTRIM(SUBSTR(this.cErrorMsg,AT(":",this.cErrorMsg) + 1))
ENDIF
*** Make sure we're dealing with a SOAP Exception
loException = THIS.oBridge.oDotnetBridge.LastException
IF ISNULL(loException) OR ISNULL(loException.InnerException)
RETURN
ENDIF
IF TYPE("loException.InnerException") = "O"
loException = loException.InnerException
ELSE
RETURN
ENDIF
loType = this.oBridge.InvokeMethod(loException,"GetType")
lcTypeName = this.oBridge.GetProperty(loType,"Name")
IF lcTypeName != "SoapException"
this.cErrorDetailXml = this.oBridge.GetPropertyEx(loException,"Message")
RETURN
ENDIF
*** Grab the full XML Error Detail block
this.cErrorDetailXml = this.oBridge.GetPropertyEx(loException,"Detail.OuterXml")
ENDFUNC
* GetErrorDetail
ENDDEFINE
**************************