Hi All,
Newbie question that I can't seem to find an answer to.
On a return from a published XMLRpcServlet method, I need to returns 3
values. I was hoping to return the values in the following manner:
pkg = "<response>\n"
pkg += "<sn>" + row[14] + "</sn>\n"
pkg += "<cl_id>" + str(row[8]) + "</cl_id>\n"
pkg += "<reg_expiry>" + str(row[2]) + "</reg_expiry>\n"
pkg += "</response>\n"
return pkg
The result in the client is the following:
<params>
<param>
<value><string><response>
<sn>TESTPR 12345 67890 CCCCC</sn>
<cl_id>1858</cl_id>
<reg_expiry>2023-06-04</reg_expiry>
</response>
</string></value>
</param>
</params>
I can make this work, but was really hoping the result would be like:
<params>
<param>
<value><string><response>
<sn>TESTPR 12345 67890 CCCCC</sn>
<cl_id>1858</cl_id>
<reg_expiry>2023-06-04</reg_expiry>
</response>
</string></value>
</param>
</params>
If I do the following for the return value:
trans = self.transaction()
self.sendOK( 'text/xml', pkg, trans )
return ""
Where "pkg" is the xml structure:
<?xml version="1.0" ?>
<response>
<sn>TESTPR 12345 67890 CCCCC</sn>
<cl_id>1858</cl_id>
<reg_expiry>2023-06-04</reg_expiry>
</response>
The client receives the following:
<?xml version="1.0" \?>
<response>
<sn>TESTPR 12345 67890 CCCCC</sn>
<cl_id>1858</cl_id>
<reg_expiry>2023-06-04</regexpiry>
</response>
<?xml version='1.0'?>
<methodResponse>
<params>
<param>
<value><nil/></value></param>
</params>
</methodResponse>
Notice the package I want to return is there, but so is the default return
structure from the XMLRpcServlet class.
This is useful if I just ignore the second XML segment which is easy enough
to do (note: The content length of the header does not match either the
total return package length, or, the length of the default return structure
or the one I added).
I was hoping that the sendOK with the content would replace the default
return value, but it still puts the default in there.
I was looking for a method(s) to manage the return parameters/values. Is
there anything like that?
Is there a definition for changes to the input parameters to the method to
be returned to the client? Is that where I should be looking?
Is there another approach I should be using?
John Boehme
Software Engineer
Description: Mophily_Footer_50
|