Nov 28, 2013 at 3:21pm UTC
I am facing an issue with one variable.
Pls look the below piece of code.
pdata0->u.msmlRequest->u.dialogstart->target.value = (const OSUTF8CHAR*) "conn:[$toTAG]";
plist->append (pdata0, TRUE);
msmlEncReturn = pdu.encode();
msgptr = buffer.getMsgPtr();
target.value and of type const unsigned char*.
buffer is of type OSXMLEncodeBuffer.
pdu is the pdu designated while xml binding using xbinder.
Problem:- If I set the target value as shown above everything works fine. At last I can it returns the proper payload.
But when I set it using a variable say C string variable.
pdata0->u.msmlRequest->u.dialogstart->target.value = (const OSUTF8CHAR*) msmlTarget;
This sets the target value. I can get that value printed. but it does not return the proper payload. Instead it returns the junk value!!!
Can anyone help me here?
Last edited on
Nov 28, 2013 at 3:23pm UTC
Nov 28, 2013 at 3:35pm UTC
make sure that you do
not return a pointer to a temporary object.
Nov 29, 2013 at 11:12am UTC
Thanks for the reply! The behaviour remained same even without returning anything.
Nov 29, 2013 at 11:22am UTC
You didn't provide enough code to tell what's wrong.
But if is a local variable then you must not use it outside the function/scope where it's defined.
Dec 3, 2013 at 12:03pm UTC
Its fixed now. The issue was in type of "target" variable.
It accepts only the string starts from "conn:" or "conf:".
Hence failing for test strings...! It must have been defined in the underneath (xsd generated) code.