FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   Add to FavoritesAdd to Favorites
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    RSS Get RSS Feed  


SOAP and WSDL interaction?

 
Post new topic   Reply to topic    Macro Scheduler and Windows Automation Forum Index -> Technical / Scripting
View previous topic :: View next topic  
Author Message
rullbandspelare
Pro Scripter


Joined: 23 Mar 2004
Posts: 80

Reputation: 100
Earn Points, Win a T-Shirt

PostPosted: Sun Oct 19, 2008 5:49 am    Post subject: SOAP and WSDL interaction? Reply with quote

Hi!
I am trying to interact with a WSDL web service.
Is there anyone who have used MS with webservices like this?
I am trying to send a request with HTTPrequest, but I am not sure that it works. Is there anyway to change the HTTP header

My plan is to use cURL if HTTPrequest does not work.


Thanks for ANY input.

Did this message help you? If so please reward the poster with Reputation Points? Reward Points
Back to top
View user's profile Send private message
mtettmar
Site Admin


Joined: 19 Sep 2002
Posts: 4221
Location: Dorset, UK
Reputation: 621
votes: 28
Earn Points, Win a T-Shirt

PostPosted: Sun Oct 19, 2008 12:42 pm    Post subject: Reply with quote

You can do it with VBScript and MSSOAP.SOAPClient

http://msdn.microsoft.com/en-us/library/ms997641.aspx


_________________
Regards,
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Please do not email/PM me for private support - post to the forum so that everyone benefits. For private support please send email via our web site.

Did this message help you? If so please reward the poster with Reputation Points? Reward Points
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
rullbandspelare
Pro Scripter


Joined: 23 Mar 2004
Posts: 80

Reputation: 100
Earn Points, Win a T-Shirt

PostPosted: Sun Oct 19, 2008 9:44 pm    Post subject: Reply with quote

Cool!
Thanks for the very helpful answer!

The URL in the example did not work. But this one does


I looked a bit in the forum but I am still not able to input/output variables from the VBscript.

This is what I would like to do. Input %IN% to the VBscript and output %OUT%

Did this message help you? If so please reward the poster with Reputation Points? Reward Points
Back to top
View user's profile Send private message
mtettmar
Site Admin


Joined: 19 Sep 2002
Posts: 4221
Location: Dorset, UK
Reputation: 621
votes: 28
Earn Points, Win a T-Shirt

PostPosted: Mon Oct 20, 2008 8:15 am    Post subject: Reply with quote

Make it a function. Pass the value into the function and set the function's result to the output:



And you may also want to remove those MsgBox lines and instead have the function return the error codes.
_________________
Regards,
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Please do not email/PM me for private support - post to the forum so that everyone benefits. For private support please send email via our web site.

Did this message help you? If so please reward the poster with Reputation Points? Reward Points
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
rullbandspelare
Pro Scripter


Joined: 23 Mar 2004
Posts: 80

Reputation: 100
Earn Points, Win a T-Shirt

PostPosted: Mon Oct 20, 2008 9:00 am    Post subject: Reply with quote

As always: Super fast support!
This support alone is worth the price of MachroScheduler

But....
The example is not working.

Compilation error Microsoft VBScript :1010
Identifier expected
Line 2, Column 21

Did this message help you? If so please reward the poster with Reputation Points? Reward Points
Back to top
View user's profile Send private message
mtettmar
Site Admin


Joined: 19 Sep 2002
Posts: 4221
Location: Dorset, UK
Reputation: 621
votes: 28
Earn Points, Win a T-Shirt

PostPosted: Mon Oct 20, 2008 9:41 am    Post subject: Reply with quote

Ah. IN is a reserved word. So we need to use a different variable name. Try:


_________________
Regards,
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Please do not email/PM me for private support - post to the forum so that everyone benefits. For private support please send email via our web site.

Did this message help you? If so please reward the poster with Reputation Points? Reward Points
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
mtettmar
Site Admin


Joined: 19 Sep 2002
Posts: 4221
Location: Dorset, UK
Reputation: 621
votes: 28
Earn Points, Win a T-Shirt

PostPosted: Wed Oct 22, 2008 1:57 pm    Post subject: Reply with quote

Just discovered that MSSOAP.SOAPClient does not work under Vista and is no longer supported by Microsoft. Instead you need to use the MsXml2.XMLHTTP and MsXml2.DOMDocument objects. It's a little more complicated, but once you've seen one example the next is easier. First construct the XML, then post it to the service, then parse the XML response:


_________________
Regards,
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Please do not email/PM me for private support - post to the forum so that everyone benefits. For private support please send email via our web site.

Did this message help you? If so please reward the poster with Reputation Points? Reward Points
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
rullbandspelare
Pro Scripter


Joined: 23 Mar 2004
Posts: 80

Reputation: 100
Earn Points, Win a T-Shirt

PostPosted: Fri Oct 24, 2008 11:19 pm    Post subject: Reply with quote

This last example worked best for my purposes.
Thanks!

I have one ,yeah.. sure Rolling Eyes , last question.

What if the result in the XML was presented like:
instead of
StripToNumericResult>string</StripToNumericResult>
as it is now

The objXml.selectNodes does not work then.

Did this message help you? If so please reward the poster with Reputation Points? Reward Points
Back to top
View user's profile Send private message
mtettmar
Site Admin


Joined: 19 Sep 2002
Posts: 4221
Location: Dorset, UK
Reputation: 621
votes: 28
Earn Points, Win a T-Shirt

PostPosted: Sat Oct 25, 2008 6:53 am    Post subject: Reply with quote

First, I'm not an XML expert so I may be wrong, but in your example Numbers and Characters are attributes not values. A function would return values. If a Soap function returned more than one it would do so like this:

<StripToNumericResult>
<Numbers>1234</Numbers>
<Characters>axdf</Characters>
</StripToNumericResult>
_________________
Regards,
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Please do not email/PM me for private support - post to the forum so that everyone benefits. For private support please send email via our web site.

Did this message help you? If so please reward the poster with Reputation Points? Reward Points
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
rullbandspelare
Pro Scripter


Joined: 23 Mar 2004
Posts: 80

Reputation: 100
Earn Points, Win a T-Shirt

PostPosted: Sat Oct 25, 2008 12:56 pm    Post subject: Reply with quote

I for sure am no XML expert either.
But in my case the returned result realy is presented in this way in the XML answer.
I have tried some variations like, objXml.getAttribute("value") ,to extract the "123456" from:
StripToNumericResult Numbers="123456" Characters="abcde" />

I am not very good at VB syntax and this i guess, is more of a XML VBscript issue than Machroscheduler issue

Did this message help you? If so please reward the poster with Reputation Points? Reward Points
Back to top
View user's profile Send private message
mtettmar
Site Admin


Joined: 19 Sep 2002
Posts: 4221
Location: Dorset, UK
Reputation: 621
votes: 28
Earn Points, Win a T-Shirt

PostPosted: Sun Oct 26, 2008 9:08 am    Post subject: Reply with quote

It's an MS XML thing. Need to check out the docs at microsoft.com ...

Here:
http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.attributes.aspx

So we can use the attributes property of the node. Something like:

xmlNode = objXml.selectSingleNode("//soap:Envelope/soap:Body/m:StripToNumericResponse/m:StripToNumericResult")

sNumbers = xmlNode.Attributes["Numbers"].Value
sChars = xmlNode.Attributes["Characters"].Value
_________________
Regards,
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Please do not email/PM me for private support - post to the forum so that everyone benefits. For private support please send email via our web site.

Did this message help you? If so please reward the poster with Reputation Points? Reward Points
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
rullbandspelare
Pro Scripter


Joined: 23 Mar 2004
Posts: 80

Reputation: 100
Earn Points, Win a T-Shirt

PostPosted: Tue Oct 28, 2008 7:14 pm    Post subject: Reply with quote

It did not work. Complaints of the [ and ] . canged to () wich gave some other errors.

Instead i dug it out of the complete XML answer:

Did this message help you? If so please reward the poster with Reputation Points? Reward Points
Back to top
View user's profile Send private message
Display posts from previous:    View previous topic :: View next topic  
Post new topic   Reply to topic    Macro Scheduler and Windows Automation Forum Index -> Technical / Scripting All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group