printSoapHeaderFaults(soapHeader.getSOAPHeaderFaults(), def, pw);
/** * Create a SOAPHeader element */ protected SOAPHeader writeSOAPHeader(ParameterDesc p, QName messageQName, String partName) { SOAPHeaderImpl soapHeader = new SOAPHeaderImpl(); // for now, if its document, it is literal use. if (use == Use.ENCODED) { soapHeader.setUse("encoded"); soapHeader.setEncodingStyles(encodingList); } else { soapHeader.setUse("literal"); } // Set namespace if (targetService == null) { soapHeader.setNamespaceURI(intfNS); } else { soapHeader.setNamespaceURI(targetService); } QName headerQName = p.getQName(); if ((headerQName != null) && !headerQName.getNamespaceURI().equals("")) { soapHeader.setNamespaceURI(headerQName.getNamespaceURI()); } // Set the Message and Part information soapHeader.setMessage(messageQName); soapHeader.setPart(partName); return soapHeader; }
/** * Get the addressURl from the Extensibility element. * * @param exElement - ExtensibilityElement * @param endpointWithApiContext Endpoint (gateway host + api context) which will replace the WSDL endpoints * @throws APIMgtWSDLException If an error occurred while updating endpoints */ private void setAddressUrl(Object exElement, String endpointWithApiContext) throws APIMgtWSDLException { if (exElement instanceof SOAP12AddressImpl) { ((SOAP12AddressImpl) exElement).setLocationURI(endpointWithApiContext); } else if (exElement instanceof SOAPAddressImpl) { ((SOAPAddressImpl) exElement).setLocationURI(endpointWithApiContext); } else if (exElement instanceof HTTPAddressImpl) { ((HTTPAddressImpl) exElement).setLocationURI(endpointWithApiContext); } else { throw new APIMgtWSDLException("Unsupported WSDL Extensibility element", ExceptionCodes.UNSUPPORTED_WSDL_EXTENSIBILITY_ELEMENT); } }
public PopulatedExtensionRegistry() SOAPAddressSerializer soapAddressSer = new SOAPAddressSerializer(); SOAPAddressImpl.class); SOAPBindingSerializer soapBindingSer = new SOAPBindingSerializer(); SOAPBindingImpl.class); SOAPHeaderSerializer soapHeaderSer = new SOAPHeaderSerializer(); SOAPHeaderImpl.class); SOAPBodySerializer soapBodySer = new SOAPBodySerializer(); SOAPBodyImpl.class); SOAPFaultSerializer soapFaultSer = new SOAPFaultSerializer(); SOAPFaultImpl.class); SOAPOperationSerializer soapOperationSer = new SOAPOperationSerializer();
private BindingInputImpl addBindingInput(Definition def, String methodName, UnknownExtensibilityElement wsPolicyRef) { BindingInputImpl bindingInput = (BindingInputImpl) def.createBindingInput(); bindingInput.setName(methodName + GFacSchemaConstants.SERVICE_REQ_MSG_SUFFIX); if (wsPolicyRef != null) { log.info("policy info is not null"); bindingInput.addExtensibilityElement(wsPolicyRef); } SOAPBodyImpl inputExtension = new SOAPBodyImpl(); inputExtension.setUse(LITERAL); bindingInput.addExtensibilityElement(inputExtension); return bindingInput; }
public Port createPort(Endpoint endpoint, WSDLBuilder builder, javax.wsdl.Binding wbinding) { SOAPAddressImpl add = new SOAPAddressImpl(); add.setLocationURI(endpoint.getUrl()); Port port = builder.getDefinition().createPort(); port.setBinding( wbinding ); port.setName( endpoint.getName().getLocalPart() ); port.addExtensibilityElement( add ); return port; }
/** * Get the addressURl from the Extensibility element. * * @param exElement ExtensibilityElement * @return {@link String} * @throws APIMgtWSDLException when the extensibility element is not supported */ private String getAddressUrl(Object exElement) throws APIMgtWSDLException { if (exElement instanceof SOAP12AddressImpl) { return ((SOAP12AddressImpl) exElement).getLocationURI(); } else if (exElement instanceof SOAPAddressImpl) { return ((SOAPAddressImpl) exElement).getLocationURI(); } else if (exElement instanceof HTTPAddressImpl) { return ((HTTPAddressImpl) exElement).getLocationURI(); } else { throw new APIMgtWSDLException("Unsupported WSDL Extensibility element", ExceptionCodes.UNSUPPORTED_WSDL_EXTENSIBILITY_ELEMENT); } }
protected SOAPBinding createSoapBinding() { SOAPBinding soapBind = new SOAPBindingImpl(); String style = getStyle(); if (style.equals(SoapConstants.STYLE_WRAPPED)) style = SoapConstants.STYLE_DOCUMENT; soapBind.setStyle( style ); soapBind.setTransportURI( getBindingId() ); return soapBind; }
SOAPBody soapBody = new SOAPBodyImpl();
protected SOAPHeader createSoapHeader( Service endpoint ) { String use = getUse(); SOAPHeader header = new SOAPHeaderImpl(); header.setUse( use ); if ( use.equals( SoapConstants.USE_ENCODED ) ) { List encodingStyles = new ArrayList(); encodingStyles.add( getSoapVersion().getSoapEncodingStyle() ); header.setEncodingStyles(encodingStyles); } return header; }
/** * Create binding template for a WSDL port that has soap:address * * @param bindingTemplate bindingTemplate reference * @param port WSDL port * @param address Endpoint address * @return bindingTemplate object */ private BindingTemplate createBindingTemplateForSOAP11(BindingTemplate bindingTemplate, PortImpl port, Object address) { bindingTemplate = new BindingTemplate(); SOAPAddressImpl soapAddress = (SOAPAddressImpl) address; String endpoint = soapAddress.getLocationURI(); AccessPoint accessPoint = new AccessPoint(); accessPoint.setValue(endpoint); accessPoint.setUseType(UDDIConstants.END_POINT); bindingTemplate.setAccessPoint(accessPoint); TModelInstanceDetails tModelinstanceDetails = constructTModelInstanceDetails(port); bindingTemplate.setTModelInstanceDetails(tModelinstanceDetails); return bindingTemplate; }
/** * Ensure the SOAP Binding defined is valid. A SOAP Binding must have a style of rpc or document * or no style defined (defaults to document.) A valid (non empty) URI must also be specified. * * @param element The SOAP binding element. * @param parents A list of parents of the SOAP binding element. * @param valInfo The validation info for this validation. */ protected void validateBinding(Object element, List parents, IWSDL11ValidationInfo valInfo) { SOAPBindingImpl sb = (SOAPBindingImpl)element; String style = sb.getStyle(); String uri = sb.getTransportURI(); if (style != null && !style.equalsIgnoreCase(RPC) && !style.equalsIgnoreCase(DOCUMENT)) { valInfo.addError( messagegenerator.getString(_ERROR_INVALID_BINDING_STYLE, QUOTE + sb.getStyle() + QUOTE), element); } if (uri.equalsIgnoreCase(EMPTY_STRING)) { valInfo.addError(messagegenerator.getString(_ERROR_INVALID_BINDING_URI), element); } }
parseSoapHeaderFault(SOAPHeader.class, SOAPConstants.Q_ELEM_SOAP_HEADER_FAULT, tempEl,
/** * Returns the actionURI for the given operation * * @param operationName * @return * @throws UnknownOperationException */ public String getSOAPActionURI(String operationName) throws UnknownOperationException { String result = null; BindingOperation op = getBindingOperation(operationName); List elements = op.getExtensibilityElements(); for (Iterator elIterator = elements.iterator(); elIterator.hasNext();) { SOAPOperationImpl extension = (SOAPOperationImpl) elIterator.next(); result = extension.getSoapActionURI(); break; } return result; }
private BindingInputImpl addBindingInput(Definition def, String methodName, UnknownExtensibilityElement wsPolicyRef) { BindingInputImpl bindingInput = (BindingInputImpl) def.createBindingInput(); bindingInput.setName(methodName + GFacSchemaConstants.SERVICE_REQ_MSG_SUFFIX); if (wsPolicyRef != null) { log.debug("policy info is not null"); bindingInput.addExtensibilityElement(wsPolicyRef); } SOAPBodyImpl inputExtension = new SOAPBodyImpl(); inputExtension.setUse(LITERAL); bindingInput.addExtensibilityElement(inputExtension); return bindingInput; }
/** * Get the addressURl from the Extensibility element. * * @param exElement ExtensibilityElement * @return {@link String} * @throws APIMgtWSDLException when the extensibility element is not supported */ private String getAddressUrl(Object exElement) throws APIMgtWSDLException { if (exElement instanceof SOAP12AddressImpl) { return ((SOAP12AddressImpl) exElement).getLocationURI(); } else if (exElement instanceof SOAPAddressImpl) { return ((SOAPAddressImpl) exElement).getLocationURI(); } else if (exElement instanceof HTTPAddressImpl) { return ((HTTPAddressImpl) exElement).getLocationURI(); } else { throw new APIMgtWSDLException("Unsupported WSDL Extensibility element", ExceptionCodes.UNSUPPORTED_WSDL_EXTENSIBILITY_ELEMENT); } }
/** * Get the addressURl from the Extensibility element. * * @param exElement - ExtensibilityElement * @param endpointWithApiContext Endpoint (gateway host + api context) which will replace the WSDL endpoints * @throws APIMgtWSDLException If an error occurred while updating endpoints */ private void setAddressUrl(Object exElement, String endpointWithApiContext) throws APIMgtWSDLException { if (exElement instanceof SOAP12AddressImpl) { ((SOAP12AddressImpl) exElement).setLocationURI(endpointWithApiContext); } else if (exElement instanceof SOAPAddressImpl) { ((SOAPAddressImpl) exElement).setLocationURI(endpointWithApiContext); } else if (exElement instanceof HTTPAddressImpl) { ((HTTPAddressImpl) exElement).setLocationURI(endpointWithApiContext); } else { throw new APIMgtWSDLException("Unsupported WSDL Extensibility element", ExceptionCodes.UNSUPPORTED_WSDL_EXTENSIBILITY_ELEMENT); } }
private BindingOutputImpl addBindingOutput(Definition def, String methodName, OutputParameterType[] outputParams, UnknownExtensibilityElement wsPolicyRef) { // specify output only if there are output parameters BindingOutputImpl bindingOutput = null; if (outputParams.length > 0) { bindingOutput = (BindingOutputImpl) def.createBindingOutput(); bindingOutput.setName(methodName + GFacSchemaConstants.SERVICE_RESP_MSG_SUFFIX); if (wsPolicyRef != null) { log.debug("policy info is not null"); bindingOutput.addExtensibilityElement(wsPolicyRef); } SOAPBodyImpl outputExtension = new SOAPBodyImpl(); outputExtension.setUse(LITERAL); bindingOutput.addExtensibilityElement(outputExtension); } return bindingOutput; }
/** * Get the addressURl from the Extensibility element * @param exElement - {@link ExtensibilityElement} * @return {@link String} * @throws org.wso2.carbon.appmgt.api.AppManagementException */ private String getAddressUrl(ExtensibilityElement exElement) throws AppManagementException { if (exElement instanceof SOAP12AddressImpl) { return ((SOAP12AddressImpl) exElement).getLocationURI(); } else if (exElement instanceof SOAPAddressImpl) { return ((SOAPAddressImpl) exElement).getLocationURI(); } else if (exElement instanceof HTTPAddressImpl) { return ((HTTPAddressImpl) exElement).getLocationURI(); } else { String msg = "Unsupported WSDL errors!"; log.error(msg); throw new AppManagementException(msg); } }
private BindingOutputImpl addBindingOutput(Definition def, String methodName, OutputParameterType[] outputParams, UnknownExtensibilityElement wsPolicyRef) { // specify output only if there are output parameters BindingOutputImpl bindingOutput = null; if (outputParams.length > 0) { bindingOutput = (BindingOutputImpl) def.createBindingOutput(); bindingOutput.setName(methodName + GFacSchemaConstants.SERVICE_RESP_MSG_SUFFIX); if (wsPolicyRef != null) { log.info("policy info is not null"); bindingOutput.addExtensibilityElement(wsPolicyRef); } SOAPBodyImpl outputExtension = new SOAPBodyImpl(); outputExtension.setUse(LITERAL); bindingOutput.addExtensibilityElement(outputExtension); } return bindingOutput; }