private BindingOperationInfo getOperation(Message message, QName opName) { BindingOperationInfo bop = ServiceModelUtil.getOperation(message.getExchange(), opName); if (bop == null) { Endpoint ep = message.getExchange().getEndpoint(); if (ep == null) { return null; } BindingInfo service = ep.getEndpointInfo().getBinding(); boolean output = !isRequestor(message); for (BindingOperationInfo info : service.getOperations()) { if (info.getName().getLocalPart().equals(opName.getLocalPart())) { SoapBody body = null; if (output) { body = info.getOutput().getExtensor(SoapBody.class); } else { body = info.getInput().getExtensor(SoapBody.class); } if (body != null && opName.getNamespaceURI().equals(body.getNamespaceURI())) { return info; } } } } return bop; } public void handleMessage(Message message) {
private BindingOperationInfo getOperation(Message message, QName opName) { BindingOperationInfo bop = ServiceModelUtil.getOperation(message.getExchange(), opName); if (bop == null) { Endpoint ep = message.getExchange().getEndpoint(); if (ep == null) { return null; } BindingInfo service = ep.getEndpointInfo().getBinding(); boolean output = !isRequestor(message); for (BindingOperationInfo info : service.getOperations()) { if (info.getName().getLocalPart().equals(opName.getLocalPart())) { SoapBody body = null; if (output) { body = info.getOutput().getExtensor(SoapBody.class); } else { body = info.getInput().getExtensor(SoapBody.class); } if (body != null && opName.getNamespaceURI().equals(body.getNamespaceURI())) { return info; } } } } return bop; } public void handleMessage(Message message) {
if (body != null && opName.getNamespaceURI().equals(body.getNamespaceURI()))
protected String addOperationNode(NSStack nsStack, Message message, XMLStreamWriter xmlWriter, boolean output, BindingOperationInfo boi) throws XMLStreamException { String ns = boi.getName().getNamespaceURI(); SoapBody body = null; if (output) { body = boi.getOutput().getExtensor(SoapBody.class); } else { body = boi.getInput().getExtensor(SoapBody.class); } if (body != null) { final String nsUri = body.getNamespaceURI(); //do it once, as it might internally use reflection... if (!StringUtils.isEmpty(nsUri)) { ns = nsUri; } } nsStack.add(ns); String prefix = nsStack.getPrefix(ns); String name = output ? boi.getName().getLocalPart() + "Response" : boi.getName().getLocalPart(); StaxUtils.writeStartElement(xmlWriter, prefix, name, ns); return ns; }
protected String addOperationNode(NSStack nsStack, Message message, XMLStreamWriter xmlWriter, boolean output, BindingOperationInfo boi) throws XMLStreamException { String ns = boi.getName().getNamespaceURI(); SoapBody body = null; if (output) { body = boi.getOutput().getExtensor(SoapBody.class); } else { body = boi.getInput().getExtensor(SoapBody.class); } if (body != null) { final String nsUri = body.getNamespaceURI(); //do it once, as it might internally use reflection... if (!StringUtils.isEmpty(nsUri)) { ns = nsUri; } } nsStack.add(ns); String prefix = nsStack.getPrefix(ns); String name = output ? boi.getName().getLocalPart() + "Response" : boi.getName().getLocalPart(); StaxUtils.writeStartElement(xmlWriter, prefix, name, ns); return ns; }
private boolean checkR2716(final BindingOperation bop) { SoapBody inSoapBody = SOAPBindingUtil.getBindingInputSOAPBody(bop); SoapBody outSoapBody = SOAPBindingUtil.getBindingOutputSOAPBody(bop); if (inSoapBody != null && !StringUtils.isEmpty(inSoapBody.getNamespaceURI()) || outSoapBody != null && !StringUtils.isEmpty(outSoapBody.getNamespaceURI())) { addErrorMessage(getErrorPrefix("WSI-BP-1.0 R2716") + "Operation '" + bop.getName() + "' soapBody MUST NOT have namespace attribute"); return false; } SoapHeader inSoapHeader = SOAPBindingUtil.getBindingInputSOAPHeader(bop); SoapHeader outSoapHeader = SOAPBindingUtil.getBindingOutputSOAPHeader(bop); if (inSoapHeader != null && !StringUtils.isEmpty(inSoapHeader.getNamespaceURI()) || outSoapHeader != null && !StringUtils.isEmpty(outSoapHeader.getNamespaceURI())) { addErrorMessage(getErrorPrefix("WSI-BP-1.0 R2716") + "Operation '" + bop.getName() + "' soapHeader MUST NOT have namespace attribute"); return false; } List<SoapFault> soapFaults = SOAPBindingUtil.getBindingOperationSoapFaults(bop); for (SoapFault fault : soapFaults) { if (!StringUtils.isEmpty(fault.getNamespaceURI())) { addErrorMessage(getErrorPrefix("WSI-BP-1.0 R2716") + "Operation '" + bop.getName() + "' soapFault MUST NOT have namespace attribute"); return false; } } return true; }
if (inSoapBody != null && StringUtils.isEmpty(inSoapBody.getNamespaceURI()) || outSoapBody != null && StringUtils.isEmpty(outSoapBody.getNamespaceURI())) { addErrorMessage(getErrorPrefix("WSI-BP-1.0 R2717") + "soapBody in the input/output of the binding operation '"
private boolean checkR2716(final BindingOperation bop) { SoapBody inSoapBody = SOAPBindingUtil.getBindingInputSOAPBody(bop); SoapBody outSoapBody = SOAPBindingUtil.getBindingOutputSOAPBody(bop); if (inSoapBody != null && !StringUtils.isEmpty(inSoapBody.getNamespaceURI()) || outSoapBody != null && !StringUtils.isEmpty(outSoapBody.getNamespaceURI())) { addErrorMessage(getErrorPrefix("WSI-BP-1.0 R2716") + "Operation '" + bop.getName() + "' soapBody MUST NOT have namespace attribute"); return false; } SoapHeader inSoapHeader = SOAPBindingUtil.getBindingInputSOAPHeader(bop); SoapHeader outSoapHeader = SOAPBindingUtil.getBindingOutputSOAPHeader(bop); if (inSoapHeader != null && !StringUtils.isEmpty(inSoapHeader.getNamespaceURI()) || outSoapHeader != null && !StringUtils.isEmpty(outSoapHeader.getNamespaceURI())) { addErrorMessage(getErrorPrefix("WSI-BP-1.0 R2716") + "Operation '" + bop.getName() + "' soapHeader MUST NOT have namespace attribute"); return false; } List<SoapFault> soapFaults = SOAPBindingUtil.getBindingOperationSoapFaults(bop); for (SoapFault fault : soapFaults) { if (!StringUtils.isEmpty(fault.getNamespaceURI())) { addErrorMessage(getErrorPrefix("WSI-BP-1.0 R2716") + "Operation '" + bop.getName() + "' soapFault MUST NOT have namespace attribute"); return false; } } return true; }
if (inSoapBody != null && StringUtils.isEmpty(inSoapBody.getNamespaceURI()) || outSoapBody != null && StringUtils.isEmpty(outSoapBody.getNamespaceURI())) { addErrorMessage(getErrorPrefix("WSI-BP-1.0 R2717") + "soapBody in the input/output of the binding operation '"