Dimuthuc’s Weblog

Just using what others shared..

Axis2/C codegen helper tools

In a case somebody feel not well to work with the WSDL2C tool, I have written some scripts to help generating demos, writing tests and building code. From that I think the demo generation script should be really useful. It s a ruby script and you can download it from here. (http://people.apache.org/~dimuthu/leisure_time.html, check the script under 23th October 2007)

What you should do is generate the code using WSDL2C tool (It can be either stub or skel), and run the script within the generated files. If it is stub, then there will be a demo.c file, which is a complete demonstration of writing all the operation using ADB objects. And if it the skel, then the demo filename will be axis2_skel_myservice2.c (axis2_skel_myservice.c is the original generated file). That has implemented some fake logic to show how each operation can be built using ADB.

I hope this will be useful to people who are searching for WSDL2C tags.:)

December 1, 2007 - Posted by dimuthuc | WSDL2C/ Codegen, Web services, axis2/c | , , | 6 Comments

6 Comments »

  1. Hi!

    I just tried to use your script. Unfortunately, it doesn’t work for me: I’ve got demo.c file but looks like your script doesn’t recognize correctly my stub files. Body of function main is:

    axutil_env_t *env = NULL;
    axis2_char_t *client_home = NULL;
    axis2_char_t *endpoint_uri = NULL;
    axis2_stub_t *stub = NULL;

    endpoint_uri = “http://localhost:9090/axis2/services/”;
    env = axutil_env_create_all(“alltest.log”, AXIS2_LOG_LEVEL_TRACE);
    client_home = AXIS2_GETENV(“AXIS2C_HOME”);

    stub = axis2_stub_create_(env, client_home, endpoint_uri);

    return 0;

    I ran it into the ’src’ directory generated by command:
    java org.apache.axis2.wsdl.WSDL2C -uri http://localhost:8080/axis2/services/Version?wsdl -d adb -u

    Where is my mistake?

    Comment by Mariusz | December 5, 2007

  2. Hi Mariuz,
    If I m right you are working on a generated code from a snapshot 2 weeks ago, that is your service create function would like

    axis2_stub_|your_service_name|_create,

    But now we updated the templates so new service create function would look like

    axis2_stub_create_|your_service_name|

    And there are some changes in other function headers as well, If this is the problem, just check the script in here,
    http://people.apache.org/~dimuthu/leisure/23_oct/old/generate_demos.rb

    Or you can download the latest java snapshot from here, http://people.apache.org/dist/axis2/nightly/

    HTH

    Comment by dimuthuc | December 5, 2007

  3. Thanks for answer! Generated file looks much better now :) . I’m currently trying to compile it, but don’t know how to invoke correctly gcc. I’ll write you when (if) I achive a success :)

    Thanks again for your help.

    Regards
    Mariusz

    Comment by Mariusz | December 6, 2007

  4. Ok, I’m back with news: it works :) Does nothing but works :)

    Comment by Mariusz | December 6, 2007

  5. Wow great to hear good news:)

    Comment by dimuthuc | December 6, 2007

  6. [...] Helper tools to generate demo codes for Axis2/C ADB generated code (Blog) [...]

    Pingback by Axis2/C ADB Codegen (WSDL2C) Tutorial + Resources | Dimuthu's Blog | July 21, 2008


Leave a comment