Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, November 22, 2024 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - SalesLogix .NET Extensions
Forum to discuss the use of .NET Extensions in SalesLogix version 7 and higher. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix .NET Extensions | New ThreadView:  Search:  
 Author  Thread: Consuming Webservice in Saleslogix 6.2
Gus
Posts: 18
 
Consuming Webservice in Saleslogix 6.2Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Jan 07 4:34 PM
fiogf49gjkf0d
Hi

Is it possible to consume web services in saleslogix application ?

Thanks

[Reply][Quote]
Timmus Agersea
Posts: 328
 
Re: Consuming Webservice in Saleslogix 6.2Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Jan 07 4:43 PM
fiogf49gjkf0d
Here is a javascript example that we use in the web client. It uses the msxml object which you should be able to use from vbscript (the lan client) as well. Hopefully the object names and the members used will get you enough info so you can find your way. I would not say it is "tutorial" code but I am swamped and dont have time to polish it.


var oXMLDoc;
var oXMLHTTP = false;
var lRowCount;
var lRowIndex;

try {
oXMLDoc = new ActiveXObject("Msxml2.DOMDocument");
} catch (d) {

}

if (oXMLDoc == null) {
alert("Unable to create DOM document!");
return(false);
}

try {
oXMLHTTP = new ActiveXObject("Msxml2.XMLHTTP.3.0");
} catch (e) {
try {
oXMLHTTP = new ActiveXObject("Msxml2.XMLHTTP");
} catch (E) {
oXMLHTTP = false;
}
}
if (!oXMLHTTP) { alert('Unable to make http request.'); return(false); }

// Set up the post
oXMLHTTP.onreadystatechange = function() {
// a readyState of 4 means we're ready to use the data returned by oXMLHTTP
if (oXMLHTTP.readyState == 4) {
// get the return envelope
var szResponse = oXMLHTTP.responseText;

// load the return into an XML data island
oXMLDoc.loadXML(szResponse);

if (oXMLDoc.parseError.errorCode != 0) {
var xmlErr = oXMLDoc.parseError;
alert("You have error " + xmlErr.reason);
} else {
// Process Data
lRowCount = oXMLDoc.getElementsByTagName("LookupResults").length;
var sPostal;
var sCity;
var sState;
var sCountry;
if (lRowCount == 0) {
// Do Nothing - should we notify the user?
} else if (lRowCount == 1) {
sPostal = oXMLDoc.getElementsByTagName("LookupResults")(0).childNodes(0).text;
sOriginalPostal = sPostal;
sCity = oXMLDoc.getElementsByTagName("LookupResults")(0).childNodes(1).text;
sState = oXMLDoc.getElementsByTagName("LookupResults")(0).childNodes(2).text;
sCountry = oXMLDoc.getElementsByTagName("LookupResults")(0).childNodes(3).text;
setPostalCityState(sPostal, sCity, sState, sCountry, postalElement, cityElement, stateElement, countryElement);
} else {

for (lRowIndex = 0; lRowIndex < lRowCount; lRowIndex++) {
sPostal = oXMLDoc.getElementsByTagName("LookupResults")(lRowIndex).childNodes(0).text;
sCity = oXMLDoc.getElementsByTagName("LookupResults")(lRowIndex).childNodes(1).text;
sState = oXMLDoc.getElementsByTagName("LookupResults")(lRowIndex).childNodes(2).text;
sCountry = oXMLDoc.getElementsByTagName("LookupResults")(lRowIndex).childNodes(3).text;
}
}
}
}
}

// send the POST to the Web service
oXMLHTTP.open("POST", "https://webserver.com:925/AddressFunctions/AddressFunctions.asmx/GetPostalCityState", false);
oXMLHTTP.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
oXMLHTTP.send("PostalCode=" + postalCode);
}


Timmus
[Reply][Quote]
Gus
Posts: 18
 
Re: Consuming Webservice in Saleslogix 6.2Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Jan 07 5:11 PM
fiogf49gjkf0d
Thanks a lot Timmus, I'll try it.

Gus
[Reply][Quote]
Jason Huber
Posts: 77
 
Re: Consuming Webservice in Saleslogix 6.2Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 14 Jan 07 9:03 AM
fiogf49gjkf0d
I like the simple MSSOAPClient object (when in ASP Script)

set c = CreateObject("MSSOAP.SOAPClient")
c.mssoapinit("http://loca lhost/MYSoapApp/MYSoapApp.Calc.soap?WSDL")
for i = 1 to 10
WScript.Echo i & " " & c.Add(i,i) & " " & Time
next

(sample taken from web)
[Reply][Quote]
Gus
Posts: 18
 
Re: Consuming Webservice in Saleslogix 6.2Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Feb 07 2:29 PM
fiogf49gjkf0d
Jason,

I used your suggestion above to get data from a web service. Now, to make a method call, I need to send a variable of complex type,
like an object with a string and 2 ints to the webservice. How would you declare the variable in saleslogix ?


Thanks

Gus
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Consuming Webservice in Saleslogix 6.2Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Feb 07 3:16 PM
fiogf49gjkf0d
There's not exactly support per se for passing complex types to a web service in VBScript. However, there's some ways to sort of mimick a complex type. Basically, when you pass a complex type to a web service, it is serialized to XML in a SOAP envelope. You can construct the XML/envelope yourself and pass that along to the web service.

Click here for a sample in a MS newsgroup

Make sense?
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 11/22/2024 3:51:03 PM