You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-user@axis.apache.org by Vi...@cognizant.com on 2007/03/12 10:19:47 UTC

how to get rid of linker error- following the steps in "Writing Web Services Skeleton Using Code Generator" topic in Axis 2c User guide.

Hi,

 

 

Can any one tell how to write web service using generated files? 

The steps I have followed to create a web services using Axis2c are 

 

 

Generated files using the wsdl and it has operation with a request
string type and response a string type  

Wsdl name as "myecho" with "echoString" as operation

 

 

<--class path details> org.apache.axis2.wsdl.WSDL2C -D
org.apache.adb.properties=org/apache/axis2/schema/c-schema-compile.prope
rties -uri myecho.wsdl -o genfiles -a -l c -d adb -ss -sd -u

 

Generated files axis2_skel_myecho.h

                        axis2_skel_myecho.c

                        axis2_svc_skel_myecho.c

 

And in src folder the files are       axis2_echoString.h

                                    axis2_echoStringResponse.h

                                                axis2_echoString.c]

 
axis2_echoStringResponse.c

and a service.xml file      

 

 

I have return my code  as follows in the function
"axis2_echoStringResponse_t* axis2_skel_myecho_echoString (const
axis2_env_t *env  ,

                                              axis2_echoString_t*
echoString )"           of file "axis2_skel_myecho.c "

                                   {

axis2_echoString_t* echo_in = echoString;

                   axis2_echoStringResponse_t* echo_out = NULL;

 

                   char* echo_string = NULL;

                   

                   /* retrieve the string input */

                   echo_string = AXIS2_ECHOSTRING_GET_PARAM0 ( echo_in,
env );

 

                   /* create the response and set the output string */

                   echo_out = axis2_echoStringResponse_create ( env );

                   AXIS2_ECHOSTRUCTRESPONSE_SET_RETURN ( echo_out, env,
echo_string );

 

                   return echo_out;

                }

                                    

 

 Compiled it compiled but gives linker error related to generated
functions.

Linking...

   Creating library C:\Axis2cdll\myecho\Debug\myecho.lib and object
C:\Axis2cdll\myecho\Debug\myecho.exp

axis2_skel_myecho.obj : error LNK2019: unresolved external symbol
_AXIS2_ECHOSTRUCTRESPONSE_SET_RETURN referenced in function
_axis2_skel_myecho_echoString

axis2_skel_myecho.obj : error LNK2019: unresolved external symbol
_AXIS2_ECHOSTRING_GET_PARAM0 referenced in function
_axis2_skel_myecho_echoString

C:\Axis2cdll\myecho\Debug\myecho.dll : fatal error LNK1120: 2 unresolved
externals

 

 

 

 

I think axis2c user guide is incomplete. 

It is not clear whether to use WSDL2C or WSDL2Code to generate C code.
The naming convention used in the generated 

Files are not clear. 

"Writing Web Services Skeleton Using Code Generator" from user gide,
topic is not clear to follow.

 

 

 

-Viji.



This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. 
Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly 
prohibited and may be unlawful.

Re: how to get rid of linker error- following the steps in "Writing Web Services Skeleton Using Code Generator" topic in Axis 2c User guide.

Posted by Milinda Pathirage <mi...@gmail.com>.
Hi,
Please use the WSDL2C.bat in the tool/bin folder with following options:

If you wan to generate server side skeletons use
WSDL2C.bat -uri <wsdl file> -ss -sd -d adb -u -f -o <out put folder>

for client stubs:
WSDL2C.bat -uri <wsdl file> -g -u -d adb -f -o <out put folder>

Then compile the service with all source files and header files in same
directory. All the generated data binding sources must in the same folder
which has skeleton code.

There will be some compilation errors caused by using MACROS inside
generated code. Because current trunk of axis2 doesn't have most of the
macros.
I will update the code generation tool soon.

Thanks
Milinda

On 3/12/07, Vijayalakshmi.VenkadaSwamy@cognizant.com <
Vijayalakshmi.VenkadaSwamy@cognizant.com> wrote:
>
>  Hi,
>
>
>
>
>
> Can any one tell how to write web service using generated files?
>
> The steps I have followed to create a web services using Axis2c are
>
>
>
>
>
> Generated files using the wsdl and it has operation with a request string
> type and response a string type
>
> Wsdl name as "myecho" with "echoString" as operation
>
>
>
>
>
> ßclass path details> org.apache.axis2.wsdl.WSDL2C -D
> org.apache.adb.properties=org/apache/axis2/schema/c-schema-compile.properties-uri
> myecho.wsdl -o genfiles -a -l c -d adb -ss -sd -u
>
>
>
> Generated files axis2_skel_myecho.h
>
>                         axis2_skel_myecho.c
>
>                         axis2_svc_skel_myecho.c
>
>
>
> And in src folder the files are       axis2_echoString.h
>
>                                     axis2_echoStringResponse.h
>
>                                                 axis2_echoString.c]
>
>                                                 axis2_echoStringResponse.c
>
> and a service.xml file
>
>
>
>
>
> I have return my code  as follows in the function "axis2_echoStringResponse_t*
> axis2_skel_myecho_echoString (const axis2_env_t *env  ,
>
>                                               axis2_echoString_t*
> echoString )"           of file "axis2_skel_myecho.c "
>
>                                    {
>
> axis2_echoString_t* echo_in = echoString;
>
>                    axis2_echoStringResponse_t* echo_out = NULL;
>
>
>
>                    char* echo_string = NULL;
>
>
>
>                    /* retrieve the string input */
>
>                    echo_string = AXIS2_ECHOSTRING_GET_PARAM0 ( echo_in,
> env );
>
>
>
>                    /* create the response and set the output string */
>
>                    echo_out = axis2_echoStringResponse_create ( env );
>
>                    AXIS2_ECHOSTRUCTRESPONSE_SET_RETURN ( echo_out, env,
> echo_string );
>
>
>
>                    return echo_out;
>
>                 }
>
>
>
>
>
>  Compiled it compiled but gives linker error related to generated
> functions.
>
> Linking...
>
>    Creating library C:\Axis2cdll\myecho\Debug\myecho.lib and object
> C:\Axis2cdll\myecho\Debug\myecho.exp
>
> axis2_skel_myecho.obj : error LNK2019: unresolved external symbol
> _AXIS2_ECHOSTRUCTRESPONSE_SET_RETURN referenced in function
> _axis2_skel_myecho_echoString
>
> axis2_skel_myecho.obj : error LNK2019: unresolved external symbol
> _AXIS2_ECHOSTRING_GET_PARAM0 referenced in function
> _axis2_skel_myecho_echoString
>
> C:\Axis2cdll\myecho\Debug\myecho.dll : fatal error LNK1120: 2 unresolved
> externals
>
>
>
>
>
>
>
>
>
> I think axis2c user guide is incomplete.
>
> It is not clear whether to use WSDL2C or WSDL2Code to generate C code. The
> naming convention used in the generated
>
> Files are not clear.
>
> "Writing Web Services Skeleton Using Code Generator" from user gide, topic
> is not clear to follow.
>
>
>
>
>
>
>
> -Viji.
>  This e-mail and any files transmitted with it are for the sole use of the
> intended recipient(s) and may contain confidential and privileged
> information.
> If you are not the intended recipient, please contact the sender by reply
> e-mail and destroy all copies of the original message.
> Any unauthorized review, use, disclosure, dissemination, forwarding,
> printing or copying of this email or any action taken in reliance on this
> e-mail is strictly
> prohibited and may be unlawful.
>



-- 
milinda@wso2.com
WSO2, Inc: http://www.wso2.com "Oxygenating the Web Service Platform"
http://www.milindalakmal.wordpress.com