facebook

[Closed] Amazon web services client in MyEclipse 5.1

  1. MyEclipse Archived
  2.  > 
  3. Web Services
Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #261739 Reply

    Steve Prior
    Member

    To try the new web services client wizard I:

    1. created new Java project named foo.

    2. Hilight the src directory and select File->New->Other->Web Services->Web Service Client

    3. Choose project foo, java src file src, new java package mypackage, WSDL URL : http://soap.amazon.com/schemas2/AmazonWebServices.wsdl, Next

    4. Choose both XFire 1.2 Core and JAXB2 libraries, next

    And I get “Error Generating Services”.

    I’m using a brand new installation of Eclipse 3.2.1, MyEclipse 5.1 GA (fresh install, not upgrade)

    Error log shows:

    !ENTRY com.genuitec.eclipse.ws.xfire 4 0 2006-11-14 00:49:20.218
    !MESSAGE Error generating services
    !STACK 0
    org.codehaus.xfire.gen.GenerationException: Error generating JAXB model.
    at org.codehaus.xfire.gen.jaxb.JAXBSchemaSupport.initialize(JAXBSchemaSupport.java:108)
    at org.codehaus.xfire.gen.Wsdl11Generator.generate(Wsdl11Generator.java:119)
    at com.genuitec.eclipse.ws.xfire.generator.WSGenJob.run(WSGenJob.java:92)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)

    Any ideas?

    #261773 Reply

    Riyad Kalla
    Member

    This is a known problem we are working on, unfortunately the Google web services fall under this as well. They are using RPC/Encoded format, and the new format going forward is Document/Literal, which is what we support. Unfortunately there is a large group of legacy web services (and even new ones) that are still using RPC/Encoded and we need to update our wizards to support that. This is something we are looking at for, for a release shortly. Sorry for the trouble.

    #261849 Reply

    Steve Prior
    Member

    That’s kind of unfortunate, mostly because when users hear about the new webservices client wizard and want to give it a quick tryout, I bet a good many of them pick either the Google or Amazon WSD file because they are so well known and it turns out that’s a fast route to frustration because it dies with no explanation.

    #261879 Reply

    Riyad Kalla
    Member

    I really wish this weren’t the case, but you are correct. We know how important support for the most used web services is, the decision to use XFire over a year ago was because at that time Axis was such a poor implementation of the WS spec, now it seems it’s gotten better and we are looking back at how to get full support for all web services in ASAP.

    Hang in there, we’ll get this fixed soon.

    #262852 Reply

    Mark Ricard
    Member

    How “soon” is “soon” ?

    #262857 Reply

    Riyad Kalla
    Member

    I don’t have an ETA from the development team, but management and the devs know it’s a very sore spot.

    #263415 Reply

    Brian Fernandes
    Moderator

    I wanted to keep this thread current; Amazon Web services do in fact work with XFire, I was able to generate a client and use it run a few queries against Amazon without issue.
    The Amazon services are not RPC / Encoded but Document / Literal which is fully supported by XFire.

    The WSDL URL I used was: http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl
    The URL mentioned in the first post does not seem to exist now, I’m not sure if this was the cause of the initial failure reported by sprior.

    As a related note, validation in the top down and client wizards has been improved for the upcoming 5.1.1 release, so you will be aware up front if the WSDL you are using is valid for XFire (or not).

    #263423 Reply

    Steve Prior
    Member

    The URL mentioned int he first post does indeed still exist. If you try clicking on the link as displayed in the first post there is a comma stuck on the end – remove it and you’ll see the WSDL file (which does indeed crash the web services client wizard).

    I’d REALLY love to see examples of the code used to query against http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl

    I was able to generate the code, but when I try to run it I get the following error:

    “INFO: Unable to locate ‘AWSECommerceService’ in ServiceRegistry”

    #263424 Reply

    Steve Prior
    Member

    Also, you mention the “upcoming 5.1.1 release”. Are you folks any more willing to give a hint what time frame that will be? According the the roadmap you released 5.1.1 on 11/13 which is incorrect.

    #263432 Reply

    Brian Fernandes
    Moderator

    sprior,

    The URL mentioned int he first post does indeed still exist.

    My mistake, I really should have noticed the comma. That crashes because it’s an RPC / Encoded Web service – 5.1.1 will not allow you to use RPC / Encoded web services, but your WSDL will be validated before generation, leaving you in a less ambiguous position as to why the generation tool failed.

    Regarding this specific WSDL, I could not find a reference to it from this page: http://www.amazon.com/Web-Services-AWS-home-page/b/ref=sc_fe_c_2_3435361_2/002-1939672-2480001?ie=UTF8&node=15763381&no=3435361&me=A36L942TSJ2AJA
    That page listed out several Web Services supported by Amazon, and all of them are Document / Literal based. Could the WSDL you mentioned be an older version – how did you get to it? I’ve been exploring Amazon using this page: http://www.amazon.com/AWS-home-page-Money/b/ref=sc_fe_l_1/002-1939672-2480001?ie=UTF8&node=3435361&no=3435361&me=A36L942TSJ2AJA

    I’d REALLY love to see examples of the code

    There’s a small bug in the generated client code which could create a reference to the incorrect endpoint in the main method (uses the local endpoint instead of the actual endpoint). You can fix this by replacing:

    AWSECommerceServicePortType service = client.getAWSECommerceServicePortTypeLocalEndpoint();

    with

    AWSECommerceServicePortType service = client.getAWSECommerceServicePort();

    This has been fixed internally, sorry about that. You can see a demo of the Amazon web services in action here: MyEclipse Feature Overview – skip ahead to the WS section.
    Please note that you will require a key from Amazon to use it’s webservice (see above Amazon links to obtain one).

    Here’s the main method we used in the demo

    public static void main(String[] args) {
    
            AWSECommerceServiceClient client = new AWSECommerceServiceClient();
    
            // create a default service endpoint
            AWSECommerceServicePortType service = client.getAWSECommerceServicePort();
            
            //create a search request
            ItemSearchRequest request = new ItemSearchRequest();
            request.setKeywords("Eclipse"); //set keywords to search
            request.setSearchIndex("Books"); //set category of items to search
            
            //create search instance
            ItemSearch search = new ItemSearch();
            search.setAWSAccessKeyId(YOUR_PRIVATE_AMAZON_WS_ACCESS_KEY);
            search.setShared(request);
            
            //initiate search
            ItemSearchResponse response = service.itemSearch(search);
            
            //process search results
            Items items = response.getItems().get(0);
            for (Iterator<Item> iter = items.getItem().iterator(); iter.hasNext();) {
                Item item = iter.next();
                String title = item.getItemAttributes().getTitle();
                System.out.println("Title: " + title + "\n");
            }
    
            System.exit(0);
        }

    All the classes and methods used by the above code should be generated by the client wizard automatically.

    The roadmap actually meant 5.1.0 and not 5.1.1, I’ll get that corrected asap. I don’t have a timeline with me right now, but our next release could be as early as mid January.

    #263444 Reply

    Steve Prior
    Member

    That WSDL URL I originally posted has been around for a couple of years, so it might not be what they’re currently promoting, but I have code which uses it and still worked the last time I checked. That code was enough of a pain in the neck to get working back then that I was loath to replace it, so that’s why I’m looking forward to using the new tools.

    The other thing I noticed doing a test of the new Amazon URL is that the code which is generated seems to require Java 1.5 (which I like), but doesn’t always generate parameterized code which results in warnings and unused variables (which I don’t like). Quick fix on the parameterized code works to fix those easily enough. The unused variables are generated in the client code where a variable is credted to catch the result of createSoap11Binding, but never used. Is this code doing something important by side effect or is it totally unused? In either case it would be great if the generated code is free of compiler warnings.

    #266766 Reply

    patwillard
    Participant

    Using MyEclipse 5.1.0. Following the same procedure as mentioned above, with local copy of AWSECommerceService.wsdl to generate the client-side code results in 100 errors (all related to types that cannot be resolved).
    I noticed that Axis 1.3 is automagically pulled into the build path when using the Web Services Client wizard.
    I also noticed that Sun’s JWSDP 2.0 uses Xerces and Xalan (no Axis at all).
    What’s up?

    #266811 Reply

    Brian Fernandes
    Moderator

    Pat,

    You’re probably using WTP’s web service wizard and not our wizard; our WS generation is based on XFire and not Axis.
    To make sure you’re invoking the right wizard, be sure to select the Client wizard from File > New > Other > MyEclipse > Web Services > Web Service Client.

    Hope this helps.

Viewing 13 posts - 1 through 13 (of 13 total)
Reply To: [Closed] Amazon web services client in MyEclipse 5.1

You must be logged in to post in the forum log in