Registering PostalMethods in Microsoft Visual Foxpro

I am trying to use the Postal Method Web Service with my Visual Foxpro App,
but when I try to register your Web Service
(http://api.postalmethods.com/postalWS.asmx?WSDL) I get an Error - "Field COMFILE does not accept null values". I use
Interfax Web Service without problems. Please could you help with this
problem? Thanks!

Comments

Hello ssanabia, This error

Hello ssanabia,

This error seems to be caused by a bug after applying Foxpro SP2. The following thread in Microsoft forums offers a solution as well.

Please reply to this forum and let us know if the solution worked for you.

Regards,
David O.
PostalMethods Support Team

Hi David, Now, I can

Hi David,

Now, I can register the PostalMethod web service Thank you very for your support!

Here the code to use the PostalCode web service from VFP 9 after made the correction to the _ws3utils.vcx class.

LOCAL loPostalWSSimple AS "XML Web Service"
* LOCAL loPostalWSSimple AS "MSSOAP.SoapClient30"
* Do not remove or alter following line. It is used to support IntelliSense for your XML Web service.
*__VFPWSDef__: loPostalWSSimple = http://api.postalmethods.com/postalWS.asmx?WSDL , PostalWSSimple , PostalWSSimpleSoap
LOCAL loException, lcErrorMsg, loWSHandler
TRY
    loWSHandler = NEWOBJECT("WSHandler",IIF(VERSION(2)=0,"",HOME()+"FFC\")+"_ws3client.vcx")
    loPostalWSSimple = loWSHandler.SetupClient("http://api.postalmethods.com/postalWS.asmx?WSDL", "PostalWSSimple", "PostalWSSimpleSoap")
 
    * Call your XML Web service here.  ex: leResult = loPostalWSSimple.SomeMethod()
 
 
CATCH TO loException
    lcErrorMsg="Error: "+TRANSFORM(loException.Errorno)+" - "+loException.Message
    DO CASE
    CASE VARTYPE(loPostalWSSimple)#"O"
        * Handle SOAP error connecting to web service
    CASE !EMPTY(loPostalWSSimple.FaultCode)
        * Handle SOAP error calling method
        lcErrorMsg=lcErrorMsg+CHR(13)+loPostalWSSimple.Detail
    OTHERWISE
        * Handle other error
    ENDCASE
    * Use for debugging purposes
    MESSAGEBOX(lcErrorMsg)
FINALLY
ENDTRY

Once again thank you very much!

That's great to hear. Enjoy

That's great to hear. Enjoy PostalMethods.

On a different note, we highly recommend connecting to our Web Service using a secure connection. This can be achieved by registering the Web Service using HTTPS (and not HTTP). This will encrypt the transferred data using SSL and will insure it cannot be read if intercepted.

Regards,
David

Hi David. Once I try this in

Hi David.

Once I try this in VFP 9.0-SP2,following error occurs.

Error: 1429 - OLE IDispatch exception code 0 from Connector: Connector:Connection time out. HRESULT=0x800A1527 - Client:An unanticipated error occurred during the processing of this request. HRESULT=0x800A1527 - Client:Sending the Soap message failed or no recognizable response was received HRESULT=0x800A1527 - Client:Unspecified client error. HRESULT=0x800A1527..
Connector:Connection time out. HRESULT=0x800A1527 - Client:An unanticipated error occurred during the processing of this request. HRESULT=0x800A1527 - Client:Sending the Soap message failed or no recognizable response was received HRESULT=0x800A1527 - Client:Unspecified client error. HRESULT=0x800A1527

It would be a great help if you could give me a solution for this. I have increased the time out as well.

Regards,
Ravindra.

Ravindra, hi. Does this

Ravindra, hi.

Does this timeout happens all the time, and is a constant problem?
Did you try again, since you posted your comment?

It is possible that the timeout you encountered was a temporal problem with the connection, and was by now overcome.

What is your current timeout definition?

Regards,
A. Honig,
PostalMethods Support Team