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!
|
|
webservice failure for REMOTE but not NETWORK
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. |
|
|
|
Re: webservice failure for REMOTE but not NETWORK
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 |
|
|
|
Re: webservice failure for REMOTE but not NETWORK
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 |
|
|
|
Re: webservice failure for REMOTE but not NETWORK
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 |
|
|
|
Re: webservice failure for REMOTE but not NETWORK
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; |
|
|
|
Re: webservice failure for REMOTE but not NETWORK
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 |
|
|
| |
| |
|