/** * The qname of the particle for this web result. If the {@link #getParticleType() particle type} is * TYPE then it's the qname of the xml type. Otherwise, it's the qname of the implicit schema * element. * * @return The qname of the particle for this web result as a part. */ public QName getParticleQName() { if (method.getSoapBindingStyle() == SOAPBinding.Style.RPC && !isHeader()) { return getTypeQName(); } else { return new QName(getTargetNamespace(), getElementName()); } }
public TemplateModel get(String key) throws TemplateModelException { if ("name".equals(key)) { return this.wrapper.wrap(result.getName()); } else if ("targetNamespace".equals(key)) { return this.wrapper.wrap(result.getTargetNamespace()); } else if ("partName".equals(key)) { return this.wrapper.wrap(result.getPartName()); } else if ("webMethod".equals(key)) { return this.wrapper.wrap(result.getWebMethod()); } else { return ((TemplateHashModel) this.wrapper.wrap(result.getType())).get(key); } }
public TemplateModel get(String key) throws TemplateModelException { if ("name".equals(key)) { return this.wrapper.wrap(result.getName()); } else if ("targetNamespace".equals(key)) { return this.wrapper.wrap(result.getTargetNamespace()); } else if ("partName".equals(key)) { return this.wrapper.wrap(result.getPartName()); } else if ("webMethod".equals(key)) { return this.wrapper.wrap(result.getWebMethod()); } else { return ((TemplateHashModel) this.wrapper.wrap(result.getType())).get(key); } }
/** * Gets the client-side package for the type, type declaration, package, or their string values. * * @param list The arguments. * @return The string value of the client-side package. */ public Object exec(List list) throws TemplateModelException { if (list.size() < 1) { throw new TemplateModelException("The responseDocumentQName method method must have a web method as a parameter."); } TemplateModel from = (TemplateModel) list.get(0); Object unwrapped = new BeansWrapperBuilder(Configuration.getVersion()).build().unwrap(from); if (!(unwrapped instanceof WebMethod)) { throw new TemplateModelException("A web method must be provided."); } WebMethod webMethod = (WebMethod) unwrapped; if (webMethod.getSoapBindingStyle() != SOAPBinding.Style.DOCUMENT || webMethod.getSoapUse() != SOAPBinding.Use.LITERAL) { throw new TemplateModelException("No response document qname available for a " + webMethod.getSoapBindingStyle() + "/" + webMethod.getSoapUse() + " web method."); } if (webMethod.getResponseWrapper() != null) { return new QName(webMethod.getResponseWrapper().getElementNamespace(), webMethod.getResponseWrapper().getElementName()); } else if (webMethod.getSoapParameterStyle() == SOAPBinding.ParameterStyle.BARE) { WebResult wr = webMethod.getWebResult(); if (!wr.isHeader()) { return new QName(wr.getTargetNamespace(), wr.getElementName()); } } return null; }
/** * Gets the client-side package for the type, type declaration, package, or their string values. * * @param list The arguments. * @return The string value of the client-side package. */ public Object exec(List list) throws TemplateModelException { if (list.size() < 1) { throw new TemplateModelException("The responseDocumentQName method method must have a web method as a parameter."); } TemplateModel from = (TemplateModel) list.get(0); Object unwrapped = new BeansWrapperBuilder(Configuration.getVersion()).build().unwrap(from); if (!(unwrapped instanceof WebMethod)) { throw new TemplateModelException("A web method must be provided."); } WebMethod webMethod = (WebMethod) unwrapped; if (webMethod.getSoapBindingStyle() != SOAPBinding.Style.DOCUMENT || webMethod.getSoapUse() != SOAPBinding.Use.LITERAL) { throw new TemplateModelException("No response document qname available for a " + webMethod.getSoapBindingStyle() + "/" + webMethod.getSoapUse() + " web method."); } if (webMethod.getResponseWrapper() != null) { return new QName(webMethod.getResponseWrapper().getElementNamespace(), webMethod.getResponseWrapper().getElementName()); } else if (webMethod.getSoapParameterStyle() == SOAPBinding.ParameterStyle.BARE) { WebResult wr = webMethod.getWebResult(); if (!wr.isHeader()) { return new QName(wr.getTargetNamespace(), wr.getElementName()); } } return null; }