|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
sample c plugin _getattribute problem |
« View previous topic :: View next topic » |
Author |
Message
|
seanrocket |
Posted: Mon Jul 14, 2003 3:17 pm Post subject: sample c plugin _getattribute problem |
|
|
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 |
|
 |
vanvught |
Posted: Tue Nov 04, 2003 1:44 pm Post subject: |
|
|
 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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|