Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to send data to a server using Post method and without using BLOB data type

Status
Not open for further replies.

pratimsingha

Programmer
Feb 12, 2015
2
0
0
IN
Please consider the below information:
[ul]
[li]I am working in Powerbuilder technology.[/li]
[li]An OLE web browser object is defined in a window of the Powerbuilder.[/li]
[li]Expected scenerio: Data from the Powerbuilder window will be passed to the server where the data will be parsed and a report will be generated which will be viewed in the OLE object in the powerbuilder window.[/li]
[/ul]
Steps taken:

[ul]
[li]While sending data from the Powerbuilder window to the server, I do not want to append the data in the URL and send it to the Server. Therefore, I cannot use the Get method and so have tried with Post method.[/li]
[li]Used powerbuilder's PostURL method to send the data to the server.[/li]
Below is an example:
[/ul]
Code:
Int li_return
String ls_url1, ls_url2
Blob lb_blob
Long ll_bloblen

n_internetresult lu_data

If GetContextService("Internet", iinet_base) = 1 Then
ls_url1 = "http:// ip-address-of-the-server:port no./xxx?"
ls_url2 = "here the data, that will be passed to the server, are stored"
//*the data are converted into blob data*
lb_blob = blob(ls_url2)
ll_bloblen = len(lb_blob)
ls_header = "Content-Type: " + "application/x-[URL unfurl="true"]www-form-urlencoded~nContent-Length:[/URL] " + string(ll_bloblen) + "~n~n"
li_return = iinet_base.PostURL(ls_url1, lb_blob, ls_header, 8080, lu_data)
End if
The above code is working fine. We can send data to the server successfully.

Problem
[ul]
[li]The data is converted to Blob and sent to the server. In the server side, its getting difficult to convert the blob data to the data that we were passing from the Powerbuilder window. In the server side, the language used is java.[/li]

[li]So is there any way to send the data via post method without converting the arguments to blob data type in powerbuilder?[/li]

[li]Powerbuilder version used: PowerBuilder Classic 12.5[/li]
[/ul]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top