Hi,
This bug is well-known but is not part of the Muse code base - we
documented it here:
http://ws.apache.org/muse/docs/2.2.0/manual/troubleshooting/default-namespaces-xerces.html
As Kam discovered, using the three-param constructor and making QNames with
prefixes fixes the problem.
Dan
Erik Rissanen <[EMAIL PROTECTED]> wrote on 05/19/2007 07:11:13 AM:
> Hello,
>
> I am having an issue with Muse and notifications.
>
> I have a service which processes a request and I want to generate a
> notification about this request and the corresponding response.
>
> I am creating the notification like the following in the code. Response
> and respDoc are the request and response which I want to include in the
> notification.
>
> QName messageName = new QName(NAMESPACE_URI, "AccessRequest",
> PREFIX);
> Element payload = XmlUtils.createElement(messageName);
> Node importedReq =
> payload.getOwnerDocument().importNode(Request, true);
> Node importedResp = payload.getOwnerDocument().importNode
> (respDoc.getDocumentElement(), true);
> payload.appendChild(importedReq);
> payload.appendChild(importedResp);
> NotificationProducer wsn = (NotificationProducer)
> getResource().getCapability(WsnConstants.PRODUCER_URI);
> wsn.publish(topic_name, payload);
>
> The XML which I include as children in the message do not use namespace
> prefixes, but a default namespace (xmlns="...").
>
> Muse seems to try to collect the namespace prefixes from the message
> contents, which causes broken XML like this:
>
> <wsnt:NotificationMessage
> xmlns:="urn:oasis:names:tc:xacml:3.0:schema:os"
> ....
> >
> ....
> <wsnt:Message>
> <tns:AccessRequest
> xmlns:tns="...">
> <Request
> xmlns="urn:oasis:names:tc:xacml:3.0:schema:os">
> ....
>
> (Note the xmlns:="..." on the second line.)
>
> I have not tried to trace the source of this error in the code. I think
> that for now I will just rewrite the XML before it is included in the
> notification message.
>
> Is this a bug in Muse? (Or did I do something wrong.) If it is a bug, I
> can create a bug tracking item for it.
>
> Regards,
> Erik
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>