You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-dev@ws.apache.org by "Vinh Nguyen (JIRA)" <ji...@apache.org> on 2006/11/30 03:57:21 UTC

[jira] Created: (MUSE-155) xml element capability result improperly changed when passed to the client (namespace and prefix not preserved)

xml element capability result improperly changed when passed to the client (namespace and prefix not preserved)
---------------------------------------------------------------------------------------------------------------

                 Key: MUSE-155
                 URL: http://issues.apache.org/jira/browse/MUSE-155
             Project: Muse
          Issue Type: Bug
    Affects Versions: 2.0.0
         Environment: Muse 2.0.0, Axis2 1.0, Apache 2.2.3, Tomcat 5.5.17, JDK 1.5.0_08, Windows XP SP2
            Reporter: Vinh Nguyen
         Assigned To: Dan Jemiolo


Muse is improperly changing the xml result of operations that return custom types.

For example, my code returns a custom <Box> type in an xml Element.  On the pass back to the client, Muse wraps the Element in a response wrapper.  In doing so, it improperly changes/deletes my element's namespace and prefix.  This causes problems on the client side when I try to extract out my element and deserialize back to a javabean.  The original namespace was moved/deleted and a default one was inserted, so it becomes difficult to extract the original element, and my code encounters errors due to mismatched namespaces.

Here's my server code:
    public Element boxOperation(int width) throws Exception
    {
        BoxDocument doc = BoxDocument.Factory.newInstance();
        BoxType type = doc.addNewBox();
        type.setWidth(BigInteger.valueOf(width));
        type.setHeight(BigInteger.valueOf(width));

        Element response = XmlUtils.getFirstElement(doc.newDomNode());
        System.out.println("--BoxCapability toString(response):\n" + XmlUtils.toString(response));
        return response;
    }

Here's the server log output:
    --BoxCapability toString(response):
    <?xml version="1.0" encoding="UTF-8"?>
    <box:Box xmlns:box="http://cisco.com/musebox/schemas/box">
        <box:width>555</box:width>
        <box:height>555</box:height>
    </box:Box>

On the client side, here's the SOAP trace of the incoming data:
    [CLIENT TRACE] SOAP envelope contents (incoming):
    ...
        <soapenv:Body>
            <muse-op:BoxOperationResponse
                xmlns:muse-op="http://cisco.com/musebox/simple/box" xmlns:tns="http://ws.apache.org/axis2">
                <Box xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:box="http://cisco.com/musebox/schemas/box">
                    <box:width>555</box:width>
                    <box:height>555</box:height>
                </Box>
            </muse-op:BoxOperationResponse>
        </soapenv:Body>
    </soapenv:Envelope>

If I modify my wsdl and remove one attribute line
(xmlns="http://schemas.xmlsoap.org/wsdl/") at the top of the file, I get the following client side SOAP trace instead:
    [CLIENT TRACE] SOAP envelope contents (incoming):
    ...
    <soapenv:Body>
            <muse-op:BoxOperationResponse
                xmlns:muse-op="http://cisco.com/musebox/simple/box" xmlns:tns="http://ws.apache.org/axis2">
                <Box xmlns:box="http://cisco.com/musebox/schemas/box">
                    <box:width>555</box:width>
                    <box:height>555</box:height>
                </Box>
            </muse-op:BoxOperationResponse>
        </soapenv:Body>
    </soapenv:Envelope>

NOTE: The difference between the two traces are the namespaces in the <Box> element.

If my client code calls XmlUtils.toString(XmlUtils.getFirstElement(response)), I get:
    <?xml version="1.0" encoding="UTF-8"?>
    <Box xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:box="http://cisco.com/musebox/schemas/box">
        <box:width>555</box:width>
        <box:height>555</box:height>
    </Box>

So there are 2 problems here:

1) Muse takes my operation output and puts on a response wrapper.  In doing so, it removes both the namespace and prefix of the <Box> element.
After removing the wrapper, the <Box> element now becomes useless because it has no namespace, even though namespaces for child elements are properly preserved.  This is why my client code is running into errors when trying to serialize the xml element back into a javabean (XmlBean object).  It tries to find/match the original namespace of the <Box> element, but it is nowhere to be found.

2) In addition to Muse removing the top element's namespace, it tries to put in a default one instead.  If my wsdl file contains the attribute
xmlns="http://schemas.xmlsoap.org/wsdl/"
(which is defined in the samples), then Muse will take this namespace and set it as the default in the <Box> element.  So my client code complains of a namespace mismatch.  (The namespace xmlns:tns="http://ws.apache.org/axis2" is also inserted either by Muse or Axis2, but it isn't causing problems at this moment.)

So I think Muse should either properly preserve the xml operation results exactly as is, or put in the correct element namespaces and not override incorrectly.  Muse does preserve notification outputs correctly, but it doesn't seem to do so for operations.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org


[jira] Commented: (MUSE-155) xml element capability result improperly changed when passed to the client (namespace and prefix not preserved)

Posted by "Vinh Nguyen (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/MUSE-155?page=comments#action_12454716 ] 
            
Vinh Nguyen commented on MUSE-155:
----------------------------------

Hi Dan,
I don't have a Tomcat server debugger setup, so it's hard for me to trace the server code.  What object creates the ReflectionMessageHandler?  Also, what object calls ReflectionMessageHandler.toXml()?  I want to trace where the "returnValueName" and "responseBodyName" values in this method are coming from, and what they are, since they are being passed to serializer.toXml().  I suspect this might pinpoint the cause of this issue a bit further.

I tested an implemention of a custom serializer for another custom Car object.  When my CarTypeSerializer.toXml() is called (and I assume from the default ReflectionMessageHandler), the second parameter is a QName containing the incorrect namespace:
http://schemas.xmlsoap.org/wsdl/}Car

The "http://schemas.xmlsoap.org/wsdl" namespace value seems to be coming from the xmlns="http://schemas.xmlsoap.org/wsdl/" attribute defined in the wsdl.

The result is an element with everything correct except the namespace of the topmost element:

--CarTypeSerializer.toXml() Printing XmlUtils.toString(response):
<?xml version="1.0" encoding="UTF-8"?>
<Car xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:car="http://cisco.com/musebox/schemas/car">
    <car:make xmlns:car="http://cisco.com/musebox/schemas/car">Honda</car:make>
    <car:model xmlns:car="http://cisco.com/musebox/schemas/car">Accord</car:model>
    <car:color xmlns:car="http://cisco.com/musebox/schemas/car">White</car:color>
</Car>

The problem seems to be near where the serializer is called on the server side.  This occurs after the capability method is called, and before the serialized xml result it sent to the client.  So somewhere in Muse even before the data is sent thru Axis2.  Hence, when CarTypeSerializer.fromXml() is called on the client side, it also runs into the same issues with the xml it receives.


> xml element capability result improperly changed when passed to the client (namespace and prefix not preserved)
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: MUSE-155
>                 URL: http://issues.apache.org/jira/browse/MUSE-155
>             Project: Muse
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>         Environment: Muse 2.0.0, Axis2 1.0, Apache 2.2.3, Tomcat 5.5.17, JDK 1.5.0_08, Windows XP SP2
>            Reporter: Vinh Nguyen
>         Assigned To: Dan Jemiolo
>
> Muse is improperly changing the xml result of operations that return custom types.
> For example, my code returns a custom <Box> type in an xml Element.  On the pass back to the client, Muse wraps the Element in a response wrapper.  In doing so, it improperly changes/deletes my element's namespace and prefix.  This causes problems on the client side when I try to extract out my element and deserialize back to a javabean.  The original namespace was moved/deleted and a default one was inserted, so it becomes difficult to extract the original element, and my code encounters errors due to mismatched namespaces.
> Here's my server code:
>     public Element boxOperation(int width) throws Exception
>     {
>         BoxDocument doc = BoxDocument.Factory.newInstance();
>         BoxType type = doc.addNewBox();
>         type.setWidth(BigInteger.valueOf(width));
>         type.setHeight(BigInteger.valueOf(width));
>         Element response = XmlUtils.getFirstElement(doc.newDomNode());
>         System.out.println("--BoxCapability toString(response):\n" + XmlUtils.toString(response));
>         return response;
>     }
> Here's the server log output:
>     --BoxCapability toString(response):
>     <?xml version="1.0" encoding="UTF-8"?>
>     <box:Box xmlns:box="http://cisco.com/musebox/schemas/box">
>         <box:width>555</box:width>
>         <box:height>555</box:height>
>     </box:Box>
> On the client side, here's the SOAP trace of the incoming data:
>     [CLIENT TRACE] SOAP envelope contents (incoming):
>     ...
>         <soapenv:Body>
>             <muse-op:BoxOperationResponse
>                 xmlns:muse-op="http://cisco.com/musebox/simple/box" xmlns:tns="http://ws.apache.org/axis2">
>                 <Box xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:box="http://cisco.com/musebox/schemas/box">
>                     <box:width>555</box:width>
>                     <box:height>555</box:height>
>                 </Box>
>             </muse-op:BoxOperationResponse>
>         </soapenv:Body>
>     </soapenv:Envelope>
> If I modify my wsdl and remove one attribute line
> (xmlns="http://schemas.xmlsoap.org/wsdl/") at the top of the file, I get the following client side SOAP trace instead:
>     [CLIENT TRACE] SOAP envelope contents (incoming):
>     ...
>     <soapenv:Body>
>             <muse-op:BoxOperationResponse
>                 xmlns:muse-op="http://cisco.com/musebox/simple/box" xmlns:tns="http://ws.apache.org/axis2">
>                 <Box xmlns:box="http://cisco.com/musebox/schemas/box">
>                     <box:width>555</box:width>
>                     <box:height>555</box:height>
>                 </Box>
>             </muse-op:BoxOperationResponse>
>         </soapenv:Body>
>     </soapenv:Envelope>
> NOTE: The difference between the two traces are the namespaces in the <Box> element.
> If my client code calls XmlUtils.toString(XmlUtils.getFirstElement(response)), I get:
>     <?xml version="1.0" encoding="UTF-8"?>
>     <Box xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:box="http://cisco.com/musebox/schemas/box">
>         <box:width>555</box:width>
>         <box:height>555</box:height>
>     </Box>
> So there are 2 problems here:
> 1) Muse takes my operation output and puts on a response wrapper.  In doing so, it removes both the namespace and prefix of the <Box> element.
> After removing the wrapper, the <Box> element now becomes useless because it has no namespace, even though namespaces for child elements are properly preserved.  This is why my client code is running into errors when trying to serialize the xml element back into a javabean (XmlBean object).  It tries to find/match the original namespace of the <Box> element, but it is nowhere to be found.
> 2) In addition to Muse removing the top element's namespace, it tries to put in a default one instead.  If my wsdl file contains the attribute
> xmlns="http://schemas.xmlsoap.org/wsdl/"
> (which is defined in the samples), then Muse will take this namespace and set it as the default in the <Box> element.  So my client code complains of a namespace mismatch.  (The namespace xmlns:tns="http://ws.apache.org/axis2" is also inserted either by Muse or Axis2, but it isn't causing problems at this moment.)
> So I think Muse should either properly preserve the xml operation results exactly as is, or put in the correct element namespaces and not override incorrectly.  Muse does preserve notification outputs correctly, but it doesn't seem to do so for operations.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org


[jira] Closed: (MUSE-155) xml element capability result improperly changed when passed to the client (namespace and prefix not preserved)

Posted by "Dan Jemiolo (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/MUSE-155?page=all ]

Dan Jemiolo closed MUSE-155.
----------------------------

    Resolution: Fixed

> xml element capability result improperly changed when passed to the client (namespace and prefix not preserved)
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: MUSE-155
>                 URL: http://issues.apache.org/jira/browse/MUSE-155
>             Project: Muse
>          Issue Type: Bug
>          Components: Core Engine - WSDL Processing
>    Affects Versions: 2.0.0
>         Environment: Muse 2.0.0, Axis2 1.0, Apache 2.2.3, Tomcat 5.5.17, JDK 1.5.0_08, Windows XP SP2
>            Reporter: Vinh Nguyen
>         Assigned To: Dan Jemiolo
>             Fix For: 2.1.0
>
>         Attachments: Box.xsd, SimpleResource.wsdl
>
>
> Muse is improperly changing the xml result of operations that return custom types.
> For example, my code returns a custom <Box> type in an xml Element.  On the pass back to the client, Muse wraps the Element in a response wrapper.  In doing so, it improperly changes/deletes my element's namespace and prefix.  This causes problems on the client side when I try to extract out my element and deserialize back to a javabean.  The original namespace was moved/deleted and a default one was inserted, so it becomes difficult to extract the original element, and my code encounters errors due to mismatched namespaces.
> Here's my server code:
>     public Element boxOperation(int width) throws Exception
>     {
>         BoxDocument doc = BoxDocument.Factory.newInstance();
>         BoxType type = doc.addNewBox();
>         type.setWidth(BigInteger.valueOf(width));
>         type.setHeight(BigInteger.valueOf(width));
>         Element response = XmlUtils.getFirstElement(doc.newDomNode());
>         System.out.println("--BoxCapability toString(response):\n" + XmlUtils.toString(response));
>         return response;
>     }
> Here's the server log output:
>     --BoxCapability toString(response):
>     <?xml version="1.0" encoding="UTF-8"?>
>     <box:Box xmlns:box="http://cisco.com/musebox/schemas/box">
>         <box:width>555</box:width>
>         <box:height>555</box:height>
>     </box:Box>
> On the client side, here's the SOAP trace of the incoming data:
>     [CLIENT TRACE] SOAP envelope contents (incoming):
>     ...
>         <soapenv:Body>
>             <muse-op:BoxOperationResponse
>                 xmlns:muse-op="http://cisco.com/musebox/simple/box" xmlns:tns="http://ws.apache.org/axis2">
>                 <Box xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:box="http://cisco.com/musebox/schemas/box">
>                     <box:width>555</box:width>
>                     <box:height>555</box:height>
>                 </Box>
>             </muse-op:BoxOperationResponse>
>         </soapenv:Body>
>     </soapenv:Envelope>
> If I modify my wsdl and remove one attribute line
> (xmlns="http://schemas.xmlsoap.org/wsdl/") at the top of the file, I get the following client side SOAP trace instead:
>     [CLIENT TRACE] SOAP envelope contents (incoming):
>     ...
>     <soapenv:Body>
>             <muse-op:BoxOperationResponse
>                 xmlns:muse-op="http://cisco.com/musebox/simple/box" xmlns:tns="http://ws.apache.org/axis2">
>                 <Box xmlns:box="http://cisco.com/musebox/schemas/box">
>                     <box:width>555</box:width>
>                     <box:height>555</box:height>
>                 </Box>
>             </muse-op:BoxOperationResponse>
>         </soapenv:Body>
>     </soapenv:Envelope>
> NOTE: The difference between the two traces are the namespaces in the <Box> element.
> If my client code calls XmlUtils.toString(XmlUtils.getFirstElement(response)), I get:
>     <?xml version="1.0" encoding="UTF-8"?>
>     <Box xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:box="http://cisco.com/musebox/schemas/box">
>         <box:width>555</box:width>
>         <box:height>555</box:height>
>     </Box>
> So there are 2 problems here:
> 1) Muse takes my operation output and puts on a response wrapper.  In doing so, it removes both the namespace and prefix of the <Box> element.
> After removing the wrapper, the <Box> element now becomes useless because it has no namespace, even though namespaces for child elements are properly preserved.  This is why my client code is running into errors when trying to serialize the xml element back into a javabean (XmlBean object).  It tries to find/match the original namespace of the <Box> element, but it is nowhere to be found.
> 2) In addition to Muse removing the top element's namespace, it tries to put in a default one instead.  If my wsdl file contains the attribute
> xmlns="http://schemas.xmlsoap.org/wsdl/"
> (which is defined in the samples), then Muse will take this namespace and set it as the default in the <Box> element.  So my client code complains of a namespace mismatch.  (The namespace xmlns:tns="http://ws.apache.org/axis2" is also inserted either by Muse or Axis2, but it isn't causing problems at this moment.)
> So I think Muse should either properly preserve the xml operation results exactly as is, or put in the correct element namespaces and not override incorrectly.  Muse does preserve notification outputs correctly, but it doesn't seem to do so for operations.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org


[jira] Updated: (MUSE-155) xml element capability result improperly changed when passed to the client (namespace and prefix not preserved)

Posted by "Vinh Nguyen (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/MUSE-155?page=all ]

Vinh Nguyen updated MUSE-155:
-----------------------------

    Attachment: SimpleResource.wsdl

Attached my test wsdl file for SimpleResource

> xml element capability result improperly changed when passed to the client (namespace and prefix not preserved)
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: MUSE-155
>                 URL: http://issues.apache.org/jira/browse/MUSE-155
>             Project: Muse
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>         Environment: Muse 2.0.0, Axis2 1.0, Apache 2.2.3, Tomcat 5.5.17, JDK 1.5.0_08, Windows XP SP2
>            Reporter: Vinh Nguyen
>         Assigned To: Dan Jemiolo
>         Attachments: SimpleResource.wsdl
>
>
> Muse is improperly changing the xml result of operations that return custom types.
> For example, my code returns a custom <Box> type in an xml Element.  On the pass back to the client, Muse wraps the Element in a response wrapper.  In doing so, it improperly changes/deletes my element's namespace and prefix.  This causes problems on the client side when I try to extract out my element and deserialize back to a javabean.  The original namespace was moved/deleted and a default one was inserted, so it becomes difficult to extract the original element, and my code encounters errors due to mismatched namespaces.
> Here's my server code:
>     public Element boxOperation(int width) throws Exception
>     {
>         BoxDocument doc = BoxDocument.Factory.newInstance();
>         BoxType type = doc.addNewBox();
>         type.setWidth(BigInteger.valueOf(width));
>         type.setHeight(BigInteger.valueOf(width));
>         Element response = XmlUtils.getFirstElement(doc.newDomNode());
>         System.out.println("--BoxCapability toString(response):\n" + XmlUtils.toString(response));
>         return response;
>     }
> Here's the server log output:
>     --BoxCapability toString(response):
>     <?xml version="1.0" encoding="UTF-8"?>
>     <box:Box xmlns:box="http://cisco.com/musebox/schemas/box">
>         <box:width>555</box:width>
>         <box:height>555</box:height>
>     </box:Box>
> On the client side, here's the SOAP trace of the incoming data:
>     [CLIENT TRACE] SOAP envelope contents (incoming):
>     ...
>         <soapenv:Body>
>             <muse-op:BoxOperationResponse
>                 xmlns:muse-op="http://cisco.com/musebox/simple/box" xmlns:tns="http://ws.apache.org/axis2">
>                 <Box xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:box="http://cisco.com/musebox/schemas/box">
>                     <box:width>555</box:width>
>                     <box:height>555</box:height>
>                 </Box>
>             </muse-op:BoxOperationResponse>
>         </soapenv:Body>
>     </soapenv:Envelope>
> If I modify my wsdl and remove one attribute line
> (xmlns="http://schemas.xmlsoap.org/wsdl/") at the top of the file, I get the following client side SOAP trace instead:
>     [CLIENT TRACE] SOAP envelope contents (incoming):
>     ...
>     <soapenv:Body>
>             <muse-op:BoxOperationResponse
>                 xmlns:muse-op="http://cisco.com/musebox/simple/box" xmlns:tns="http://ws.apache.org/axis2">
>                 <Box xmlns:box="http://cisco.com/musebox/schemas/box">
>                     <box:width>555</box:width>
>                     <box:height>555</box:height>
>                 </Box>
>             </muse-op:BoxOperationResponse>
>         </soapenv:Body>
>     </soapenv:Envelope>
> NOTE: The difference between the two traces are the namespaces in the <Box> element.
> If my client code calls XmlUtils.toString(XmlUtils.getFirstElement(response)), I get:
>     <?xml version="1.0" encoding="UTF-8"?>
>     <Box xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:box="http://cisco.com/musebox/schemas/box">
>         <box:width>555</box:width>
>         <box:height>555</box:height>
>     </Box>
> So there are 2 problems here:
> 1) Muse takes my operation output and puts on a response wrapper.  In doing so, it removes both the namespace and prefix of the <Box> element.
> After removing the wrapper, the <Box> element now becomes useless because it has no namespace, even though namespaces for child elements are properly preserved.  This is why my client code is running into errors when trying to serialize the xml element back into a javabean (XmlBean object).  It tries to find/match the original namespace of the <Box> element, but it is nowhere to be found.
> 2) In addition to Muse removing the top element's namespace, it tries to put in a default one instead.  If my wsdl file contains the attribute
> xmlns="http://schemas.xmlsoap.org/wsdl/"
> (which is defined in the samples), then Muse will take this namespace and set it as the default in the <Box> element.  So my client code complains of a namespace mismatch.  (The namespace xmlns:tns="http://ws.apache.org/axis2" is also inserted either by Muse or Axis2, but it isn't causing problems at this moment.)
> So I think Muse should either properly preserve the xml operation results exactly as is, or put in the correct element namespaces and not override incorrectly.  Muse does preserve notification outputs correctly, but it doesn't seem to do so for operations.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org


[jira] Commented: (MUSE-155) xml element capability result improperly changed when passed to the client (namespace and prefix not preserved)

Posted by "Dan Jemiolo (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/MUSE-155?page=comments#action_12454531 ] 
            
Dan Jemiolo commented on MUSE-155:
----------------------------------

I still think this is Axis2, not Muse. First, I can't find anywhere in the code where we set the WSDL/SOAP binding namespace, for any reason. Second, I can't find anywhere in the code where we modify the namespaces on the element returned to us by Resource.invoke(). Finally, the ReflectionMessageHandler, which wraps your response element in the wrapper, has the following code:

//
        // for complex types, we need a child element under the 
        // response body element
        //
        Element valueXML = ser.toXML(result, returnValueName);
        
        //
        // for arrays, we put the children (array items) under the 
        // response body element
        //
        if (returnType.isArray())
            XmlUtils.moveSubTree(valueXML, responseXML);
        
        else if (isComplex)
            responseXML.appendChild(valueXML);
        
        else
            responseXML = valueXML;
        
        return responseXML;


So, the ElementSerializer.toXML() method is called (which does nothing -just returns the given Element), and since your type is not an array, and is complex, the Element is appended to the wrapper. Then it is returned. After the above return statement, it's all pass throughs - giving the Element back to the isolation layer for return to the Axis2 engine.


> xml element capability result improperly changed when passed to the client (namespace and prefix not preserved)
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: MUSE-155
>                 URL: http://issues.apache.org/jira/browse/MUSE-155
>             Project: Muse
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>         Environment: Muse 2.0.0, Axis2 1.0, Apache 2.2.3, Tomcat 5.5.17, JDK 1.5.0_08, Windows XP SP2
>            Reporter: Vinh Nguyen
>         Assigned To: Dan Jemiolo
>
> Muse is improperly changing the xml result of operations that return custom types.
> For example, my code returns a custom <Box> type in an xml Element.  On the pass back to the client, Muse wraps the Element in a response wrapper.  In doing so, it improperly changes/deletes my element's namespace and prefix.  This causes problems on the client side when I try to extract out my element and deserialize back to a javabean.  The original namespace was moved/deleted and a default one was inserted, so it becomes difficult to extract the original element, and my code encounters errors due to mismatched namespaces.
> Here's my server code:
>     public Element boxOperation(int width) throws Exception
>     {
>         BoxDocument doc = BoxDocument.Factory.newInstance();
>         BoxType type = doc.addNewBox();
>         type.setWidth(BigInteger.valueOf(width));
>         type.setHeight(BigInteger.valueOf(width));
>         Element response = XmlUtils.getFirstElement(doc.newDomNode());
>         System.out.println("--BoxCapability toString(response):\n" + XmlUtils.toString(response));
>         return response;
>     }
> Here's the server log output:
>     --BoxCapability toString(response):
>     <?xml version="1.0" encoding="UTF-8"?>
>     <box:Box xmlns:box="http://cisco.com/musebox/schemas/box">
>         <box:width>555</box:width>
>         <box:height>555</box:height>
>     </box:Box>
> On the client side, here's the SOAP trace of the incoming data:
>     [CLIENT TRACE] SOAP envelope contents (incoming):
>     ...
>         <soapenv:Body>
>             <muse-op:BoxOperationResponse
>                 xmlns:muse-op="http://cisco.com/musebox/simple/box" xmlns:tns="http://ws.apache.org/axis2">
>                 <Box xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:box="http://cisco.com/musebox/schemas/box">
>                     <box:width>555</box:width>
>                     <box:height>555</box:height>
>                 </Box>
>             </muse-op:BoxOperationResponse>
>         </soapenv:Body>
>     </soapenv:Envelope>
> If I modify my wsdl and remove one attribute line
> (xmlns="http://schemas.xmlsoap.org/wsdl/") at the top of the file, I get the following client side SOAP trace instead:
>     [CLIENT TRACE] SOAP envelope contents (incoming):
>     ...
>     <soapenv:Body>
>             <muse-op:BoxOperationResponse
>                 xmlns:muse-op="http://cisco.com/musebox/simple/box" xmlns:tns="http://ws.apache.org/axis2">
>                 <Box xmlns:box="http://cisco.com/musebox/schemas/box">
>                     <box:width>555</box:width>
>                     <box:height>555</box:height>
>                 </Box>
>             </muse-op:BoxOperationResponse>
>         </soapenv:Body>
>     </soapenv:Envelope>
> NOTE: The difference between the two traces are the namespaces in the <Box> element.
> If my client code calls XmlUtils.toString(XmlUtils.getFirstElement(response)), I get:
>     <?xml version="1.0" encoding="UTF-8"?>
>     <Box xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:box="http://cisco.com/musebox/schemas/box">
>         <box:width>555</box:width>
>         <box:height>555</box:height>
>     </Box>
> So there are 2 problems here:
> 1) Muse takes my operation output and puts on a response wrapper.  In doing so, it removes both the namespace and prefix of the <Box> element.
> After removing the wrapper, the <Box> element now becomes useless because it has no namespace, even though namespaces for child elements are properly preserved.  This is why my client code is running into errors when trying to serialize the xml element back into a javabean (XmlBean object).  It tries to find/match the original namespace of the <Box> element, but it is nowhere to be found.
> 2) In addition to Muse removing the top element's namespace, it tries to put in a default one instead.  If my wsdl file contains the attribute
> xmlns="http://schemas.xmlsoap.org/wsdl/"
> (which is defined in the samples), then Muse will take this namespace and set it as the default in the <Box> element.  So my client code complains of a namespace mismatch.  (The namespace xmlns:tns="http://ws.apache.org/axis2" is also inserted either by Muse or Axis2, but it isn't causing problems at this moment.)
> So I think Muse should either properly preserve the xml operation results exactly as is, or put in the correct element namespaces and not override incorrectly.  Muse does preserve notification outputs correctly, but it doesn't seem to do so for operations.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org


[jira] Commented: (MUSE-155) xml element capability result improperly changed when passed to the client (namespace and prefix not preserved)

Posted by "Vinh Nguyen (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/MUSE-155?page=comments#action_12454772 ] 
            
Vinh Nguyen commented on MUSE-155:
----------------------------------

Ok, thanks so much Dan...it works!  I guess it's partly my fault for not using proper element format in my wsdl, and I didn't know because nothing was giving me an error.  Even XmlSpy wasn't complaining about my wsdl.  I'll use this format from now on.  So this fixes my xml element issue, and my custom serializer issue related to this.


> xml element capability result improperly changed when passed to the client (namespace and prefix not preserved)
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: MUSE-155
>                 URL: http://issues.apache.org/jira/browse/MUSE-155
>             Project: Muse
>          Issue Type: Bug
>          Components: Core Engine - WSDL Processing
>    Affects Versions: 2.0.0
>         Environment: Muse 2.0.0, Axis2 1.0, Apache 2.2.3, Tomcat 5.5.17, JDK 1.5.0_08, Windows XP SP2
>            Reporter: Vinh Nguyen
>         Assigned To: Dan Jemiolo
>             Fix For: 2.1.0
>
>         Attachments: Box.xsd, SimpleResource.wsdl
>
>
> Muse is improperly changing the xml result of operations that return custom types.
> For example, my code returns a custom <Box> type in an xml Element.  On the pass back to the client, Muse wraps the Element in a response wrapper.  In doing so, it improperly changes/deletes my element's namespace and prefix.  This causes problems on the client side when I try to extract out my element and deserialize back to a javabean.  The original namespace was moved/deleted and a default one was inserted, so it becomes difficult to extract the original element, and my code encounters errors due to mismatched namespaces.
> Here's my server code:
>     public Element boxOperation(int width) throws Exception
>     {
>         BoxDocument doc = BoxDocument.Factory.newInstance();
>         BoxType type = doc.addNewBox();
>         type.setWidth(BigInteger.valueOf(width));
>         type.setHeight(BigInteger.valueOf(width));
>         Element response = XmlUtils.getFirstElement(doc.newDomNode());
>         System.out.println("--BoxCapability toString(response):\n" + XmlUtils.toString(response));
>         return response;
>     }
> Here's the server log output:
>     --BoxCapability toString(response):
>     <?xml version="1.0" encoding="UTF-8"?>
>     <box:Box xmlns:box="http://cisco.com/musebox/schemas/box">
>         <box:width>555</box:width>
>         <box:height>555</box:height>
>     </box:Box>
> On the client side, here's the SOAP trace of the incoming data:
>     [CLIENT TRACE] SOAP envelope contents (incoming):
>     ...
>         <soapenv:Body>
>             <muse-op:BoxOperationResponse
>                 xmlns:muse-op="http://cisco.com/musebox/simple/box" xmlns:tns="http://ws.apache.org/axis2">
>                 <Box xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:box="http://cisco.com/musebox/schemas/box">
>                     <box:width>555</box:width>
>                     <box:height>555</box:height>
>                 </Box>
>             </muse-op:BoxOperationResponse>
>         </soapenv:Body>
>     </soapenv:Envelope>
> If I modify my wsdl and remove one attribute line
> (xmlns="http://schemas.xmlsoap.org/wsdl/") at the top of the file, I get the following client side SOAP trace instead:
>     [CLIENT TRACE] SOAP envelope contents (incoming):
>     ...
>     <soapenv:Body>
>             <muse-op:BoxOperationResponse
>                 xmlns:muse-op="http://cisco.com/musebox/simple/box" xmlns:tns="http://ws.apache.org/axis2">
>                 <Box xmlns:box="http://cisco.com/musebox/schemas/box">
>                     <box:width>555</box:width>
>                     <box:height>555</box:height>
>                 </Box>
>             </muse-op:BoxOperationResponse>
>         </soapenv:Body>
>     </soapenv:Envelope>
> NOTE: The difference between the two traces are the namespaces in the <Box> element.
> If my client code calls XmlUtils.toString(XmlUtils.getFirstElement(response)), I get:
>     <?xml version="1.0" encoding="UTF-8"?>
>     <Box xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:box="http://cisco.com/musebox/schemas/box">
>         <box:width>555</box:width>
>         <box:height>555</box:height>
>     </Box>
> So there are 2 problems here:
> 1) Muse takes my operation output and puts on a response wrapper.  In doing so, it removes both the namespace and prefix of the <Box> element.
> After removing the wrapper, the <Box> element now becomes useless because it has no namespace, even though namespaces for child elements are properly preserved.  This is why my client code is running into errors when trying to serialize the xml element back into a javabean (XmlBean object).  It tries to find/match the original namespace of the <Box> element, but it is nowhere to be found.
> 2) In addition to Muse removing the top element's namespace, it tries to put in a default one instead.  If my wsdl file contains the attribute
> xmlns="http://schemas.xmlsoap.org/wsdl/"
> (which is defined in the samples), then Muse will take this namespace and set it as the default in the <Box> element.  So my client code complains of a namespace mismatch.  (The namespace xmlns:tns="http://ws.apache.org/axis2" is also inserted either by Muse or Axis2, but it isn't causing problems at this moment.)
> So I think Muse should either properly preserve the xml operation results exactly as is, or put in the correct element namespaces and not override incorrectly.  Muse does preserve notification outputs correctly, but it doesn't seem to do so for operations.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org


[jira] Commented: (MUSE-155) xml element capability result improperly changed when passed to the client (namespace and prefix not preserved)

Posted by "Dan Jemiolo (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/MUSE-155?page=comments#action_12454978 ] 
            
Dan Jemiolo commented on MUSE-155:
----------------------------------

I've fixed this by adding a small method to XmlUtils named 'parseSchemaName()'. This method is used to parse the 'name' attribute, and it looks for targetNamespace instead of the default namespace. XmlUtils.parseQName() is still used on 'ref' attributes.

> xml element capability result improperly changed when passed to the client (namespace and prefix not preserved)
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: MUSE-155
>                 URL: http://issues.apache.org/jira/browse/MUSE-155
>             Project: Muse
>          Issue Type: Bug
>          Components: Core Engine - WSDL Processing
>    Affects Versions: 2.0.0
>         Environment: Muse 2.0.0, Axis2 1.0, Apache 2.2.3, Tomcat 5.5.17, JDK 1.5.0_08, Windows XP SP2
>            Reporter: Vinh Nguyen
>         Assigned To: Dan Jemiolo
>             Fix For: 2.1.0
>
>         Attachments: Box.xsd, SimpleResource.wsdl
>
>
> Muse is improperly changing the xml result of operations that return custom types.
> For example, my code returns a custom <Box> type in an xml Element.  On the pass back to the client, Muse wraps the Element in a response wrapper.  In doing so, it improperly changes/deletes my element's namespace and prefix.  This causes problems on the client side when I try to extract out my element and deserialize back to a javabean.  The original namespace was moved/deleted and a default one was inserted, so it becomes difficult to extract the original element, and my code encounters errors due to mismatched namespaces.
> Here's my server code:
>     public Element boxOperation(int width) throws Exception
>     {
>         BoxDocument doc = BoxDocument.Factory.newInstance();
>         BoxType type = doc.addNewBox();
>         type.setWidth(BigInteger.valueOf(width));
>         type.setHeight(BigInteger.valueOf(width));
>         Element response = XmlUtils.getFirstElement(doc.newDomNode());
>         System.out.println("--BoxCapability toString(response):\n" + XmlUtils.toString(response));
>         return response;
>     }
> Here's the server log output:
>     --BoxCapability toString(response):
>     <?xml version="1.0" encoding="UTF-8"?>
>     <box:Box xmlns:box="http://cisco.com/musebox/schemas/box">
>         <box:width>555</box:width>
>         <box:height>555</box:height>
>     </box:Box>
> On the client side, here's the SOAP trace of the incoming data:
>     [CLIENT TRACE] SOAP envelope contents (incoming):
>     ...
>         <soapenv:Body>
>             <muse-op:BoxOperationResponse
>                 xmlns:muse-op="http://cisco.com/musebox/simple/box" xmlns:tns="http://ws.apache.org/axis2">
>                 <Box xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:box="http://cisco.com/musebox/schemas/box">
>                     <box:width>555</box:width>
>                     <box:height>555</box:height>
>                 </Box>
>             </muse-op:BoxOperationResponse>
>         </soapenv:Body>
>     </soapenv:Envelope>
> If I modify my wsdl and remove one attribute line
> (xmlns="http://schemas.xmlsoap.org/wsdl/") at the top of the file, I get the following client side SOAP trace instead:
>     [CLIENT TRACE] SOAP envelope contents (incoming):
>     ...
>     <soapenv:Body>
>             <muse-op:BoxOperationResponse
>                 xmlns:muse-op="http://cisco.com/musebox/simple/box" xmlns:tns="http://ws.apache.org/axis2">
>                 <Box xmlns:box="http://cisco.com/musebox/schemas/box">
>                     <box:width>555</box:width>
>                     <box:height>555</box:height>
>                 </Box>
>             </muse-op:BoxOperationResponse>
>         </soapenv:Body>
>     </soapenv:Envelope>
> NOTE: The difference between the two traces are the namespaces in the <Box> element.
> If my client code calls XmlUtils.toString(XmlUtils.getFirstElement(response)), I get:
>     <?xml version="1.0" encoding="UTF-8"?>
>     <Box xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:box="http://cisco.com/musebox/schemas/box">
>         <box:width>555</box:width>
>         <box:height>555</box:height>
>     </Box>
> So there are 2 problems here:
> 1) Muse takes my operation output and puts on a response wrapper.  In doing so, it removes both the namespace and prefix of the <Box> element.
> After removing the wrapper, the <Box> element now becomes useless because it has no namespace, even though namespaces for child elements are properly preserved.  This is why my client code is running into errors when trying to serialize the xml element back into a javabean (XmlBean object).  It tries to find/match the original namespace of the <Box> element, but it is nowhere to be found.
> 2) In addition to Muse removing the top element's namespace, it tries to put in a default one instead.  If my wsdl file contains the attribute
> xmlns="http://schemas.xmlsoap.org/wsdl/"
> (which is defined in the samples), then Muse will take this namespace and set it as the default in the <Box> element.  So my client code complains of a namespace mismatch.  (The namespace xmlns:tns="http://ws.apache.org/axis2" is also inserted either by Muse or Axis2, but it isn't causing problems at this moment.)
> So I think Muse should either properly preserve the xml operation results exactly as is, or put in the correct element namespaces and not override incorrectly.  Muse does preserve notification outputs correctly, but it doesn't seem to do so for operations.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org


[jira] Updated: (MUSE-155) xml element capability result improperly changed when passed to the client (namespace and prefix not preserved)

Posted by "Vinh Nguyen (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/MUSE-155?page=all ]

Vinh Nguyen updated MUSE-155:
-----------------------------

    Attachment: Box.xsd

Attached xsd file which defines custom BoxType object used in SimpleResource.wsdl

> xml element capability result improperly changed when passed to the client (namespace and prefix not preserved)
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: MUSE-155
>                 URL: http://issues.apache.org/jira/browse/MUSE-155
>             Project: Muse
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>         Environment: Muse 2.0.0, Axis2 1.0, Apache 2.2.3, Tomcat 5.5.17, JDK 1.5.0_08, Windows XP SP2
>            Reporter: Vinh Nguyen
>         Assigned To: Dan Jemiolo
>         Attachments: Box.xsd, SimpleResource.wsdl
>
>
> Muse is improperly changing the xml result of operations that return custom types.
> For example, my code returns a custom <Box> type in an xml Element.  On the pass back to the client, Muse wraps the Element in a response wrapper.  In doing so, it improperly changes/deletes my element's namespace and prefix.  This causes problems on the client side when I try to extract out my element and deserialize back to a javabean.  The original namespace was moved/deleted and a default one was inserted, so it becomes difficult to extract the original element, and my code encounters errors due to mismatched namespaces.
> Here's my server code:
>     public Element boxOperation(int width) throws Exception
>     {
>         BoxDocument doc = BoxDocument.Factory.newInstance();
>         BoxType type = doc.addNewBox();
>         type.setWidth(BigInteger.valueOf(width));
>         type.setHeight(BigInteger.valueOf(width));
>         Element response = XmlUtils.getFirstElement(doc.newDomNode());
>         System.out.println("--BoxCapability toString(response):\n" + XmlUtils.toString(response));
>         return response;
>     }
> Here's the server log output:
>     --BoxCapability toString(response):
>     <?xml version="1.0" encoding="UTF-8"?>
>     <box:Box xmlns:box="http://cisco.com/musebox/schemas/box">
>         <box:width>555</box:width>
>         <box:height>555</box:height>
>     </box:Box>
> On the client side, here's the SOAP trace of the incoming data:
>     [CLIENT TRACE] SOAP envelope contents (incoming):
>     ...
>         <soapenv:Body>
>             <muse-op:BoxOperationResponse
>                 xmlns:muse-op="http://cisco.com/musebox/simple/box" xmlns:tns="http://ws.apache.org/axis2">
>                 <Box xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:box="http://cisco.com/musebox/schemas/box">
>                     <box:width>555</box:width>
>                     <box:height>555</box:height>
>                 </Box>
>             </muse-op:BoxOperationResponse>
>         </soapenv:Body>
>     </soapenv:Envelope>
> If I modify my wsdl and remove one attribute line
> (xmlns="http://schemas.xmlsoap.org/wsdl/") at the top of the file, I get the following client side SOAP trace instead:
>     [CLIENT TRACE] SOAP envelope contents (incoming):
>     ...
>     <soapenv:Body>
>             <muse-op:BoxOperationResponse
>                 xmlns:muse-op="http://cisco.com/musebox/simple/box" xmlns:tns="http://ws.apache.org/axis2">
>                 <Box xmlns:box="http://cisco.com/musebox/schemas/box">
>                     <box:width>555</box:width>
>                     <box:height>555</box:height>
>                 </Box>
>             </muse-op:BoxOperationResponse>
>         </soapenv:Body>
>     </soapenv:Envelope>
> NOTE: The difference between the two traces are the namespaces in the <Box> element.
> If my client code calls XmlUtils.toString(XmlUtils.getFirstElement(response)), I get:
>     <?xml version="1.0" encoding="UTF-8"?>
>     <Box xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:box="http://cisco.com/musebox/schemas/box">
>         <box:width>555</box:width>
>         <box:height>555</box:height>
>     </Box>
> So there are 2 problems here:
> 1) Muse takes my operation output and puts on a response wrapper.  In doing so, it removes both the namespace and prefix of the <Box> element.
> After removing the wrapper, the <Box> element now becomes useless because it has no namespace, even though namespaces for child elements are properly preserved.  This is why my client code is running into errors when trying to serialize the xml element back into a javabean (XmlBean object).  It tries to find/match the original namespace of the <Box> element, but it is nowhere to be found.
> 2) In addition to Muse removing the top element's namespace, it tries to put in a default one instead.  If my wsdl file contains the attribute
> xmlns="http://schemas.xmlsoap.org/wsdl/"
> (which is defined in the samples), then Muse will take this namespace and set it as the default in the <Box> element.  So my client code complains of a namespace mismatch.  (The namespace xmlns:tns="http://ws.apache.org/axis2" is also inserted either by Muse or Axis2, but it isn't causing problems at this moment.)
> So I think Muse should either properly preserve the xml operation results exactly as is, or put in the correct element namespaces and not override incorrectly.  Muse does preserve notification outputs correctly, but it doesn't seem to do so for operations.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org


[jira] Updated: (MUSE-155) xml element capability result improperly changed when passed to the client (namespace and prefix not preserved)

Posted by "Dan Jemiolo (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/MUSE-155?page=all ]

Dan Jemiolo updated MUSE-155:
-----------------------------

      Component/s: Core Engine - WSDL Processing
    Fix Version/s: 2.1.0

Okay, I've figured it out. When the WsdlUtils.getOutputPart() method tries to figure out the name of your return value (from the many ways you can specify it in WSDL 1.1), it's treating the 'name' attribute as a qualified name and then trying to resolve it. Because the string has no prefix, it tries to find the first default namespace. The first one that it comes to is at the root of the WSDL, where xmlns="the wsdl namespace".

The code should be modified so that only elements referred to with the 'ref' attribute are qualified names. Elements named with 'name' should have the schema's targetNamespace as their namespace.

I will look into how much effort this will take to fix - I think I can get it in for 2.1. Until then, if you want a workaround, change 

	<xsd:element name="Box" type="sc-box:BoxType"/>

to

	<xsd:element ref="sc-box:Box"/>


> xml element capability result improperly changed when passed to the client (namespace and prefix not preserved)
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: MUSE-155
>                 URL: http://issues.apache.org/jira/browse/MUSE-155
>             Project: Muse
>          Issue Type: Bug
>          Components: Core Engine - WSDL Processing
>    Affects Versions: 2.0.0
>         Environment: Muse 2.0.0, Axis2 1.0, Apache 2.2.3, Tomcat 5.5.17, JDK 1.5.0_08, Windows XP SP2
>            Reporter: Vinh Nguyen
>         Assigned To: Dan Jemiolo
>             Fix For: 2.1.0
>
>         Attachments: Box.xsd, SimpleResource.wsdl
>
>
> Muse is improperly changing the xml result of operations that return custom types.
> For example, my code returns a custom <Box> type in an xml Element.  On the pass back to the client, Muse wraps the Element in a response wrapper.  In doing so, it improperly changes/deletes my element's namespace and prefix.  This causes problems on the client side when I try to extract out my element and deserialize back to a javabean.  The original namespace was moved/deleted and a default one was inserted, so it becomes difficult to extract the original element, and my code encounters errors due to mismatched namespaces.
> Here's my server code:
>     public Element boxOperation(int width) throws Exception
>     {
>         BoxDocument doc = BoxDocument.Factory.newInstance();
>         BoxType type = doc.addNewBox();
>         type.setWidth(BigInteger.valueOf(width));
>         type.setHeight(BigInteger.valueOf(width));
>         Element response = XmlUtils.getFirstElement(doc.newDomNode());
>         System.out.println("--BoxCapability toString(response):\n" + XmlUtils.toString(response));
>         return response;
>     }
> Here's the server log output:
>     --BoxCapability toString(response):
>     <?xml version="1.0" encoding="UTF-8"?>
>     <box:Box xmlns:box="http://cisco.com/musebox/schemas/box">
>         <box:width>555</box:width>
>         <box:height>555</box:height>
>     </box:Box>
> On the client side, here's the SOAP trace of the incoming data:
>     [CLIENT TRACE] SOAP envelope contents (incoming):
>     ...
>         <soapenv:Body>
>             <muse-op:BoxOperationResponse
>                 xmlns:muse-op="http://cisco.com/musebox/simple/box" xmlns:tns="http://ws.apache.org/axis2">
>                 <Box xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:box="http://cisco.com/musebox/schemas/box">
>                     <box:width>555</box:width>
>                     <box:height>555</box:height>
>                 </Box>
>             </muse-op:BoxOperationResponse>
>         </soapenv:Body>
>     </soapenv:Envelope>
> If I modify my wsdl and remove one attribute line
> (xmlns="http://schemas.xmlsoap.org/wsdl/") at the top of the file, I get the following client side SOAP trace instead:
>     [CLIENT TRACE] SOAP envelope contents (incoming):
>     ...
>     <soapenv:Body>
>             <muse-op:BoxOperationResponse
>                 xmlns:muse-op="http://cisco.com/musebox/simple/box" xmlns:tns="http://ws.apache.org/axis2">
>                 <Box xmlns:box="http://cisco.com/musebox/schemas/box">
>                     <box:width>555</box:width>
>                     <box:height>555</box:height>
>                 </Box>
>             </muse-op:BoxOperationResponse>
>         </soapenv:Body>
>     </soapenv:Envelope>
> NOTE: The difference between the two traces are the namespaces in the <Box> element.
> If my client code calls XmlUtils.toString(XmlUtils.getFirstElement(response)), I get:
>     <?xml version="1.0" encoding="UTF-8"?>
>     <Box xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:box="http://cisco.com/musebox/schemas/box">
>         <box:width>555</box:width>
>         <box:height>555</box:height>
>     </Box>
> So there are 2 problems here:
> 1) Muse takes my operation output and puts on a response wrapper.  In doing so, it removes both the namespace and prefix of the <Box> element.
> After removing the wrapper, the <Box> element now becomes useless because it has no namespace, even though namespaces for child elements are properly preserved.  This is why my client code is running into errors when trying to serialize the xml element back into a javabean (XmlBean object).  It tries to find/match the original namespace of the <Box> element, but it is nowhere to be found.
> 2) In addition to Muse removing the top element's namespace, it tries to put in a default one instead.  If my wsdl file contains the attribute
> xmlns="http://schemas.xmlsoap.org/wsdl/"
> (which is defined in the samples), then Muse will take this namespace and set it as the default in the <Box> element.  So my client code complains of a namespace mismatch.  (The namespace xmlns:tns="http://ws.apache.org/axis2" is also inserted either by Muse or Axis2, but it isn't causing problems at this moment.)
> So I think Muse should either properly preserve the xml operation results exactly as is, or put in the correct element namespaces and not override incorrectly.  Muse does preserve notification outputs correctly, but it doesn't seem to do so for operations.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org