KonaKart Community Forum

General Category => KonaKart WebSite & Demonstrations => Topic started by: jbarb on March 26, 2008, 11:43:33 pm

Title: Startng and using soap interface with openlaszlo
Post by: jbarb on March 26, 2008, 11:43:33 pm
Here is what I get when I try to get the soap interface started.


"C:\Program Files\KonaKart\java_soap_examples>ant
Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre1.6.
0_03\lib\tools.jar
Buildfile: build.xml" It ends up telling me the Build Failed.

I know it is something simple I am overlooking. If ant cannot find this "tools.jar"
then it must not be in that folder or it is improperly named??? Where would it be? I am trying use Open laszlo for my front end.

Thanks,
James Barber
Title: Re: Startng and using soap interface with openlaszlo
Post by: kate on March 27, 2008, 05:54:54 am
Hi James,

Yes you need a tools.jar for ant..

Perhaps the best way is to install a JDK (rather than your JRE) because that will have one under the lib directory.

Regards,
Kate
Title: Re: Startng and using soap interface with openlaszlo
Post by: jbarb on March 27, 2008, 06:57:25 pm
Hi Kate,

Thanks for your reply.

I have both jdk1.6.0_03 and jre and                                                   C:\Program files\KonaKart\java_soap_examples> still can't find it (tools.jar.)

Also the "ant-p" syntax doesn't work with this path, only "ant" alone.
Why is tools.jar not in either of the java folders? Is it possible for it to be excluded during download? Should I try and remove it (Jdk/jre1.6.0_03) and reinstall it, or will that cause other problems?

Also, do I need to load all the particulars regarding my products, e.g. name, description, price, image etc. into my MYSQLserver tables before KonaKart or openLaszlo single page shopping cart will function?

Thanks,

James Barber
Title: Re: Startng and using soap interface with openlaszlo
Post by: kate on March 28, 2008, 08:20:36 am
Hi James,

tools.jar is included with a JDK, but not with a JRE.   You should find it in your JDK installation.

When you run ant are you sure you're using the JDK and not the JRE?

Check your path and your JAVA_HOME.


QuoteAlso the "ant-p" syntax doesn't work with this path, only "ant" alone.

Not sure what you mean by that but you do need a space between "ant" and the "-p"


QuoteAlso, do I need to load all the particulars regarding my products, e.g. name, description, price, image etc. into my MYSQLserver tables before KonaKart or openLaszlo single page shopping cart will function?

I don't really understand your question.  The default installation loads some dummy categories and products for you to see how the application works.   You should use the KonaKart Admin App to change the catalog.

Regards
Kate
Title: Re: Startng and using soap interface with openlaszlo
Post by: jbarb on March 30, 2008, 02:54:46 am
How do I set the ANT_HOME environment. Everything I have tried has resulted in ant not starting because it is not set correctly. Ant is installed and in the correct folder, Program Files/KonaKart/custom/bin. What is the syntax for setting ant correctly and the path?

James Barber
Title: Re: Startng and using soap interface with openlaszlo
Post by: kate on March 30, 2008, 06:12:38 am
Hi James,

You can set ANT_HOME as an environment variable or call ant directly, as in many of the examples - eg..

..\custom\bin\ant -p

Kate
Title: Re: Startng and using soap interface with openlaszlo
Post by: jbarb on March 30, 2008, 11:32:31 pm
This is what I get when I set paths and then try to start ant. I installed ANT 1.7.0, in C:\ Program Files\KonaKart\custom\bin\apache-ant-1.7.0\bin
I can set the path and it seems to work but it still cannot find the tools.jar and it still keeps looking in the jre for it even though I set the path for the jdk.



C:\Program Files\KonaKart\custom\bin\apache-ant-1.7.0\bin>set JAVA_HOME=jdk1.6.0_05

C:\Program Files\KonaKart\custom\bin\apache-ant-1.7.0\bin>Path=C:\jdk1.6.0_05\bin;C:\WINDOWS\system32;C:\WINDOWS

C:\Program Files\KonaKart\custom\bin\apache-ant-1.7.0\bin>Path=C:\jdk1.6.0_05\bin;C:\WIndows\system32;C:\WINDOWS;C:\Program Files\KonaKart\custom\bin\apache-ant1.7.0\bin

C:\Program Files\KonaKart\custom\bin\apache-ant-1.7.0\bin>ant
Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre1.6.
0_05\lib\tools.jar Buildfile: build.xml does not exist!
Build failed

C:\Program Files\KonaKart\custom\bin\apache-ant-1.7.0\bin>cd C:\Program Files\KonaKart\java_soap_examples

2,300]C:\Program Files\KonaKart\java_soap_examples>ant
'ant' is not recognized as an internal or external command,
operable program or batch file./color]

C:\Program Files\KonaKart\java_soap_examples>

It seems that the path for ant doesn't exist. I have tried setting it as per the examples on the KonaKart site but to no avail.

I have installed Openlaszlo 3.3.3 dev installation and it has all the soaps for the Amazon single page shopping cart I want to install. Is there any other way to make this work besides using ant?

Jim Barber
Title: Re: Startng and using soap interface with openlaszlo
Post by: kate on March 31, 2008, 05:49:18 am
Hi,

It wasn't necessary to install ant because a cut-down ant installation is supplied in the download kit - but anyway, it won't hurt.

Your setting of JAVA_HOME looks suspicious.

Once you've defined that correctly, why don't you follow the examples, as I suggested below, and use:

..\custom\bin\ant

Kate
Title: Re: Startng and using soap interface with openlaszlo
Post by: jbarb on March 31, 2008, 10:47:17 pm
Kate,
Here is what I get when I try to find out if "JAVA_HOME" is set correctly.(BELOW)
I believe you are correct in that JAVA_HOME is suspicious. I cannot find out where it is or how to set it. This is probably the reason ant keeps looking for tools.jar in the JRE instead of the JDK. JDK is installed but I installed a later version of both JRE and JDK and they installed separately. THis is what I downloaded and installed: jdk-6u5-windows-i586-p from Sun Micro. Should I uninstall it and maybe go with the earlier version or is there a way to establish JAVA_HOME globally using this later java version?


C:\>cd C:\Program Files\KonaKart\Java_soap_examples

C:\Program Files\KonaKart\java_soap_examples>JAVA_HOME=C:\jdk1.6.0_05

'JAVA_HOME' is not recognized as an internal or external command,
operable program or batch file.

C:\Program Files\KonaKart\java_soap_examples>set JAVA_HOME=C:\jdk1.6.0_05

C:\Program Files\KonaKart\java_soap_examples>JAVA_HOME=C:\jdk1.6.0_05
'JAVA_HOME' is not recognized as an internal or external command,
operable program or batch file.

C:\Program Files\KonaKart\java_soap_examples>JAVA_HOME=C:\Program Files\java\jdk
1.6.0_05
'JAVA_HOME' is not recognized as an internal or external command,
operable program or batch file.

C:\Program Files\KonaKart\java_soap_examples>set JAVA_HOME=C:\Program Files\java
\jdk1.6.0_05

C:\Program Files\KonaKart\java_soap_examples>JAVA_HOME=C:\Program Files\java\jdk
1.6.0_05
'JAVA_HOME' is not recognized as an internal or external command,
operable program or batch file.

C:\Program Files\KonaKart\java_soap_examples>

Thanks,

Jim Barber
Title: Re: Startng and using soap interface with openlaszlo
Post by: kate on April 01, 2008, 05:51:37 am
Jim,

The syntax is:

SET JAVA_HOME=C:\jdk1.5.0_07

You could also set it globally in your environment using the Windows operating system tools for setting environment variables.

Kate
Title: Re: Startng and using soap interface with openlaszlo
Post by: jbarb on April 02, 2008, 03:26:14 am
Kate,

Thanks for your help.

I really should not have installed apache ant 1.7.0 as I now realize I installed it incorrectly. It is in conflict with the ant package included with KonaKart.
The instructions said ( I thought) to install it in the bin folder in the path with the jdk. This is obviously wrong. I must uninstall ant but I cannot find an uninstall tool anywhere in the package. It is a zip file and you just extract to a folder. There is no install after the extract.

At any rate I need to uninstall or remove two separate extraction/installs of apache ant 1.7.0. One in the KonaKart folder and another in my Document and Settings folder. I extracted the apache ant files to the documents and settings when I thought there was an installation procedure after the files extract. I can't delete the files as they are write protected and access is denied. How can I change the permissions on these
files and folders in order to delete them? I tried changing them from read only to archive but that didn't work.

Thanks, Jim Barber
.
Title: Re: Startng and using soap interface with openlaszlo
Post by: kate on April 02, 2008, 06:01:43 am
Hi Jim,

Can't you uncheck the read-only attribute and delete those files normally?  Haven't you got Administrator privileges?

In any event, it shouldn't matter that you have ant installed there, although it wouldn't have been my chosen location for it.  There is no reason for it to conflict with the cut down ant provided in KonaKart.

Kate

Title: Re: Startng and using soap interface with openlaszlo
Post by: jbarb on April 02, 2008, 03:06:32 pm
Thanks Kate,

Yes I have admin privileges I probably just need to invoke them. I am relieved to know that apache ant 1.7.0 should not interfere with the original KonaKart ant but I had better read more regarding install of apache ant.

My biggest headache is establishing ANT_HOME and JAVA_HOME. I just haven't been able to establish the proper path for either.
This is the path for the Apache Ant:                                                                                               
"C:\Program files\KonaKart\custom\bin\apache-ant-1.7.0\bin"
therin may lie the problem.
The KonaKart ant is the other bin just before the "apache ant 1.7.0"

My java is: "C:\Program Files\Java\jdk1.6.0_05\bin"

I see the KonaKart site says to set the path at C:\jdk1.6.0_05,  How is that possible when jdk1.6.0_05 is not installed on the root "C:\"? The same in the Kona Kart installation examples where it asks for you to show where your JRE is installed and the example shows C:\jdk1.5(vers)?
During KonaKart Installation I specified my JRE location as the installed location: e.g. "C:\Program Files\Java\jdk1.6.0_05

In the jdk1.6.0_05 folder is a zip file that is 18.5 mb. I was hesitant about unzipping it and have not up to now. Could this be where "tools.jar" is residing? According to Sun Microsystem's download site, "tools.jar is in the "lib" folder but the "lib" folder is empty presently. Is it wise to unzip the folder when you do not know the destination of the files?

The question then remains, how do establish ANT_ HOME (either version) and
JAVA_HOME, either globally or the command screen temporary way? That seems to be the major problem. But until I have these other questions resolved I won't know if that is the underlying problem(s) interfering with making this thing work.

Thanks,

Jim Barber
Title: Re: Startng and using soap interface with openlaszlo
Post by: kate on April 02, 2008, 05:20:20 pm
Hi Jim,

I suggest you read up on setting up java and ANT for development.  These really are basic pre-requisites for much greater challenges ahead, for example when you try to code using openLaszlo.

You set your JAVA_HOME to where your own java DK is.   Our FAQ just provides an example - but since you can put your java anywhere you like you have to point your JAVA_HOME at where you put it!

FYI my jdk lib directory contains a tools.jar

Regards,

Kate
Title: Re: Startng and using soap interface with openlaszlo
Post by: jbarb on April 09, 2008, 01:48:47 am
  Kate,
Thanks for your help. I am reading all I can find on apache ant and java. It is still a little confusing but I am learning.

Beside problems with ant, I think I just created another one.
I noticed that my version of KonaKart  2.2.1.0. is not the latest version on the KonaKart site, 2.2.4.0. So I decided to upgrade since my jre/jdk and mysql were up to date versions. I also hoped that it would solve some of my build problems. Well here is the message I get when it opens up KonaKart Admin subsequent to the install.
 
Welcome to the KonaKart Admin Application
   
Login

Username: 
Password: 
Login Cancel
 
There has been a problem....
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 'konakart.kk_customer_group' doesn't exist


I first uninstalled the old version and reinstalled 2.2.4.0 without updating the old database, got the same error message. Uninstalled new version, reinstalled old version and the old version worked fine.

I then tried to reinstall 2.2.4.0 and check the box that allows the db to upgrade (upgrade was successful)and all indications were that it was a good install, except I got the same error message. Can I go into MYSQL and add this missing table? I should not be much of a problem to add this table (if that is the correct syntax) is that also a field? but I am concerned about creating more unintended consequences.

Thanks,

Jim B
Title: Re: Startng and using soap interface with openlaszlo
Post by: kate on April 09, 2008, 05:56:54 am
Hi,

If the table isn't there, the installation did not complete sucessfully.

Therefore, uninstall whichever version of KonaKart you have installed.  If you have no data that you need to save, the easiest way is to scrap your old schema and create a new one for your new version.  (If you have a product catalog, and other data, in your KonaKart database that you need to keep, you will need to perform a database upgrade after the installation - scripts are provided to upgrade the database from one version of KonaKart to another).

Then run the installation.  After the database tables are loaded during the installation you should be able to run the application without problems. 

Kate
Title: Re: Startng and using soap interface with openlaszlo
Post by: jbarb on April 15, 2008, 10:46:21 pm
Hi Kate,

Check this out.

I have everything installed and working correctly. The Kona Kart upgrade was easier than I thought. I just deleted the old database configuration and the new KonaKart version built a new one.

Having said that, I have arrived at a new juncture. According to the response to ANT below, my "BUILD WAS SUCCESSFUL" but now I find I have run out of instructions to proceed with the soap calls.

What is the next step in making these soap calls to Open Laszlo for the one page catalog shopper?

Could you please check this script response and see if there is anything out of order?

C:\Program Files\KonaKart\java_soap_examples>ant
Buildfile: build.xml

clean:
     [echo] Cleanup...

axis_client_generation:
     [echo] Create the KonaKart client stubs from the WSDL

compile:
     [echo] Compile the examples
    [mkdir] Created dir: C:\Program Files\KonaKart\java_soap_examples\classes
    [javac] Warning: com\konakart\ws\KKWSEngIf.java modified in the future.
    [javac] Warning: com\konakart\ws\KKWSEngIfService.java modified in the futu
e.
    [javac] Warning: com\konakart\ws\KKWSEngIfServiceLocator.java modified in t
e future.
    [javac] Warning: com\konakart\ws\KKWebServiceEngSoapBindingStub.java modifi
d in the future.
    [javac] Warning: com\konakart\wsapp\Address.java modified in the future.
    [javac] Warning: com\konakart\wsapp\Basket.java modified in the future.
    [javac] Warning: com\konakart\wsapp\Category.java modified in the future.
    [javac] Warning: com\konakart\wsapp\Country.java modified in the future.
    [javac] Warning: com\konakart\wsapp\Coupon.java modified in the future.
    [javac] Warning: com\konakart\wsapp\Currency.java modified in the future.
    [javac] Warning: com\konakart\wsapp\Customer.java modified in the future.
    [javac] Warning: com\konakart\wsapp\CustomerGroup.java modified in the futu
e.
    [javac] Warning: com\konakart\wsapp\CustomerRegistration.java modified in t
e future.
    [javac] Warning: com\konakart\wsapp\DataDescriptor.java modified in the fut
re.
    [javac] Warning: com\konakart\wsapp\DigitalDownload.java modified in the fu
ure.
    [javac] Warning: com\konakart\wsapp\IpnHistory.java modified in the future.
    [javac] Warning: com\konakart\wsapp\KKConfiguration.java modified in the fu
ure.
    [javac] Warning: com\konakart\wsapp\Language.java modified in the future.
    [javac] Warning: com\konakart\wsapp\Manufacturer.java modified in the futur
.
    [javac] Warning: com\konakart\wsapp\NameValue.java modified in the future.
    [javac] Warning: com\konakart\wsapp\Option.java modified in the future.
    [javac] Warning: com\konakart\wsapp\Order.java modified in the future.
    [javac] Warning: com\konakart\wsapp\OrderProduct.java modified in the futur
.
    [javac] Warning: com\konakart\wsapp\OrderStatusHistory.java modified in the
future.
    [javac] Warning: com\konakart\wsapp\OrderTotal.java modified in the future.
    [javac] Warning: com\konakart\wsapp\Orders.java modified in the future.
    [javac] Warning: com\konakart\wsapp\PaymentDetails.java modified in the fut
re.
    [javac] Warning: com\konakart\wsapp\Product.java modified in the future.
    [javac] Warning: com\konakart\wsapp\ProductSearch.java modified in the futu
e.
    [javac] Warning: com\konakart\wsapp\Products.java modified in the future.
    [javac] Warning: com\konakart\wsapp\Promotion.java modified in the future.
    [javac] Warning: com\konakart\wsapp\Review.java modified in the future.
    [javac] Warning: com\konakart\wsapp\Reviews.java modified in the future.
    [javac] Warning: com\konakart\wsapp\ShippingQuote.java modified in the futu
e.
    [javac] Warning: com\konakart\wsapp\TaxRate.java modified in the future.
    [javac] Warning: com\konakart\wsapp\Zone.java modified in the future.
    [javac] Compiling 37 source files to C:\Program Files\KonaKart\java_soap_ex
mples\classes
    [javac] Note: Some input files use unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.

run:
     [java] There are 239 countries
     [java] There are 9 manufacturers
     [java] The default currency is: USD
     [java] 21 products found
     [java] 21 length of product array

build:

BUILD SUCCESSFUL
Total time: 34 seconds
C:\Program Files\KonaKart\java_soap_examples>



Thanks Kate,

Jim Barber































Title: Re: Startng and using soap interface with openlaszlo
Post by: ming on April 16, 2008, 05:57:46 am
Hi Jim,

Good - so you've successfully installed KonaKart and run the java_soap_examples successfully.   Now you have some examples of calling the KonaKart APIs using SOAP.   These examples should help you get started.

What you do from here is up to you. 

Regards,
Ming
Title: Re: Startng and using soap interface with openlaszlo
Post by: jbarb on May 01, 2008, 02:56:59 am
I am having a little difficulty editing the KonaKart Admin products section.
What is the secret for saving your edits, deletions, additions of new products in the catalog section.
The "Save" button at the bottom of all the edit pages seems to highlight only when it feels like it. There seems to be no rhyme or reason in the process of activating this "save" button.
I have lost numerous edits and additions to the product catalog because I was unable to save the changes. There seems to be no set pattern for enabling the "Save" button.
??? It is extremely aggravating to type your product descriptions into the edit text block only to find out the save button refuses to activate making your efforts futile, losing your product descriptions, prices and images. How can I remedy this? Thanks.

Jim Barber
Title: Re: Startng and using soap interface with openlaszlo
Post by: ming on May 01, 2008, 05:58:06 am
Hi,

The save button (throughout the Admin App) will only be enabled when you have a validated record present.

Often, with products, it can be because you haven't provided descriptions for all the languages you have defined that your shop will support.   Flick through all the tabs on the product and find the yellow fields and make sure you add values to all those yellow fields.

If you don't want to have to do this you could choose to support just one language.

Ming
Title: Re: Startng and using soap interface with openlaszlo
Post by: jbarb on May 09, 2008, 03:21:45 am
Try as I may, KonaKart Admin will not allow me to save my product edits.

I deleted the old products but now it refuses to allow to save my new products.
Is there something causing this? I have tried every combination possible in adding new products to no avail. I have to believe something is wrong with the site itself. I even uninstalled and reinstalled KonaKart in the hope that there was an error in the install but it made no difference.
Is the admin site the only way to alter content? I would really like to change the configuration of the site itself regarding a one page shopping cart.
However the process of using the APIs or soaps is so complicated (it appears y ou must be a programmer in order to do this) that I have more or less given up on that course and no one seems willing to give some guidance on setting up the soap or api procedures.

J.Barber
Title: Re: Startng and using soap interface with openlaszlo
Post by: heidi on May 09, 2008, 05:52:52 am
Hi Jim,

When you say "it refuses to allow to save my new products" - what exactly do you mean?  Is it that the save button isn't enabled?   (if so check Ming's reply on this).

QuoteIs the admin site the only way to alter content?   

It's the easiest way... but you can also use the importer tool, or the APIs, or if you really understand the database structures you could write directly into the database (although this isn't advisable because that might not work in the future if the database changes - usually better to use the other methods).

QuoteHowever the process of using the APIs or soaps is so complicated (it appears y ou must be a programmer in order to do this) that I have more or less given up on that course

Yes, it is expected that only programmers would use the APIs....  they are "application programming interfaces" after all...

Quoteand no one seems willing to give some guidance on setting up the soap or api procedures.

You've had a lot of free support on this forum already so I'm sorry you're not grateful for this.

Heidi

Title: Re: Startng and using soap interface with openlaszlo
Post by: pete on May 09, 2008, 06:15:04 am
For any one else looking at using the KonaKart SOAP APIs, we provide some guidance and examples here :

http://www.konakart.com/apiexamplesfaq.php#HowDoIUseKonaKartsSOAPWebServiceInterface
http://www.konakart.com/AddShoppingCartWithSOAP_faq.php