Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: Problem while returning the response back (axis2C): msg#00152

apache.webservices.axis-c.user

Subject: Re: Problem while returning the response back (axis2C)

Hi Sathya,
If I got your question correctly, you are asking why there the returning object (which is created inside the service logic) is re-created  in the client side.

When you create and return the adb objects in ther server logic it is serialized into an xml  and embed it in a soap message and send to the client. So client only have the xml. so in the client side to output adb objects (similar to objects you created in the server side), we need to recreate the objects with the information in the xml. That is done in the deserialize function.  We cannot give the same objects returned by the service, because simple we cannot send object pointers through the network.

You will be able to see the messages pass through client and server from a tool like Apache tcpmon.

It seems that your adb object handling in the server logic is correct,( I cant gaurentee that without seen the other generated code or the wsdl)  but it is better you track the messages and check the response soap. So we can find what s gone wrong.

And btw if is not safe to write code like,
myInt->attrib_pInterchange = adb_INTERCHANGE_create(env);

You are expected only use the header files (i.e. the API) so the above line should better be changed to
adb_INTERCHANGE_t *x;
x = adb_INTERCHANGE_create(env);
adb_pInterchange_set_pInterchange(myInt, env, x);

This is because if you dont follow this, if you generate the code future you may need to rewrite the service logic again,
since it is only the API is guaranteed to be kept same from version to version.


Thanks,
Dimuthu




On 9/25/07, Sathya Raghunathan <pappu.raghunathan-Re5JQEeQqe8AvxtiuMwx3w@xxxxxxxxxxxxxxxx> wrote:
Hi
 
I sent a message to the service, but i have a problem while getting the output message.
 
Please have a look at the service implementation:
 
 adb_pInterchange_t* axis2_skel_ParseMessage_parseMessage (const axutil_env_t *env  ,
                                              adb_inputMessage_t* inputMessage )
        {
          /* TODO fill this with the necessary business logic */
        adb_pInterchange_t* myInt = adb_pInterchange_create(env);
        printf ("I am inside the service method %u\n",myInt );
        myInt->attrib_pInterchange = adb_INTERCHANGE_create(env);
        adb_INTERCHANGE_set_internal_intref_no(myInt->attrib_pInterchange,env,"222222");
        printf("The address of intref no = %u\n",adb_INTERCHANGE_get_internal_intref_no(myInt->attrib_pInterchange,env));
        adb_INTERCHANGE_set_interchange_ref_no(myInt->attrib_pInterchange,env,"333333");
        adb_INTERCHANGE_set_sender_id(myInt->attrib_pInterchange,env,"44444");
        myInt->attrib_pInterchange->attrib_message= adb_MESSAGE_create(env);
        printf ("THe sender id = %s\n", adb_INTERCHANGE_get_sender_id(myInt->attrib_pInterchange,env));

 return myInt;
        }

Here, i created a pointer of  myInt and populated with some value. And returned myInt. When i print it in the client side, I am getting junk.

 When i debugged it, I found that in adb_pInterchange_t* axis2_stub_ParseMessage_parseMessage() function (axis2_stub_ParseMessage.c) , after the call to axis2_svc_client_send_receive_with_op_qname( svc_client, env, op_qname, payload), the code has generated another object of adb_pInterchange_t and returns that to the client. If that is returned, the object that I return from the service is lost. I am attaching the file axis2_stub_ParseMessage.c for reference. Reference: LIne number : 140 and 149. Why there is a call to create interchange object once again at line 48? I was thinking that, the object returned by the service should be returned to the client.

Please let me know if the way, i created the object inside the service is correct or not.

Thanks

Sathya


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe-28n8OjmUYWfNLxjTenLetw@xxxxxxxxxxxxxxxx
For additional commands, e-mail: axis-c-user-help-28n8OjmUYWfNLxjTenLetw@xxxxxxxxxxxxxxxx


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
hardware.arm.at...    cms.citadel.dev...    video.gstreamer...    java.facelets.u...    misc.basics.qna...    web.wiki.instik...    network.uip.use...    xdg.devel/2003-...    tex.bibtex.bibd...    finance.quotesp...    ietf.zeroconf/2...    redhat.blinux.g...    suse.db2/2003-0...    php.phpesp/2004...    uml.devel/2003-...    gnome.labyrinth...    qnx.openqnx.dev...    boot-loaders.gr...    db.dataperfect....    audio.audacity....    linux.uclinux.m...    editors.j.devel...    os.openbsd.tech...    kde.users.multi...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation