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) {
SoapBody soapBody = SOAPBindingUtil.getBindingInputSOAPBody(bop); if (soapBody != null) { List<?> parts = soapBody.getParts(); int boundPartSize = parts == null ? inmessagePartsCount : parts.size(); SoapHeader soapHeader = SOAPBindingUtil.getBindingInputSOAPHeader(bop);
private boolean isRPCEncoded(Definition def) { Iterator<?> ite1 = def.getBindings().values().iterator(); while (ite1.hasNext()) { Binding binding = (Binding)ite1.next(); String bindingStyle = SOAPBindingUtil.getBindingStyle(binding); Iterator<?> ite2 = binding.getBindingOperations().iterator(); while (ite2.hasNext()) { BindingOperation bop = (BindingOperation)ite2.next(); String bopStyle = SOAPBindingUtil.getSOAPOperationStyle(bop); String outputUse = ""; if (SOAPBindingUtil.getBindingOutputSOAPBody(bop) != null) { outputUse = SOAPBindingUtil.getBindingOutputSOAPBody(bop).getUse(); } String inputUse = ""; if (SOAPBindingUtil.getBindingInputSOAPBody(bop) != null) { inputUse = SOAPBindingUtil.getBindingInputSOAPBody(bop).getUse(); } if ((SOAPBinding.Style.RPC.name().equalsIgnoreCase(bindingStyle) || SOAPBinding.Style.RPC .name().equalsIgnoreCase(bopStyle)) && (SOAPBinding.Use.ENCODED.name().equalsIgnoreCase(inputUse) || SOAPBinding.Use.ENCODED .name().equalsIgnoreCase(outputUse))) { return true; } } } return false; }
private SoapBody getSoapBody(Class<?> parent) throws ToolException { if (extReg == null) { extReg = wsdlFactory.newPopulatedExtensionRegistry(); } SoapBody soapBody = null; try { soapBody = SOAPBindingUtil.createSoapBody(extReg, parent, isSOAP12()); } catch (WSDLException wse) { Message msg = new Message("FAIL_TO_CREATE_SOAPBINDING", LOG); throw new ToolException(msg, wse); } soapBody.setUse((String)env.get(ToolConstants.CFG_USE)); if (WSDLConstants.RPC.equalsIgnoreCase((String)env.get(ToolConstants.CFG_STYLE)) && env.optionSet(ToolConstants.CFG_NAMESPACE)) { soapBody.setNamespaceURI((String)env.get(ToolConstants.CFG_NAMESPACE)); } return soapBody; }
BindingInput.class, isSoap12); body.setUse("literal"); if (isRpc) { body.setNamespaceURI(b.getName().getNamespaceURI()); body.setParts(bodyParts); BindingOutput.class, isSoap12); body.setUse("literal"); if (isRpc) { body.setNamespaceURI(b.getName().getNamespaceURI()); body.setParts(bodyParts);
BindingInput.class, isSoap12); body.setUse("literal"); if (isRpc) { body.setNamespaceURI(b.getName().getNamespaceURI()); body.setParts(bodyParts); BindingOutput.class, isSoap12); body.setUse("literal"); if (isRpc) { body.setNamespaceURI(b.getName().getNamespaceURI()); body.setParts(bodyParts);
private SoapBody getSoapBody(Class<?> parent) throws ToolException { if (extReg == null) { extReg = wsdlFactory.newPopulatedExtensionRegistry(); } SoapBody soapBody = null; try { soapBody = SOAPBindingUtil.createSoapBody(extReg, parent, isSOAP12()); } catch (WSDLException wse) { Message msg = new Message("FAIL_TO_CREATE_SOAPBINDING", LOG); throw new ToolException(msg, wse); } soapBody.setUse((String)env.get(ToolConstants.CFG_USE)); if (WSDLConstants.RPC.equalsIgnoreCase((String)env.get(ToolConstants.CFG_STYLE)) && env.optionSet(ToolConstants.CFG_NAMESPACE)) { soapBody.setNamespaceURI((String)env.get(ToolConstants.CFG_NAMESPACE)); } return soapBody; }
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) {
SoapBody soapBody = SOAPBindingUtil.getBindingInputSOAPBody(bop); if (soapBody != null) { List<?> parts = soapBody.getParts(); int boundPartSize = parts == null ? inmessagePartsCount : parts.size(); SoapHeader soapHeader = SOAPBindingUtil.getBindingInputSOAPHeader(bop);
if (SOAPBindingUtil.isSOAPBody(ext)) { SoapBody soapBody = SOAPBindingUtil.getSoapBody(ext); use = soapBody.getUse(); } else if (SOAPBindingUtil.isSOAPHeader(ext)) { processSoapHeader(jm, operation, ext);
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; }
SoapBody soapBody = SOAPBindingUtil.getBindingOutputSOAPBody(bop); if (soapBody != null) { List<?> parts = soapBody.getParts(); int boundPartSize = parts == null ? outmessagePartsCount : parts.size(); SoapHeader soapHeader = SOAPBindingUtil.getBindingOutputSOAPHeader(bop);
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; }
SoapBody soapBody = SOAPBindingUtil.getBindingOutputSOAPBody(bop); if (soapBody != null) { List<?> parts = soapBody.getParts(); int boundPartSize = parts == null ? outmessagePartsCount : parts.size(); SoapHeader soapHeader = SOAPBindingUtil.getBindingOutputSOAPHeader(bop);