ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » sample c plugin _getattribute problem

Post new topic  Reply to topic
 sample c plugin _getattribute problem « View previous topic :: View next topic » 
Author Message
seanrocket
PostPosted: Mon Jul 14, 2003 3:17 pm    Post subject: sample c plugin _getattribute problem Reply with quote

Newbie

Joined: 08 May 2003
Posts: 8

hello,

I am trying to retrieve the value from the configurable attribute of my sample c plugin node. I am using getattribute method of the Bipsamppluginnode.c program to try to retrieve the attribute values from the plug in node but am having trouble.
It seems like the value that it retrieves is only the default value from the _setattribute function not the configurable attribute value of the plugin node.

When I print the p->valptr value from below it only gives the default setting from the call _setattribute.

1) How do you get the configurable attribute value from the plug in node?


int _getAttribute(
CciContext* context,
CciChar* attrName,
CciChar* buffer,
int bufsize
){
......
while (p != 0) {
if (CciCharCmp(p->name, attrName) == 0) {
switch(p->type) {
case CNI_TYPE_INTEGER:
sprintf((char*)&string, "%d", *((int*)p->valptr));
{

const CciChar* ucsAttrValue = CciString(string, BIP_DEF_COMP_CCSID); /*TODO*/
CciCharNCpy(buffer, ucsAttrValue, min(bufsize, 256));
free((void *)ucsAttrValue);
}
break;
case CNI_TYPE_STRING:
{
const CciChar* ucsAttrValue = CciString((char *)p->valptr, BIP_DEF_COMP_CCSID); /* TODO */
CciCharNCpy(buffer, ucsAttrValue, min(MAX_STRING_SIZE, bufsize));
free((void *)ucsAttrValue);
}
default:
/* Error: Invalid datatype */
break;
}

.......
}
Back to top
View user's profile Send private message
vanvught
PostPosted: Tue Nov 04, 2003 1:44 pm    Post subject: Reply with quote

Apprentice

Joined: 02 Jul 2001
Posts: 35
Location: The Netherlands

Hi,
From SupportPac IA07 -->
Code:

/******************************************************************************/
/*                                                                            */
/* Plugin Node Implementation Function:                     cniGetAttribute() */
/*                                                                            */
/******************************************************************************/
int getAttribute(CciContext *context, CciChar *attrName, CciChar *buffer, int bufsize)
{
   /*@unused@*/static char *functionName = (char *)"getAttribute()";                        /* 28/07/2001 */

   ATTRIBUTE_TBL_ENTRY *p = ((NODE_CONTEXT_ST *)context)->attrListHead;

   char    string[256]; 

#ifdef _DEBUG
   fprintf(((NODE_CONTEXT_ST *)context)->debugFile, "-> %s\n", functionName);   /* 28/07/2001 */
   fflush(((NODE_CONTEXT_ST *)context)->debugFile);
#endif

   while (p != 0) {
      if (CciCharCmp(p->name, attrName) == 0) {
         switch(p->type) {
            case CNI_TYPE_INTEGER:
               sprintf((char*)&string, "%d", *((int*)p->valptr));
               {
                  const CciChar* ucsAttrValue = CciString(string, BIP_DEF_COMP_CCSID);
                  CciCharNCpy(buffer, ucsAttrValue, min(bufsize, 256));
                  free((void *)ucsAttrValue);
               }
               break;
            case CNI_TYPE_STRING:
               {
                  const CciChar* ucsAttrValue = CciString((char *)p->valptr, BIP_DEF_COMP_CCSID);
                  CciCharNCpy(buffer, ucsAttrValue, min(MAX_STRING_SIZE, bufsize));
                  free((void *)ucsAttrValue);
               }
               break;                                                         /* 28/07/2001 */
            default:
            /* Error: Invalid datatype */
            break;
         }

#ifdef _DEBUG
         fprintf(((NODE_CONTEXT_ST *)context)->debugFile, "<- %s, rc = 0\n", functionName);/* 28/07/2001 */
         fflush(((NODE_CONTEXT_ST *)context)->debugFile);
#endif
         /* Normal return; attribute value returned */
         return(0);
      }

      p = p->next;
   }

#ifdef _DEBUG
   fprintf(((NODE_CONTEXT_ST *)context)->debugFile, "<- %s, rc = 0\n", functionName);/* 28/07/2001 */
   fflush(((NODE_CONTEXT_ST *)context)->debugFile);
#endif
   /* Attribute not owned by plugin */
   return(1);
}


Regards, Arjan

WBI: WebSphere MQ and B2B --> http://edi.services.ibm.com/mqseries/spec_sheets.shtml
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » sample c plugin _getattribute problem
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.