日期:2014-05-16  浏览次数:21629 次

ISAPI如何处理Msxml2.ServerXMLHTTP的post请求!
请问使用那种方法可以处理下面的这些请求,现在已经使用ISAPI接受到post的数据了,但是如何发送数据才能让他的resultStr =BytesToBstr(Http.responseBody, "GB2312 ")的结果!

<SCRIPT   LANGUAGE=VBSCRIPT   RUNAT=server>
     
Class   NPOSTXML

        private   StrMyPhoNum
private   MOTOUrl
private   byttStream
private   strUID
private   strPWD


Public   Property   Let   MyPhoNum(vData)
      strMyPhoNum=Trim(vData)  
End   Property

        Public   Property   Let   UID(vData)
      strUID=Trim(vData)    
End   Property

        Public   Property   Let   Url(vData)
      MOTOUrl=Trim(vData)    
End   Property

        Public   Property   Let   SendXML(vData)
      byttStream=Trim(vData)    
End   Property

      public   Function   Send()    
      Dim   Http
      Dim   resultStr
              Set   Http   =   Server.CreateObject( "Msxml2.ServerXMLHTTP ")  
              Dim   lResolve,   lConnect,   lSend,   lReceive
              lResolve   =   5   *   1000
              lConnect   =   5   *   1000
              lSend   =   45   *   1000
              lReceive   =   45   *   1000
              Http.setTimeouts   lResolve,   lConnect,   lSend,   lReceive              
              Http.Send(byttStream)              
      if   Http.readystate   =   4   then
              resultStr=Http.responseBody
      End   if  
resultStr =BytesToBstr(Http.responseBody, "GB2312 ")
      set   Http=nothing
      Send   =   resultStr
     
End   Function
public   Function   length()    
Set   Http =Server.CreateObject( "Msxml2.ServerXMLHTTP ")  
lResolve=5   *   1000
lConnect=5   *   1000
lSend =45   *   1000
lReceive=45   *   1000
Http.setTimeouts   lResolve,   lConnect,   lSend,   lReceive
Http.open   "POST ",MOTOUrl,false
Http.Send(byttStream)
If   Http.readystate =4   Then
' length =Http.getAllResponseHeaders '全部HTTP头内容
length =Http.getResponseHeader( "Content-Length ")  
End   if
Set   Http=Nothing
length =length
End   Function
public   Function   BytesToBstr(body,Cset)    
      Dim   objStream
      Set   objStream=Server.Cr