Cannot call nsIStringStream from Javascript [xml rpc]

RESOLVED WORKSFORME

Status

()

defect
RESOLVED WORKSFORME
18 years ago
4 years ago

People

(Reporter: wsargent, Assigned: scc)

Tracking

Trunk
x86
All
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

var oUploadStream = ?????   // mmh, so here I've got a problem: I need
Does anyone have an idea how to wrap the string object in something that
provides nsIInputStream??

I'm trying to hack nsXmlRpcClient.js back into operation.  There doesn't seem to
be a way to turn a string into a stream from Javascript.  I need to do this so I
can send a POST request through an HttpChannel.

The usual way of doing it from C++ seems to be to use
NS_NewCStringInputStream(), but that relies on nsIStringStream, which doesn't
have an IDL interface.  Doesn't look like anything else uses Javascript, so I
can't see what the workaround is.

Also see 9ijp67$4371@secnews.netscape.com:

// The old/deprecated way would be to use the NewPostDataStream method (this
method is no longer available within the new nsIHttpProtocolHandler
interface):

var oProtocolHandler = oIoService.getProtocolHandler(oUrl.scheme);
oProtocolHandler =
oProtocolHandler.QueryInterface(Components.interfaces.nsIHTTPProtocolHandler
);
var oUploadStream = oProtocolHandler.NewPostDataStream(false, "\r\n" +
oBody, oProtocolHandler.ENCODE_NORMAL);

oChannel.uploadStream = oUploadStream;
Re-assigning to default owner, since this bug sounds like a string thing, not an
XPCOM thing.
Assignee: kandrot → scc
Component: XPCOM → String
scc: if there is not an existing mechanism for this, then i can whip something up:
afterall, my http changes removed the NewPostDataStream solution.  so, feel free
to reassign.
This bug is related to the XML-RPC and XML modules, I think.  I don't know if
this bug has been fixed yet, but I'd like to see who I can talk to about this to
see if this still impacts XML-RPC messages.
Summary: Cannot call nsIStringStream from Javascript → Cannot call nsIStringStream from Javascript [xml rpc]
I think that this was either fixed or invalidated by Bug 109960.
xml-rpc works now.
I can't duplicate this on an RC2 build.  Looks like it was fixed by Bug 109960.

Marking as WORKSFORME
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → WORKSFORME
Blocks: 1152568
No longer blocks: 1152568
You need to log in before you can comment on or make changes to this bug.