제가 몇년 전에 꽁수라면 꽁수로 개발한 내용이라 참고만 하세요 ㅎㅎㅎ
먼저 환경을 말씀드리면 파워빌더 10.5 버젼으로 jsp 웹서버쪽과 연동하면서 개발을 진행해야 했었습니다.
또한, 웹서버의 보안을 위하여 모든 통신은 post 방식을 반드시 이용해야 하는 환경이었구요...
당시 PostURL, GetURL 등 여러 테스트를 거쳐 봤지만 통신시에 post 방식이 아닌 get방식으로 웹서버가
인식해서 많이 고민했던거 같아여...
나중엔 과감히 html 에 파라미터 부분을 파워빌더의 파일처리로 작성하고 결과를 받아오는 방식으로 해결했습니다.
소스를 보시죠...
OLEObject IE // 웹서버와 통신할 ole 입니다. integer li_filenum // 구성할 파일 id가 되겠죠 string ls_posthtml // html 자체가 들어있는 변수입니다.
string body // body 부분의 결과 값을 가져오는 변수입니다.
// 참고
// arg_data1 는 해당 url 과 submit_id= 부분입니다.
// ex> http://123123.kr/123/.123?submit_id=123123&business_id=pam
// arg_data2 는 넘겨야 하는 파라미터 부분입니다.
// ex> '<input type="hidden" name="a" value = "' + ls_userid + '"> ~r~n' + & .......
li_filenum = FileOpen("c:\post.html",LineMode!, Write!, LockWrite!, Replace! )
// html 문을 구성합니다.
ls_posthtml = "<html> ~r~n" + & "<head> ~r~n" + & '<meta http-equiv="Content-Type: application/x-www-form-urlencoded" content="text/html; charset=utf-8" /> ~r~n' + & "</head> ~r~n" + & "<body> ~r~n" + & "<form method=post id='post_data' action= '"+arg_data1+"'> ~r~n" + & arg_data2 + & "</form> ~r~n" + & "</body> ~r~n" + & '<script type="text/javascript"> ~r~n' + & 'post_data.submit(); ~r~n' + & '</script> ~r~n' + & '</html> ~r~n'
FileWrite(li_filenum, ls_posthtml)
FileClose(li_filenum)
IE = CREATE OLEObject IE.ConnectToNewObject("InternetExplorer.Application") IE.navigate("C:\post.html")
// 응답시까지 대기 합니다. (읍답이 없을경우 한계시간 처리 내용을 추가해주세요 ㅋㅋㅋ)
DO WHILE IE.busy setpointer(hourglass!) yield() LOOP body = IE.Document.Body.InnerTEXT IE.quit() destroy IE
자 이렇게 하면 body 에 해당 인터페이스에서 주는 내용을 받을수가 있었습니다.
허접해서... ㅋㅋ 참고만 하시기를... |