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 2007/06/14 11:12:26 UTC

[jira] Created: (MUSE-238) ReflectionProxyHandler creates an Element even for a null parameter

ReflectionProxyHandler creates an Element even for a null parameter
-------------------------------------------------------------------

                 Key: MUSE-238
                 URL: https://issues.apache.org/jira/browse/MUSE-238
             Project: Muse
          Issue Type: Bug
            Reporter: Vinh Nguyen
            Assignee: Dan Jemiolo


There is a bug in ReflectionProxyHandler.toXML().  It creates an element node for an operation parameter even if the parameter value is null.  This causes errors on the server when an operation allows a null parameter, but the Muse serializers throw an error because they receive an actual Element for the parameter.

I noticed this because in the Subscribe operation, I can specify a null expiration date, and the corresponding element does not show up in the SOAP request.  So it goes thru fine.  But if I define an Unsubscribe operation, the generated proxy uses the ReflectionProxyHandler, and I get errors.

I attempted to test my Unsubscribe by passing a null EPR, and the SOAP request looked like this:

    <soap:Body>
        <pfx0:Unsubscribe xmlns:pfx0="http://docs.oasis-open.org/wsn/b-2">
            <pfx0:EndpointReference/>
        </pfx0:Unsubscribe>
    </soap:Body>

Then on the server side, the EndpointReference serializer threw this error:

[ID = 'InvalidAddressURI'] Invalid wsa:Address URI: null
	org.apache.muse.ws.addressing.EndpointReference.initializeFromXML(EndpointReference.java:541)
	org.apache.muse.ws.addressing.EndpointReference.<init>(EndpointReference.java:132)
	org.apache.muse.ws.addressing.EndpointReference.<init>(EndpointReference.java:91)
	com.cisco.nm.cmp.nbi.wsdm.common.serializer.addressing.EndpointReferenceSerializer.fromXML(EndpointReferenceSerializer.java:36)
	org.apache.muse.core.routing.ReflectionMessageHandler.fromXML(ReflectionMessageHandler.java:132)

So there is some inconsistencies between the proxy handlers used within Muse code, and the ReflectionProxyHandler used in the wsdl2java generated proxies.

The simple fix is at the end of the ReflectionProxyHandler.toXML() method where it loops thru and calls serialize() for each parameter name/value.  It should first check if a value is null, it doesn't need to create the corresponding Element to insert into the final request message.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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