Web services in AbleCommerce 7.0

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
jenn13
Ensign (ENS)
Ensign (ENS)
Posts: 7
Joined: Thu Apr 09, 2009 12:53 pm

Web services in AbleCommerce 7.0

Post by jenn13 » Fri Sep 18, 2009 12:47 pm

We need to take a text file from an external source and use the data in it to create/update users in our AbleCommerce site. Part of this solution is to be a web service that will call the user creation and updating code from CommerceBuilder with the appropriate parameters.
I've created a web service project in the same solution with the project containing the AbleCommerce code, and wrote a test method to check that I can actually call the CommerceBuilder code from my web service:

Code: Select all

[WebMethod]
public string CountUsers()
{
      try
       {
            int count = UserDataSource.CountForStore();
            return count.ToString();
       }
       catch (Exception ex)
       {
            return ex.Message;
       }
}
When I invoke the method, I get the following exception:

"AbleCommerceHttpModule does not appear to be configured."

I'm not sure what I'm doing wrong here, whether it's an issue with my use of web services (this is really the first time I've ever tried to make one), or something I need to do with the AbleCommerce code. Any ideas how I can solve this?

jenn13
Ensign (ENS)
Ensign (ENS)
Posts: 7
Joined: Thu Apr 09, 2009 12:53 pm

Re: Web services in AbleCommerce 7.0

Post by jenn13 » Fri Sep 18, 2009 2:07 pm

It appears I have found my own solution: creating the web service in the original project rather than a new project in the solution.

User avatar
Logan Rhodehamel
Developer
Developer
Posts: 4116
Joined: Wed Dec 10, 2003 5:26 pm

Re: Web services in AbleCommerce 7.0

Post by Logan Rhodehamel » Fri Sep 18, 2009 4:09 pm

You have found the appropriate solution. I think it's been discussed here a few times. The AbleCommerceHttpModule is responsible for initializing the token, connections, etc. This is all within the root web.config of the AbleCommerce installation. So just create the service somewhere within the AbleCommerce installation directory - which is what you discovered.
Cheers,
Logan
Image.com

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.

Post Reply