You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-user@ws.apache.org by "Vinh Nguyen (vinguye2)" <vi...@cisco.com> on 2006/11/21 23:04:45 UTC

changed capability result data

There seems to be a problem with the way Muse returns capability results
to the client.  For example, my capability returns a custom type wrapped
in an Element.  The xml contains proper namespaces and prefixes.  But,
when my test client receives the Element, the xml format has been
changed. I'm using XmlBeans for the serialization, and I'm running into
problems on the client side.  Am I doing something wrong?
 
My wsdl is as follows:
        <xsd:schema
            elementFormDefault="qualified"
            targetNamespace="http://cisco.com/musebox/cap/equip">
            <xsd:element name="EquipmentOperation" type="xsd:string" />
            <xsd:element name="EquipmentOperationResponse">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="Box" type="bx:BoxType"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
        </xsd:schema>
 
My capability code is as follows:
    String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
                    + "<equ:EquipmentOperationResponse
xmlns:equ=\"http://cisco.com/musebox/cap/equip\
<http://cisco.com/musebox/cap/equip\> ">"
                    + "<equ:Box>"
                    + "<box:name
xmlns:box=\"http://cisco.com/musebox/schemas/box\">EPR
<http://cisco.com/musebox/schemas/box\">EPR>  ID:
MuseResource-2</box:name>"
                    + "</equ:Box>"
                    + "</equ:EquipmentOperationResponse>";
    Document xmlDoc = XmlUtils.createDocument(xml);
    System.out.println("xmlDoc toString:\n" +
XmlUtils.toString(xmlDoc));
    return XmlUtils.getFirstElement(xmlDoc);

My client code is:
    Element body = XmlUtils.createElement(IEquipmentCapability.OP_QNAME,
param1);
    Element response = invoke(IEquipmentCapability.OP_URI, body);
    System.out.println("response:\n" + XmlUtils.toString(response));
 
Here's a snippet of the server side output:
    xmlDoc toString:
    <?xml version="1.0" encoding="UTF-8"?>
    <equ:EquipmentOperationResponse
xmlns:equ="http://cisco.com/musebox/cap/equip">
        <equ:Box>
            <box:name
xmlns:box="http://cisco.com/musebox/schemas/box">EPR ID:
MuseResource-2</box:name>
        </equ:Box>
    </equ:EquipmentOperationResponse>

Here's a snippet of the client incoming trace results:
    [CLIENT TRACE] SOAP envelope contents (incoming):
    ...
    <soapenv:Body>
        <muse-op:EquipmentOperationResponse
            xmlns:muse-op="http://cisco.com/musebox/cap/equip"
xmlns:tns="http://ws.apache.org/axis2">
            <Box xmlns:equ="http://cisco.com/musebox/cap/equip">
                <equ:Box>
                    <box:name
xmlns:box="http://cisco.com/musebox/schemas/box">EPR ID:
MuseResource-2</box:name>
                </equ:Box>
            </Box>
        </muse-op:EquipmentOperationResponse>
    </soapenv:Body>
</soapenv:Envelope>

My client code outputs this result:
    response:
    <?xml version="1.0" encoding="UTF-8"?>
    <muse-op:EquipmentOperationResponse
        xmlns:muse-op="http://cisco.com/musebox/cap/equip"
xmlns:tns="http://ws.apache.org/axis2">
        <Box xmlns:equ="http://cisco.com/musebox/cap/equip">
            <equ:Box>
                <box:name
xmlns:box="http://cisco.com/musebox/schemas/box">EPR ID:
MuseResource-2</box:name>
            </equ:Box>
        </Box>
    </muse-op:EquipmentOperationResponse>