cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nolan, Edell" <Edell.No...@iona.com>
Subject potential bug with the way DocLiteral matches its params to pick the correct operation.
Date Thu, 21 Feb 2008 12:50:34 GMT
Hi,

 

I am trying to verify that this is a bug before I create a jira.

 

I have a PortType that has two operations and I have implemented a Soap
binding using Document Literal.

 

String Op1(Type1);

String Op2(Type1, inout Type2)

 

When I try to invoke the first operation -The server side trys to
execute Op2 and not op1. 

 

Basically what appears to be happening is it is trying to match the
first parameter and when it gets that match - it chooses the operation
and continues. It searches through the list of operations and in this
case op2 is first in the list so the first param will match.

 

The code where I see this happening is 

 

It does a call from the DocLiteralInInterceptor.java

 

  if (msgInfo != null && msgInfo.getMessageParts() != null 

                    && msgInfo.getMessageParts().size() > 0) {

                    assert msgInfo.getMessageParts().size() > paramNum;

                    p = msgInfo.getMessageParts().get(paramNum);

                } else {

                    p = findMessagePart(exchange, operations, elName,
client, paramNum);

                }

 

.....

 

In AbstractInDatabindingInterceptor.java

 

  protected MessagePartInfo findMessagePart(Exchange exchange,
Collection<OperationInfo> operations,

                                              QName name, boolean
client, int index) {

        Endpoint ep = exchange.get(Endpoint.class);

        MessagePartInfo lastChoice = null;

        for (Iterator<OperationInfo> itr = operations.iterator();
itr.hasNext();) {

            OperationInfo op = itr.next();

 

            BindingOperationInfo boi =
ep.getEndpointInfo().getBinding().getOperation(op);

            if (boi == null) {

                continue;

            }

            BindingMessageInfo msgInfo = null;

            if (client) {

                msgInfo = boi.getOutput();

            } else {

                msgInfo = boi.getInput();

            }

 

            if (msgInfo == null) {

                itr.remove();

                continue;

            }

            

            Collection bodyParts = msgInfo.getMessageParts();

            if (bodyParts.size() == 0 || bodyParts.size() <= index) {

                itr.remove();

                continue;

            }

 

            MessagePartInfo p =
(MessagePartInfo)msgInfo.getMessageParts().get(index);

            if (name.getNamespaceURI() == null ||
name.getNamespaceURI().length() == 0) {

                // message part has same namespace with the message

                name = new
QName(p.getMessageInfo().getName().getNamespaceURI(),
name.getLocalPart());

            }

            if (name.equals(p.getConcreteName())) {

                exchange.put(BindingOperationInfo.class, boi);

                exchange.put(OperationInfo.class,
boi.getOperationInfo());

                exchange.setOneWay(op.isOneWay());

                return p;

            }

 

            if (XSD_ANY.equals(p.getTypeQName())) {

                lastChoice = p;

            } else {

                itr.remove();

            }

        }

        return lastChoice;

    }    

 

 

Should it also try to match the number of params as well or is this a
requirement 

where all the parameters need to be different ?

 

 

Thanks, Edell.

 

 

 


----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message