sending xml through progress

Hi,

We have programs creating xml data and can send it off to the relevant project one at a time using SoapUI.

Does anybody know of an easy way to 'wrap' up the sending so that it can be automated(there are 20,000 items to go/receive), or are we going about it in the wrong way?

Using Progress 9.1E under windows

Hope someone can help.

Regards
Mike
 

Jupiter

Member
Faced similar kind of problem. Need to send XML online to a web service through http POST method. How can this be implemented? Any help is deeply appreciated.

Thanks
 

taqvia

Member
We can create a function to achieve the same.
run xmlsend(inp1,
inp2,
out1).
Procedure xmlsend.
def input parameter ipxmls as char no-undo.
def input parameter url as char no-undo.
def output parameter outerror as char no-undo.
def var httpsc as com-handle.
CREATE 'microsoft.xmlhttp':U httpsc.


NO-RETURN-VALUE Httpsc:Open('POST':U,
ip_url,
FALSE,
'':U,
'':U) no-error.

NO-RETURN-VALUE Httpsc:setRequestHeader('Content-Type':U,
'text/xml':U) no-error.

NO-RETURN-VALUE Httpsc:send(ipxmls) NO-ERROR.
RELEASE OBJECT Httpsc NO-ERROR.

end procedure.


Hope this helps and u can build ur based on this.


AT
 

joey.jeremiah

ProgressTalk Moderator
Staff member
its like this i've got lots of, i think, great libraries.

but i'd like to find someone who could help me write a couple words about them.
 

Jupiter

Member
Hi joey,

please provide the link.

Thanks Taqvia, for the code snippet. As of now, I have used an implementation which looks as follows:

Code:
 postRequest = 
      'POST ' + postUrl + ' HTTP/1.0~r~n' +
      'Content-Type: text/xml~r~n' +
      'Content-Length:' + string(length(postData)) + '~r~n' +
      '~r~n' + 
      postData + '~r~n'.
 
 
   set-size(mRequest)            = 0.
   set-size(mRequest)            = length(postRequest) + 1.
   set-byte-order(mRequest)      = big-endian.
   put-string(mRequest,1)        = postRequest.
   hSocket:WRITE(mRequest, 1, LENGTH(postRequest))

I have taken the sample from PSDN. Thanks everybody for help.
 

tamhas

ProgressTalk.com Sponsor
If you post the code, even with nominal descriptions, people can at least see and use it. Perhaps you will inspire someone to write some documentation!
 

Errornix

New Member
Hey joey,

I'm just hear to try to convince you to post your code. I'm in the same situation as Jupiter, and I need all the help I can get. I've never done any kind of socket programming with Progress, and I'm sure I could learn a lot from your library.
 

alex10

New Member
Looks great but where do i found:

/* *** Include com a API do StarWeb FrameWork *** */
{ cgi/cgi-cgi.i &carregarSuportePara="XML"}

I know it is an StarWeb include but how can i use it in my application?

Thanks
 

agnaldo.macedo

New Member
Hi Alex

StarWeb FrameWork (SWFW) is an alternative compatible with WebSpeed.
This include belongs (is part) of it.
Unfortunately, SWFW is not free.
But the examples show how simple it solve certain problems, when we use API's expertise.

.
 

Errornix

New Member
Help Connecting to Port 80

I think my application is close to working, but I am having difficulty connecting to the host on port 80. The following connects:

DEFINE VARIABLE hSocket AS HANDLE NO-UNDO.
CREATE SOCKET hSocket.
hSocket:CONNECT("-H somehost -S 443").

But if I try the same thing on port 80, then it won't connect. I've successfully connected to multiple hosts on port 443, but I can't connect to any on port 80, so I'm sure it's not the host that is having an issue with this port. Has anybody ever encountered this?
 

agnaldo.macedo

New Member
80 is the default port http
But 443 is https.
The standard is you can access via port 80.
The port 443 uses SSL.
Via Progress, is not common.
 

Errornix

New Member
Ah, I'm an idiot. The reason I can't connect on port 80 is because it's blocked and I need to connect through a proxy... the plot thickens.
 

RKR

Member
Ah, I'm an idiot. The reason I can't connect on port 80 is because it's blocked and I need to connect through a proxy... the plot thickens.

Try using port 8080. Most of the times when there is a proxy port 8080 is used instead of port 80. Otherwise you have to find out what port the proxy is using.
 

Errornix

New Member
I'm getting closer. I've finally managed to connect and send my request. However, I am now getting a "400 Bad Request" response. Here's what my request looks like:

POST /path/to/something.aspx HTTP/1.1
Content-Type: text/xml
Content-Length: 485

<?xml version="1.0"?>
<more xml here blah blah...>



Do I need more information in my header, or does anything look like it's not formatted correctly?
 

Errornix

New Member
I actually tried that right after my last post. I also added Host to the HTTP header. Together these got it to work. :)

Thanks for the help, everybody.
 
Top