AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SOAP via AHK?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
cornell2



Joined: 18 Mar 2005
Posts: 166

PostPosted: Sun May 27, 2007 5:59 pm    Post subject: SOAP via AHK? Reply with quote

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 Sun Jul 01, 2007 4:23 pm; edited 1 time in total
Back to top
View user's profile Send private message
Titan



Joined: 11 Aug 2004
Posts: 5068
Location: imaginationland

PostPosted: Sun May 27, 2007 6:56 pm    Post subject: Reply with quote

You could try curl and XPath.
_________________

RegExReplace("irc.freenode.net/ahk", "^(?=(.(?=[\0-r\[]*((?<=\.).))))(?:[c-\x73]{2,8}(\S))+((2)|\b[^\2-]){2}\D++$", "$u3$1$3$4$2")
Back to top
View user's profile Send private message Visit poster's website
cornell2



Joined: 18 Mar 2005
Posts: 166

PostPosted: Sun May 27, 2007 7:08 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Payam



Joined: 07 Apr 2004
Posts: 58

PostPosted: Sat Jun 30, 2007 11:21 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail MSN Messenger
ahklerner



Joined: 26 Jun 2006
Posts: 1205
Location: USA

PostPosted: Sat Jun 30, 2007 11:28 pm    Post subject: Reply with quote

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" (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 .
Back to top
View user's profile Send private message
Payam



Joined: 07 Apr 2004
Posts: 58

PostPosted: Sat Jun 30, 2007 11:54 pm    Post subject: Reply with quote

Ahh ok thx, so its like a GET request.

Now a way to do this with SOAP? Smile
Back to top
View user's profile Send private message Send e-mail MSN Messenger
cornell2



Joined: 18 Mar 2005
Posts: 166

PostPosted: Sun Jul 01, 2007 8:02 pm    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message
Payam



Joined: 07 Apr 2004
Posts: 58

PostPosted: Sun Jul 01, 2007 10:50 pm    Post subject: Reply with quote

Yes cornell, it works, thank you.

Regarding, SOAP however, which requires I believe sending XML over HTTP....any advise/experience?
Back to top
View user's profile Send private message Send e-mail MSN Messenger
cornell2



Joined: 18 Mar 2005
Posts: 166

PostPosted: Mon Jul 02, 2007 1:58 pm    Post subject: Reply with quote

No. But I too would love some insights as to getting AHK to work with SOAP protocol ...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group