Hi It's clearly making the call, otherwise you would have the ErrText reporting a network error or malformed request rather than getting back a valid (in terms of the call) HTTP 400 return. So looks like something is blocking between your uv server and your target website: are you certain that you are not going through a proxy server, and that there is no authentication required to get to that ASP page? Seems odd that the world could just hit the page with any product code and details..
Brian > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of > [email protected] > Sent: 21 June 2009 15:39 > To: U2 Users List > Subject: Re: [U2] uvRunCommand > > Thanks Brian, As usual with almost every sample I download > from the web. I'm doing something different than was expected > and it does not work for me. > > Here is my UV code and the Result. I commented out the Snip > Snip part of WebCall. Please explain the stupid thing I am doing. > > DEFFUN URLENCODE(INSTRING) 'This is from PickWiki > PORT=FIELD(OCONV('','U50BB'),' ',1) > PROD.NO=TIME() > DESC=\TEST DESC 8" 2x4 #56\ > QUERYSTRING='prodno=':URLENCODE(PROD.NO):"&desc=":URLENCODE(DESC) > URL="http://www.MyCustomersServer.com/produpdate.asp" > INDATA=URL > INDATA<2>=QUERYSTRING > INDATA<3>='GET' > CALL WEBCALL(INDATA,OUTDATA,ERR) > PRINT OUTDATA > PRINT ERR > STOP > > Resultant of OUTDATA AND ERR > 400 Bad Request Content-Type text/html Date Sun, 21 Jun 2009 > 14:36:07 GMT Connec tion close Content-Length 39 <h1>Bad > Request (Invalid Hostname)</h1> > > > >At 6/21/2009 08:22 AM, you wrote: > >>Tony is right: you need a more direct route. > >> > >>CallHTTP should do the job, if it's a regular querystring > or form post. > >>Seems a bit of a flaky option also, but there you go.. Web > service call > >>might have been better. > >> > >>Here's a quick example with the relevant pieces (for an > explanation see my > >>blog at mvdeveloper.blogspot.com): > >> > >> SUBROUTINE TestWebCall(InData, OutData, ErrText) > >> > >> EQU IN.URL To 1 > >> EQU IN.QUERYSTRING TO 2 > >> EQU IN.METHOD TO 3 > >> EQU IN.PROXY TO 4 > >> EQU IN.POSTVARS To 5 > >> EQU IN.POSTVALUES TO 6 > >> EQU IN.HTTPVERSION To 7 > >> EQU IN.HTTPHEADER To 8 > >> EQU IN.HTTPVALUES To 9 > >> > >> EQU OUT.STATUS To 1 > >> EQU OUT.HEADER To 2 > >> EQU OUT.DATA To 3 > >> > >> EQU HTTP_SUCCESS TO 0 > >> > >> OutData = '' > >> ErrText = '' > >> > >> If InData<IN.HTTPVERSION> = "" Then > >> InData<IN.HTTPVERSION> = "1.0" > >> End > >> > >> Ok = setHTTPDefault("VERSION", InData<IN.HTTPVERSION>) > >> Ok = setHTTPDefault("PROXY_NAME", InData<IN.PROXY>) > >> > >> Path = InData<IN.URL> > >> If InData<IN.QUERYSTRING> <> "" Then > >> Path := "?" : InData<IN.QUERYSTRING> > >> End > >> Method = InData<IN.METHOD> > >> If Method = '' Then > >> Method = 'GET' > >> End > >> > >> Ok = createRequest(Path, Method, hRequest) > >> If Ok <> HTTP_SUCCESS Then > >> ErrText = "Error creating HTTP Request (":Ok:")" > >> RETURN > >> End > >> > >> --- snip -- snip -- snip --- > >> > >>* Send request > >> PostData = '' ;* set above > >> DEF_TIMEOUT = 60000 > >> ResponseHeader = '' > >> ResponseData = '' > >> > >> Ok = submitRequest(hRequest, DEF_TIMEOUT, PostData, > ResponseHeader, > >>ResponseData, HTTPStatus) > >> If Ok <> HTTP_SUCCESS Then > >> ErrText = "Error submitting request (": Ok:")" > >> RETURN > >> End > >> OutData<OUT.STATUS> = HTTPStatus > >> OutData<OUT.HEADER> =Convert(@FM,@VM, ResponseHeader) > >> OutData<OUT.DATA> = Convert(@FM, @VM, ResponseData) > >> RETURN > >> > >> > >>Brian > >> > >> > >> > -----Original Message----- > >> > From: [email protected] > >> > [mailto:[email protected]] On Behalf Of > >> > [email protected] > >> > Sent: 21 June 2009 11:52 > >> > To: [email protected] > >> > Subject: [U2] uvRunCommand > >> > > >> > The example is just a test. Both servers are trusted servers. > >> > I run both of them. The end result will update a Product SQL > >> > table on a web server in a data center with current product > >> > pricing as the user updates his local UV database. I tried > >> > 1st with Call.http. There are few examples that google can > >> > find and none that show what I am trying to do. Call.http was > >> > my 1st try. Can you post a simple example that sends a url > >> > with a query string and gets the result page back so my UV > >> > basic program can know the price was updated ok please. > >> > > >> > thanks > >> > > >> > _______________________________________________ > >> > U2-Users mailing list > >> > [email protected] > >> > http://listserver.u2ug.org/mailman/listinfo/u2-users > >> > > >> > >>_______________________________________________ > >>U2-Users mailing list > >>[email protected] > >>http://listserver.u2ug.org/mailman/listinfo/u2-users > >> > >>__________ Information from ESET NOD32 Antivirus, version of virus > >>signature database 4174 (20090620) __________ > >> > >>The message was checked by ESET NOD32 Antivirus. > >> > >>http://www.eset.com > > > >Curt Lashley > >2803 North Boulevard > >Tampa, FL 33602 > >Cell: (813) 293-2878 or (800) 886-2878 > >Home: (813) 226-2878 or (800) 524-2878 > >Fax: (813) 229-2878 > > > >_______________________________________________ > >U2-Users mailing list > >[email protected] > >http://listserver.u2ug.org/mailman/listinfo/u2-users > > > >__________ Information from ESET NOD32 Antivirus, version of virus > >signature database 4174 (20090620) __________ > > > >The message was checked by ESET NOD32 Antivirus. > > > >http://www.eset.com > > > > > > Curt Lashley > 2803 North Boulevard > Tampa, FL 33602 > Cell: (813) 293-2878 or (800) 886-2878 > Home: (813) 226-2878 or (800) 524-2878 > Fax: (813) 229-2878 > > _______________________________________________ > U2-Users mailing list > [email protected] > http://listserver.u2ug.org/mailman/listinfo/u2-users > _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users
