Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, November 25, 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!
 Web Forums - ASP/ASP.NET/Web Services/Other
Forum to discuss building external web applications for SalesLogix. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to ASP/ASP.NET/Web Services/Other | New ThreadView:  Search:  
 Author  Thread: Re: Calling a webservice from SLX LAN client
Timmus Agersea
Posts: 328
 
Re: Calling a webservice from SLX LAN clientYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Apr 08 3:57 PM
Ensure you have declared the variables outside of any of your routines. They need to be "global". Check out my examples above and you will see they are declared before any of the control events. Make sense?

Timmus
[Reply][Quote]
Steve Knowles
Posts: 657
Top 10 forum poster: 657 posts
 
Re: Calling a webservice from SLX LAN clientYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Apr 08 8:28 AM
I am calling a webservice. Works on my dev machine, but when I move it to production I am getting this in the event viewer:
Exception message: Request format is unrecognized for URL unexpectedly ending in '/GetProjNumber'.
Request information:
Request URL: https://XXXXXXXXX:443/GetProjectNumber/Service.asmx/GetProjNumber

In my code I am calling like:
call oXMLHTTP.open("POST", "https://xxxxxx/GetProjectNumber/Service.asmx/GetProjNumber", false)

If I type this into a browser it returns the test page of the web service fine:
https://XXXXXXXXX/GetProjectNumber/Service.asmx?op=GetProjNumber

If I use this URL to my dev server it returns the results fine also:
http://localhost/GetProjectNumber/Service.asmx/GetProjNumber

Any thoughts?
[Reply][Quote]
Timmus Agersea
Posts: 328
 
Re: Calling a webservice from SLX LAN clientYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Apr 08 4:01 PM
I found the following at http://forums.asp.net/t/988377.aspx :

"i found the solution. i put the following in my web.config
[webServices]
[protocols]
[add name="HttpGet"/]
[add name="HttpPost"/]
[/protocols]
[/webServices]"

Timmus
[Reply][Quote]
Steve Knowles
Posts: 657
Top 10 forum poster: 657 posts
 
Re: Calling a webservice from SLX LAN clientYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Apr 08 6:43 PM
That did it. Thanks Timmus.
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Calling a webservice from SLX LAN clientYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Apr 09 11:43 PM
Well, I am coming pretty late to this discussion, so my apologies.
I have been so busy lately working at times over 16 hours a day... But that is not the point.

An alternative, and somewhat simpler, is to use the Soap Client object provided with SalesLogix (although you may need to use a Form to instantiate it).

This is how I did this (on SLX 6.2 Windows client), still functioning on SLX 7.5:

- On my Form, added a Soap Client Object.
- Configured the WSDLFile property to the URL of the Web Service (this was a .NET web service. E.g.: http://MyServer/MyWebService/Auth.asmx?wsdl
- Generated my XML payload (this is the same as when using the XMLTHHP Object
- Retreiving the SOAP Remote object and calling its methods:

e.g.:
' SOAP Client object is named "sp"
' ServiceName = "Auth"
' Service exposes a single method:
' - ImportCustomerFromXML
' Input: XML String
' Output: Error Message. If no error has ocurred it returns a blank string


Dim remoteObject

Set remoteObject = sp.RemoteObject
strRes = remoteObject.ImportCustomerFromXML(strXML) 'Invoke Method on Web Service

'If Response isn't blank, it contains an Error Message.
If strRes <> "" then
MsgBox strRes
End If
Set remoteObject = Nothing


The advantage of using the SOAP object is that I don't have to worry about building the code to invoke the Web Service and its methods.
I can call the Methods directly against my local reference to the Remote Object.

Now, I cannot guarantee that this will work for everyone's situation, but it certainly worked for me 4 years ago and it sill working.
[Reply][Quote]
Leon Gort
Posts: 127
 
Re: Calling a webservice from SLX LAN clientYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Apr 09 1:23 AM
Hi Raul,

Do you think the above method would work for the sharepoint web service below? (creates folders within SharePoint document library)

http://servername/_vti_bin/dws.asmx?op=CreateFolder

*****************
SOAP 1.2
The following is a sample SOAP 1.2 request and response. The placeholders shown need to be replaced with actual values.

POST /_vti_bin/dws.asmx HTTP/1.1
Host: portal
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length





string


[Reply][Quote]
Leon Gort
Posts: 127
 
Re: Calling a webservice from SLX LAN clientYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Nov 09 8:52 PM
Hi,

I've tried the code from Timmus to call a web service with paramaters that returns a single value but I continue to get "A string literal was expected but no opening quote character was found" Is there something I am missing or should be looking for? I have a custom web service for SharePoint but even trying the "Add" web service posted previously give me the same error.

thx in advance for any assistance.

Leon
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Calling a webservice from SLX LAN clientYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Nov 09 9:12 PM
That seems to be an issue with Quotes.

By any chance, are you dealing with Data that contains quotes on it? E.g. O'Donnell
Also, if you are building code with embedded quotes on it, maybe there is a place where something is being missed.

Again, focus on the strings that you are building, make sure that you escape / encode any characters as needed. And, for the time being, test with data that doesn't have quotes within it.
[Reply][Quote]
Leon Gort
Posts: 127
 
Re: Calling a webservice from SLX LAN clientYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Nov 09 9:24 PM
Thx Raul. I'm not dealing with any quotes at all at the moment. I'm hard coding the .Send() parameter to make sure I'm not passing any incorrect variables but no success. Below is my code for the custom web service (which was created by an external web developer) I'm getting the same error from out-of-the-box SharePoint web services though.

'******************
Dim oXMLDoc
Dim oXMLHTTP

Sub CreateSharepointFolder( strsite , strpath , strlistname, strsubfolders , strfoldername)

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

oXMLHTTP.onreadystatechange = getRef("HandleStateChange")

call oXMLHTTP.open("POST", "http://portal/_vti_bin/efic.asmx/CreateFolder", false)

call oXMLHTTP.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")

call oXMLHTTP.send("sitecollection=http://portal/&web=dept/lel&listname=Matters&subfolders=http://portal/dept/lel/Matters/2009&foldername=TestfolderLeon")

end sub

Sub HandleStateChange
dim sResult

if (oXMLHTTP.readyState = 4) then
dim szResponse: szResponse = oXMLHTTP.responseText

call oXMLDoc.loadXML(szResponse)
if (oXMLDoc.parseError.errorCode <> 0) then
call msgbox (oXMLDoc.parseError.reason)
else

call msgbox(oXMLDoc.getElementsByTagName("string")(0).childNodes(0).text)

end if
end if
End Sub
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Calling a webservice from SLX LAN clientYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Nov 09 9:50 PM
Does this code works fine if you run it outside SLX (paste it onto a text file and rename it to .vbs)?

Also, is SLX the one giving you the error regarding the quotes? If so, where is it failing? What line is it pointing to?

I would suggest you put up a Message box with the content of szResponse. The error message you are getting could be coming from your own code where it is displaying the Parser Error.
[Reply][Quote]
Leon Gort
Posts: 127
 
Re: Calling a webservice from SLX LAN clientYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Nov 09 8:10 PM
Hi Raul,

I still get an error when running it as a vbs file so I'm presuming there is something wrong with the web service using http post? It does work using the test form on the web page. I'll go back to the web developer and see what he says about running it in a vbs file.

Should I look at using your SOAP client? If so, do you have some code example I could look at?

Thx again.
Leon
[Reply][Quote]
Leon Gort
Posts: 127
 
Re: Calling a webservice from SLX LAN clientYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Nov 09 8:50 PM
Further info - running the code in a vbs file on the actual web server works so I presume if I installed the SLX client on the web server it should work also. However, why would it not run on the clients?

Thx in advance.
Leon
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Calling a webservice from SLX LAN clientYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Nov 09 2:35 AM
Did you ever figure out what the content of the response was? Was the error coming from the response?

Again, I would suggest that you Save the response out to file.
Then you should be able to read it and tell what the difference is.

If you are getting the data from both places, then you may want to compare the results to make sure that they match.
If the results do match on both the server and the remote machine, then you may have issues with other components (such as the XML version installed, etc).
[Reply][Quote]
Leon Gort
Posts: 127
 
Re: Calling a webservice from SLX LAN clientYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Dec 09 4:18 PM
Problem was resolved. Initially we tried to deploy the web service through SharePoint (MOSS 2007) however, this doesn't work using the http post method. Instead a seperate web site and application pool was added to the web server and the DLL was added to the assembly.

The client issue was resolved by adding the web.config to the new website - which is mentioned above - that adds the httpget and httppost protocols.

Thx for your help. The VBS file help me to convince the external developer that it wasn't SLX related!!

Cheers,
Leon
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Calling a webservice from SLX LAN clientYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Dec 09 8:38 PM
Well, glad to know that you were able to work it out.
[Reply][Quote]
 Page 2 of 2<< < Previous 
  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/25/2024 8:12:29 PM