Call product data through WebService-ASP Client instance

Source: Internet
Author: User

Response. expires =-1 curpage = request. querystring ("curpage") KEYWORDS = request. querystring ("keywords") if curpage = "" Then curpage = "1" strmyiclist = getmyiclistforhtml (43, curpage, 30, keywords) response. write strmyiclist function getmyiclistforhtml (userid, curpage, pagesize, keywords) '####################################### ################# 'function Name: getmyiclistforhtml 'version:. ASP. v1.0 'function Description: Obtain the HTML list on the current page of my IC production' Parameter description: 'userid your user ID integer number' curpage current page number integer number' pagesize the number of products to be displayed per page integer number' keywords search keywords (2 or more characters) string 'Return description: 'Return to the HTML list string on the current page of the IC '############################## ########################## 'on error resume next err. clear () 'defines the variable dim strurl, strdata dim XMLHTTP, xmldoc, strresult = "" 'initial WebService URL strurl = "http: // 192.168.1.88/ECS/products. asmx/getmyiclistforhtml "strdata =" userid = "& Userid & _" & curpage = "& curpage & _" & pagesize = "& pagesize & _" & KEYWORDS = "& keywords strurl = strurl &"? "& Strdata' creates an XMLHTTP object set XMLHTTP = server. createobject ("msxml2.xmlhttp") XMLHTTP. open "get", strurl, false XMLHTTP. send () 'send an http get request' when the returned HTTP status is 200, it indicates that the request data is successful if XMLHTTP. status = 200 then' create the domdocument object set xmldoc = server. createobject ("msxml2.domdocument") xmldoc. async = false xmldoc. load (XMLHTTP. responsexml) 'Load the XML if xmldoc returned by the server. parseerror. errorcode <> 0 then getmyiclistforhtml = "error message:" & xmldoc. parseerror. reason exit function else 'response. write xmldoc. XML if xmldoc.doc umentelement. childnodes. length = 0 then strresult = "no record" else strresult=xmldoc.doc umentelement. childnodes. item (0 ). text end if 'when the returned HTTP status is not 200, else getmyiclistforhtml = "the following error message is returned by the server, which may be caused by incorrect strdata:
HTTP status: "& XMLHTTP. Status &"
HTTP status text: "& XMLHTTP. statustext &"
"Exit function end if err. Number <> 0 then getmyiclistforhtml =" error message: "& err. Description err. Clear () else getmyiclistforhtml = strresult end if end Function

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.