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!
 External Development Forums - General External Development
Forum to discuss general external development topic (related or not to SalesLogix development). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to General External Development | New ThreadView:  Search:  
 Author  Thread: webservice failure for REMOTE but not NETWORK
joe
Posts: 26
 
webservice failure for REMOTE but not NETWORKYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Feb 09 2:31 PM
My webservice keeps failing for my remote users with any error.
I have no way to test as a remote user so I am at a loss.



Does anyone know of any differences between the two I need to be aware of. I will post my code seperatly.
[Reply][Quote]
joe
Posts: 26
 
Re: webservice failure for REMOTE but not NETWORKYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Feb 09 2:35 PM

It works for Network users, but not remotes.

sub HandleStateChange
dim sReturn
if (oXMLHTTP.readyState = 4) then
dim szResponse: szResponse = oXMLHTTP.responseText
call oXMLDoc.loadXML(szResponse)
if (oXMLDoc.parseError.errorCode = -1072896680) then
sError ="Project number will be retreived next time you synch. Unable to connect to webservice\internet. "
elseif (oXMLDoc.parseError.errorCode <> 0) then
sError = "Project Number will be retreived next time you synch" & oXMLDoc.parseError.reason & oXMLDoc.parseError.errorCode
else
sReturn = oXMLDoc.text
if(Instr(sReturn, "succesfully"))then
call msgbox(sReturn)'Tell them that it was succesfully created.
else
sError = "Project number will be retreived next time you synch. " & "Web Service: " & sReturn
end if
end if
end if
End Sub

Sub CreateIPS
dim opportunityID
dim connDb
dim sprocType '1 = new 2 = update only new from slx update is for the server
dim env '0 = PROD 1 = DEV
dim createdUserId
dim p




opportunityID = Application.BasicFunctions.CurrentOpportunityID
sprocType = 1

createdUserId = trim(Application.BasicFunctions.CurrentUserID)




connDb = "ServerSLX"

set oXMLDoc = CreateObject("Msxml2.DOMDocument")
set oXMLHTTP = CreateObject("Msxml2.XMLHTTP.3.0")
oXMLHTTP.onreadystatechange = getRef("HandleStateChange")

env = 0 'PROD
call oXMLHTTP.open("POST", "http://webap.amcs.tld/SLXWebService/SLXService.asmx/SingleOpportunityTransferUpdateIPS", false)'PROD

call oXMLHTTP.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
p ="opportunityID=" & opportunityID &"&connDb=" & connDb + "&sprocType=" & sprocType & "&env=" & env & "&createdUserId=" & createdUserId

call oXMLHTTP.send(p)

end sub
[Reply][Quote]
Timmus Agersea
Posts: 328
 
Re: webservice failure for REMOTE but not NETWORKYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Feb 09 3:04 PM
Joe,

I am unable to hit "http://webap.amcs.tld/SLXWebService/SLXService.asmx" with a browser. Could it be that the users must be on the domain to hit the web service? Have you asked them to VPN into the domain and try the feature?

Timmus
[Reply][Quote]
joe
Posts: 26
 
Re: webservice failure for REMOTE but not NETWORKYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Feb 09 3:07 PM
yes they must vpn or be a remote user at a different office.

I pass this conn string to my webservice to call back to the slx database to gather information.

connDb = Application.GetNewConnection()
pos = InStr(1, connDb, "Extended Properties")
connDb = Left(connDb, pos-1)
pos2 = InstrRev(connDb,"Password=")
connDb = Mid(connDb,pos2)
connDb = "Provider=SLXOLEDB.1;" & connDb
[Reply][Quote]
joe
Posts: 26
 
Re: webservice failure for REMOTE but not NETWORKYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Feb 09 3:11 PM
The conn looks like this in the end. The questions marks are obviously different.

Provider=SLXOLEDB.1assword=????ersist Security Info=True;User ID=sysdba;Initial Catalog=SALESLOGIX;Data Source=US3GRRP576A;
[Reply][Quote]
Timmus Agersea
Posts: 328
 
Re: webservice failure for REMOTE but not NETWORKYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Feb 09 3:31 PM
I am not sure what exactly your parsing code does, but you cannot pass the remote database's connection string to your webservice as your webservice likely needs to connect to a database local to it. The remote database connection string would therefore fail.

Here is how I manage connections for applications that are not managed by SalesLogix:

I add a connection to the config file, web.config for example, and I configure it with the SalesLogix admin user and password. Then in all of my webservices I have a parameter for the usercode. Usercode is the login which you can get from

Application.Users.Item(Application.BasicFunctions.CurrentUserID).Code

The following C# shows how to use impersonation to ensure the current user can only issue statements within their security context:


System.Data.Common.DbConnectionStringBuilder csb = new System.Data.Common.DbConnectionStringBuilder();
csb.ConnectionString = ConfigurationManager.ConnectionStrings["SalesLogix"].ConnectionString.ToString();
csb["impersonate"] = "cathy";
SqlDataSource1.ConnectionString = csb.ConnectionString;


Hope this helps!

Timmus
[Reply][Quote]
joe
Posts: 26
 
Re: webservice failure for REMOTE but not NETWORKYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Feb 09 3:35 PM
Many thanks. I will try that logic on Monday.
[Reply][Quote]
joe
Posts: 26
 
Re: webservice failure for REMOTE but not NETWORKYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Feb 09 2:15 PM
My solution

http://www.egilh.com/blog/archive/2005/08/04/1217.aspx
[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:00:57 PM