티스토리 뷰

반응형

파워빌더에서 Post로 전송하는 방법2가지

1.웹브라우즈를 실행하여 HTML 과 Javascirpt 구문을 사용하여 보내는 방법
  : Post방식으로 전송만 하고 끝날 경우 사용


2.Microsoft.XMLHTTP를 이용하는방법
  : Post전송후 리턴 받은 값을 확인해야되는 경우 사용

String ls_Send, ls_Hp_No, ls_ID, ls_PW, ls_arg, ls_response_text

ls_Send      = 'sendMessage'
ls_Hp_No     = '01000000000'
ls_ID	     = 'id'
ls_PW        = 'pw'

ls_Post_URL = 'post전송url'
ls_arg 	= "uid=" + ls_ID
ls_arg 	= ls_arg +"&pass=" + ls_PW
ls_arg 	= ls_arg + "&rphone="+ls_Hp_No
ls_arg 	= ls_arg + "&msg="+ls_Send	

loo_xmlhttp = CREATE oleobject
loo_xmlhttp.ConnectToNewObject("Microsoft.XMLHTTP")
loo_xmlhttp.open("POST",ls_Post_URL, false)
loo_xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
loo_xmlhttp.send(ls_arg)

ls_response_text = String(loo_xmlhttp.ResponseText)
loo_xmlhttp.DisconnectObject()

// ls_response_text 에 따른 로직처리가 필요한 경우 추가 아래는 Sample
IF ls_response_text = '결과값' Then
      
Else 

End IF

//-------------------------------------
반응형
댓글