axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Milinda Pathirage" <milinda.pathir...@gmail.com>
Subject Re: [Axis2] wsdl2java not generating request object in C
Date Thu, 07 Dec 2006 03:06:46 GMT
On 12/7/06, Nicholas Hart <nhart@real.com> wrote:
>
>
> I'm trying to reduce the complexity of the problem I'm having with the C
> code generator.  I've reduced it to a simple example that demonstrates
> one of the problems I'm having (attached) when trying to generate client
> code.
>
> The generated code below uses an undefined type "getFooBar" in the
> parameter list:
>
>          void axis2_stub_FooBarAdapterService_getFooBar_start(
> axis2_stub_t *stub, const axis2_env_t *env,
>                                                          getFooBar param0,
>                                                          axis2_status_t
> ( AXIS2_CALL *on_complete ) (struct axis2_callback *, const axis2_env_t* )
> ,
>                                                          axis2_status_t
> ( AXIS2_CALL *on_error ) (struct axis2_callback *, const axis2_env_t*,
> int ) );
>
> my guess is that this should be an "axis2_getFooBarRequest" object
> instead of "getFooBar" for param0 (yes/no?) but there seems to be no .c
> or .h file generated that contains a request object.  the generated
> files are:
>
> axis2_FooBarObject.c
> axis2_FooBarObject.h
> axis2_getFooBar.c
> axis2_getFooBar.h
> axis2_getFooBarResponse.c
> axis2_getFooBarResponse.h
> axis2_stub_FooBarAdapterService.c
> axis2_stub_FooBarAdapterService.h
>
> Or, should the axis2_stub_FooBarAdapterService_getFooBar_start()
> function instead have a parameter list that reflects the
> "parameterOrder" attribute of the "wsdl:operation" tag in the WSDL file
> (ie: "string fooId" and "long barId")?
>
> I'm using a build I made from a source snapshot yesterday (on WinXP with
> jdk1.5.0_10).  the command I'm running to generate the code is:
>
> wsdl2java.bat -l c -d adb -a -u -uri FooBar.wsdl
>
> and with the following environment variable set
> JAVA_OPTS=-
> Dorg.apache.adb.properties=/org/apache/axis2/schema/c-schema-compile.properties
>
> I've tried some different options, with no luck.  I've also looked
> through Jira but so far haven't found anything that seems to match this
> problem--but maybe I'm using the wrong keywords.
>
> Can someone tell me what's wrong with the wsdl, the wsdl2java command,
> or if this is a known issue?  I'm willing to try to fix this if it is a
> bug, but I'm not sure where to start looking.
>
> thanks!
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-dev-help@ws.apache.org


Hi,

I tried code generation for your wsdl(in Linux). Generated code compiled
successfully. I used the current source at Axis 2
trunk<http://svn.apache.org/repos/asf/webservices/axis2/trunk/java>.
Most of the bugs in the C code generation is fixed in the source insde
trunk.

Here is the code generated for reported function:

void axis2_stub_FooBarAdapterService_getFooBar_start( axis2_stub_t *stub,
const axis2_env_t *env,
                                                    axis2_getFooBar_t*
getFooBar,
                                                  axis2_status_t (
AXIS2_CALL *on_complete ) (struct axis2_callback *, const axis2_env_t *) ,
                                                  axis2_status_t (
AXIS2_CALL *on_error ) (struct axis2_callback *, const axis2_env_t *, int )
)
         {

            axis2_callback_t *callback = NULL;

            axis2_svc_client_t *svc_client = NULL;
            axis2_options_t *options = NULL;

            const axis2_char_t *soap_action = NULL;
            axiom_node_t *payload = NULL;



                            payload = AXIS2_GETFOOBAR_PARSE_OM(getFooBar,
env, NULL);



            options = AXIS2_STUB_GET_OPTIONS( stub, env);
            if ( NULL == options )
            {
              AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "options is null in
stub: Error code:"
                      " %d :: %s", env->error->error_number,
                      AXIS2_ERROR_GET_MESSAGE(env->error));
              return;
            }
            svc_client = AXIS2_STUB_GET_SVC_CLIENT (stub, env );
            soap_action = AXIS2_OPTIONS_GET_ACTION ( options, env );
            if ( NULL == soap_action )
            {
              soap_action = "urn:foobar:FooBarAxisAdapter:getFooBarRequest";
              AXIS2_OPTIONS_SET_ACTION( options, env, soap_action );
            }

            AXIS2_OPTIONS_SET_SOAP_VERSION(options, env, AXIOM_SOAP11 );


            callback = axis2_callback_create(env);
            /* Set our on_complete fucntion pointer to the callback object
*/
            AXIS2_CALLBACK_SET_ON_COMPLETE(callback, on_complete);
            /* Set our on_error function pointer to the callback object */
            AXIS2_CALLBACK_SET_ON_ERROR(callback, on_error);

            /* Send request */
            AXIS2_SVC_CLIENT_SEND_RECEIVE_NON_BLOCKING(svc_client, env,
payload, callback);
         }

I think the problem is in the source you have downloaded. Please try the
trunk.

Thanks!
-- 
milinda@wso2.com
WSO2, Inc: http://www.wso2.com
http://www.milindalakmal.wordpress.com

Mime
View raw message