Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AccPac 5.4A ASP Webservice Session Issue 1

Status
Not open for further replies.

Arbello

Programmer
May 5, 2009
6
US
Hey all. I've been reading a lot of the posts, and I haven't found any that fit my situation perfectly.

Before you tell me not to use the webservices, know that I have run out of options for this particular integration and I /must/ use them. The situation is funky....

The problem is simple. I can call Get Organizations, and I can call Open Session. I just can't do anything with the token I receive. I receive the same message every time, no matter which method I call, and that is "Invalid Token - Error in Application."

Any ideas? The AccPac consultant hired by my client tells me that the webservices are unsupported by them... and are of no help. Thanks all!
 
Nobody (in their right mind) uses the web services, good luck.
 
Those are two of the most helpful replies I've ever seen. Are the webservices beyond your understanding? Or are you just leading me on a bit before you decide to be helpful?

I know the webservices suck, I am not arguing that point. I'm simply trying to get them to work... it's literally my last option at this point.

Based on your previous posts I can't imagine you're totally unfamiliar, you both appear to be experts and have helped a lot of people out. Throw me some love.

I have a feeling the System Manager module has not been installed. Would that affect webservices from working properly? How can I verify SM's deployment?

Thanks again!
 
Accpac's current web deployment model is a farce, and always has been. It's only use is for Sage's marketing department to say "Yeah, we're web-enabled". And since Sage is entirely rewriting their Web client, any work on the current product is a waste of time.
 
Test and verify that a) Accpac is installed and running on that server and b) Accpac web deployment has been setup and is actually running.
I have always found a way to not use web deployment, so sorry no other advice than that.
 
Thanks fellas. That verifies that I have performed my due diligence in getting these things working.

While I know I could write an app that calls the components on the server and lets my SOAP client talk to them, that's way out of budget for this project.

Thanks for the good luck wishes. ;)
 
You may have already tried this, but here it is anyway:

The Accpac Web service is not a stateless service. Opening a session requires a web (IIS) session to be created and persisted across web service calls. Even though you'd think the session token would be enough, that is not the case. The web session is implemented through cookie support and the default .Net support for web service calls does not implement cookie support.

Assuming you are using .Net as your client it is fairly simple to add cookie support. Just add a CookieContainer to the web service object. For example:

using WebServiceSample.AccWeb;
...
private AccWeb.ACCPACWebServiceSystemServices webServ;
...
webServ = new AccWeb.ACCPACWebServiceSystemServices ();
webServ.Url = _settings.WebService;
webServ.CookieContainer = new System.Net.CookieContainer ();


If you are using another client language you'll have to add cookie support yourself. It's usually not too hard. We did a project on Windows Mobile and we have to manage the cookies ourselves. Took about 10 lines of code.

Hope that helps,

Chris Zinck, P.Eng.
Zinck Computer Group
 
In your experience, would you see what I am seeing without the appropriate modifications? I ask because I have been asked to stop spending time on this issue, and I am unable to verify myself.

The second thing that may be problematic is that I will not be using any language to perform this integration. Instead I will be using SOAP consumers built by vendors with very little ability to customize - running on the assumption that SOAP should be SOAP, and work.

Thoughts?

Thank you for your very insightful response. I never would have thought that was the issue. Did you learn this from anything that Sage published? So far my searching has come up with absolutely zero documents explaining the peculiarities with the AccPac Webservice.
 
Actually, your issue is exactly what I would have expected without cookie support. It is what we struggled with the first time we used web services. Since the Accpac Session token is tied to the web service session, the first call to the opensession works, but the second call to the web service won't. This is because the Accpac session token was allocated in the first web session and the second call is actually starting a new web session (since it wasn't persisted through the cookie). Hence Accpac says it is an invalid token since the new web session doesn't know anything about the token that was allocated in the previous web session.

Since pure SOAP is a stateless protocol, you may not be able to get web session support with your tools. If the operation you are trying to do can be expressed in a single call, you could implement a web service of your own that calls Accpac, opens a session, does the operation and closes the session. We implemented something similar to this for a client that wanted to update a customer through one web service call.

If you can't implement your own web service and you are stuck with a tool that doesn't support an open web session, then you probably can't use web services. The base Accpac Web service definitely needs session support.

The only other thing you could try is changing IIS to use a different method to implement web sessions. By default it's set to use cookies and I think you can use URL support instead. I haven't tried this before, but it might be worth a look.

Hope that helps,
Chris Zinck, P.Eng.
Zinck Computer Group
 
Chris,

Thanks again. I was able to build consumers in ColdFusion and .Net, and both work as soon as I turn on session persistence. Unfortunately neither of these languages are tools the client has purchased. I even played with SQL session management, and URI session management in IIS. This pretty much borked everything. I'm going to play with a lightweight local .Net interpreter that will handle my sessions for me, and allow 'pure' SOAP communication. I'll report back with what we find.

 
Chris,

I was able to get this hobbling along with a proxy I wrote in C#. I've consolidated a lot of the AccPac methods into methods in my new webservice. I have achieved communication. Now it's just a matter of inserting records. Would you happen to have a good source for documentation? I'll eventually be able to get it working after building several VBA macros and deconstructing their code, but I would love to see some docs.

Thanks again! We're on the road to success.
 
Unfortunately, the only documentation I know of is the web service help file that comes with the System Manager.

Glad to hear you are making progress.

TTYL,
Chris Zinck, P.Eng.
Zinck Computer Group
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top