boolean clientMode = isClientModeOn(context); while (STAXUtils.toNextElement(dr))
if (!STAXUtils.toNextElement(dr))
/** * Reads a message. Because this is a server-side message binding, the messages we will be *reading* * are request messages. Therefore, this method finds the operation whose input message name matches * the name of the request element, sets that operation in the context, looks up the binding for that * operation, and delegates the rest of the read to the binding. * * @param message The message to read. * @param context The context. * @see org.codehaus.xfire.jaxws.JAXWSBinding */ public void readMessage(InMessage message, MessageContext context) throws XFireFault { Service endpoint = context.getService(); DepthXMLStreamReader dr = new DepthXMLStreamReader(message.getXMLStreamReader()); if (!STAXUtils.toNextElement(dr)) { throw new XFireFault("There must be a method name element.", XFireFault.SENDER); } QName messageName = dr.getName(); OperationInfo opInfo = findOperation(endpoint, messageName); if (opInfo == null) { throw new XFireFault("Unknown operation: " + messageName, XFireFault.SENDER); } context.getExchange().setOperation(opInfo); EnunciatedJAXWSOperationBinding binding = op2Binding.get(opInfo); if (binding == null) { binding = new EnunciatedJAXWSOperationBinding(opInfo); op2Binding.put(opInfo, binding); } binding.readMessage(message, context); }
/** * Reads a message. Because this is a server-side message binding, the messages we will be *reading* * are request messages. Therefore, this method finds the operation whose input message name matches * the name of the request element, sets that operation in the context, looks up the binding for that * operation, and delegates the rest of the read to the binding. * * @param message The message to read. * @param context The context. * @see org.codehaus.xfire.jaxws.JAXWSBinding */ public void readMessage(InMessage message, MessageContext context) throws XFireFault { Service endpoint = context.getService(); DepthXMLStreamReader dr = new DepthXMLStreamReader(message.getXMLStreamReader()); if (!STAXUtils.toNextElement(dr)) { throw new XFireFault("There must be a method name element.", XFireFault.SENDER); } QName messageName = dr.getName(); OperationInfo opInfo = findOperation(endpoint, messageName); if (opInfo == null) { throw new XFireFault("Unknown operation: " + messageName, XFireFault.SENDER); } context.getExchange().setOperation(opInfo); EnunciatedJAXWSOperationBinding binding = op2Binding.get(opInfo); if (binding == null) { binding = new EnunciatedJAXWSOperationBinding(opInfo); op2Binding.put(opInfo, binding); } binding.readMessage(message, context); }
STAXUtils.toNextElement(reader); STAXUtils.toNextElement(reader); STAXUtils.toNextElement(reader);
DepthXMLStreamReader dr = new DepthXMLStreamReader(context.getInMessage().getXMLStreamReader()); if ( !STAXUtils.toNextElement(dr) ) throw new XFireFault("There must be a method name element.", XFireFault.SENDER); msg = operation.getInputMessage(); while(STAXUtils.toNextElement(dr))
/** * Reads a message. Because this is a client-side message binding, the messages we will be *reading* * are response messages. Therefore, this method finds the operation in the current exchange, verifies * that the element is correct for this operation's *output* message name, and then delegates the rest * of the read to the operation binding. * * @param message The message to read. * @param context The context. * @see org.codehaus.xfire.jaxws.JAXWSBinding */ public void readMessage(InMessage message, MessageContext context) throws XFireFault { DepthXMLStreamReader dr = new DepthXMLStreamReader(context.getInMessage().getXMLStreamReader()); if (!STAXUtils.toNextElement(dr)) { throw new XFireFault("There must be a method name element.", XFireFault.SENDER); } QName responseElementName = dr.getName(); OperationInfo op = context.getExchange().getOperation(); if (op == null) { throw new XFireFault("No operation in the current exchange: " + responseElementName, XFireFault.SENDER); } MessageInfo outMessage = op.getOutputMessage(); if (outMessage == null) { throw new XFireFault("No output message in the current operation!", XFireFault.SENDER); } else if (!responseElementName.equals(outMessage.getName())) { throw new XFireFault("Incorrect response message name: " + responseElementName, XFireFault.SENDER); } getOperationBinding(op).readMessage(message, context); }
/** * Reads a message. Because this is a client-side message binding, the messages we will be *reading* * are response messages. Therefore, this method finds the operation in the current exchange, verifies * that the element is correct for this operation's *output* message name, and then delegates the rest * of the read to the operation binding. * * @param message The message to read. * @param context The context. * @see org.codehaus.xfire.jaxws.JAXWSBinding */ public void readMessage(InMessage message, MessageContext context) throws XFireFault { DepthXMLStreamReader dr = new DepthXMLStreamReader(context.getInMessage().getXMLStreamReader()); if (!STAXUtils.toNextElement(dr)) { throw new XFireFault("There must be a method name element.", XFireFault.SENDER); } QName responseElementName = dr.getName(); OperationInfo op = context.getExchange().getOperation(); if (op == null) { throw new XFireFault("No operation in the current exchange: " + responseElementName, XFireFault.SENDER); } MessageInfo outMessage = op.getOutputMessage(); if (outMessage == null) { throw new XFireFault("No output message in the current operation!", XFireFault.SENDER); } else if (!responseElementName.equals(outMessage.getName())) { throw new XFireFault("Incorrect response message name: " + responseElementName, XFireFault.SENDER); } getOperationBinding(op).readMessage(message, context); }
public void readMessage(InMessage message, MessageContext context) throws XFireFault { Service endpoint = context.getService(); DepthXMLStreamReader dr = new DepthXMLStreamReader(context.getInMessage().getXMLStreamReader()); if ( !STAXUtils.toNextElement(dr) ) throw new XFireFault("There must be a method name element.", XFireFault.SENDER); OperationInfo op = context.getExchange().getOperation(); if (!isClientModeOn(context) && op == null) { op = endpoint.getServiceInfo().getOperation( dr.getLocalName() ); if (op != null) { setOperation(op, context); JAXWSOperationBinding opBinding = getOperationBinding(op); opBinding.readMessage(message, context); return; } } delegate.readMessage(message, context); }
public void readMessage(InMessage inMessage, MessageContext context) throws XFireFault { Service endpoint = context.getService(); DepthXMLStreamReader dr = new DepthXMLStreamReader(context.getInMessage().getXMLStreamReader()); if ( !STAXUtils.toNextElement(dr) ) throw new XFireFault("There must be a method name element.", XFireFault.SENDER); OperationInfo op = context.getExchange().getOperation(); if (!isClientModeOn(context) && op == null) { op = endpoint.getServiceInfo().getOperation( dr.getLocalName() ); if (op == null) { throw new XFireFault("Invalid operation: " + dr.getName(), XFireFault.SENDER); } setOperation(op, context); } // Move from Operation element to whitespace or start element nextEvent(dr); read(inMessage, context, null); }