AutoHotkey Community

It is currently May 25th, 2012, 9:54 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: SOAP via AHK?
PostPosted: May 27th, 2007, 5:59 pm 
Offline

Joined: March 18th, 2005, 8:52 am
Posts: 174
I searched but could not find much on the subject: And at the risk of sounding a little naive (but savvy enough to know I need to ask) here's the background and my question:

For part of an application, I need to send a SOAP request and process the response ... I already do something similar with XML/REST request responses via AutoHotkey's urldownload, and it works just fine. I am diving into trying to understand this animal called SOAP, and praying that I can get it working quickly in AHK. So far, it seems like the task is about understanding all the wraparound syntax/protocols, and not going blind while reading the documentation.

But - after reading the threads, here is my naive question: Do I really need a DLL or other external utility to communicate via SOAP? I mean, with my XML requests now, I merely contruct the proper tag/code and send/recieve via successive urldownload calls. no DLL or anything.

I searched and could not find any SOAP functions, or examples here ... but surely there are some here who use AHK to send/rec SOAP requests?

Any advice, insights, insults, pity? Anything?

Thanks!


Last edited by cornell2 on July 1st, 2007, 4:23 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 27th, 2007, 6:56 pm 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5346
Location: UK
You could try curl and XPath.

_________________
GitHubScriptsIronAHK Contact by email not private message.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 27th, 2007, 7:08 pm 
Offline

Joined: March 18th, 2005, 8:52 am
Posts: 174
Thanks ... I already use CURL and something like xpath - but my question was more specific about using SOAP ... (ie ... I can "try" lots of things)

I am asking on the forum if anyone has experience and examples of using SOAP and ahk to avoid trial and error using a protocol that I am not too familiar with in the first place. I won't know if any problems are due to my sub-knowledge of SOAP, AHK limitations, or use with the particular server-app. An answer here could eliminate 2 out of 3 so I can test.

Thanks


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 30th, 2007, 11:21 pm 
Offline

Joined: April 7th, 2004, 2:43 pm
Posts: 62
This would also be helpful for me...any pointers appreciated thanks.

Cornell: Can you post an example of how to use XML/REST with AHK? How do you"send" the xml request? (URLDownloadToFile I believe just retreives, does not send).

Thx
Payam


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 30th, 2007, 11:28 pm 
Offline

Joined: June 26th, 2006, 6:14 pm
Posts: 1379
Location: USA
Payam wrote:
This would also be helpful for me...any pointers appreciated thanks.

Cornell: Can you post an example of how to use XML/REST with AHK? How do you"send" the xml request? (URLDownloadToFile I believe just retreives, does not send).

Thx
Payam

Via the url. just like the "t=19573&highlight=" (topic # 19573) at the end of the url for this page. the url "sends" the php script the info it needs for you to "retrieve" what you are wanting with urldownloadtofile .


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 30th, 2007, 11:54 pm 
Offline

Joined: April 7th, 2004, 2:43 pm
Posts: 62
Ahh ok thx, so its like a GET request.

Now a way to do this with SOAP? :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 1st, 2007, 8:02 pm 
Offline

Joined: March 18th, 2005, 8:52 am
Posts: 174
Payam wrote:
This would also be helpful for me...any pointers appreciated thanks.

Cornell: Can you post an example of how to use XML/REST with AHK? How do you"send" the xml request? (URLDownloadToFile I believe just retreives, does not send).

Thx
Payam


URLDownloadtoFile does indeed send ... (the "url" you specify to get the webpage is sending that URL !).

So ... while I am no expert, I got this to work by long hours of trial and error and tweaking. The system I am dealing with accepts "REST" requests and returns XML formatted responses.

In my case, the server has a https : //www.mainserver.com/RestRequests address and a protocol for REST requests such as (made up example below - first without AHK)

ProductID=33823023
ProductDetails=Yes
ProductImage=Large
and I need to include
UserID=mysuserid
Securitycode=1920932937237


which should return some XML such as

<ProductDetails>
<ProductType>Printer</ProductTyoe>
<Price>119.00</Price>
<Manufacturer>Lexmark</Manufacturer>
</ProductDetails>
<ProductImage>http://www.mainserver.com/lexmark124imagelarge.jpg</ProductImage>

-----
I should actually be able to type in this request into my browser ...
https : //www.mainserver.com/RestRequests?UserID=mysuserid&Securitycode=1920932937237&ProductID=33823023&ProductDetails=Yes&ProductImage=Large

----
Using AHK, you might code it as ...

request_header1=https://www.mainserver.com/RestRequests
request_header2=`?UserID`=mysuserid`&Securitycode=1920932937237
request_header3=`&ProductID=33823023`&ProductDetails=Yes`&ProductImage=Large

rest_request=%request_header1%%request_header2%%request_header3%

URLDownloadToFile,%rest_request%, c:\responsefile.xml
FileRead, xml_response_string, c:\responsefile.xml

----
so URLDownloadToFile send rest_request, and captures it in c:\responsefile.xml

then you read the response string (xml_response_string) and parse however you'd like

the code above is made-up for example ... and is of course not the bext way to code this, but written so you might be able to follow it and understand the main point

Hope this helps!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 1st, 2007, 10:50 pm 
Offline

Joined: April 7th, 2004, 2:43 pm
Posts: 62
Yes cornell, it works, thank you.

Regarding, SOAP however, which requires I believe sending XML over HTTP....any advise/experience?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 2nd, 2007, 1:58 pm 
Offline

Joined: March 18th, 2005, 8:52 am
Posts: 174
No. But I too would love some insights as to getting AHK to work with SOAP protocol ...


Report this post
Top
 Profile  
Reply with quote  
PostPosted: July 24th, 2009, 7:01 pm 
Offline

Joined: February 17th, 2008, 5:01 pm
Posts: 303
Hi everyone,

It's been two years since this thread has been accessed and it is the most recent thread I could find about SOAP. Does anyone have any new ideas for accessing SOAP from AHK?

JS


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 24th, 2009, 7:26 pm 
i guess you can use httpquerry to upload your soap-request via http-post.
to create the request and read the answer you would need xpath.


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: KenC, Klark92, Yahoo [Bot] and 73 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group