use of org.apache.axis2.description.AxisBinding in project wso2-synapse by wso2.
the class XFormURLEncodedBuilder method getSOAPFactory.
private SOAPFactory getSOAPFactory(MessageContext messageContext) throws AxisFault {
SOAPFactory soapFactory;
AxisEndpoint axisEndpoint = (AxisEndpoint) messageContext.getProperty(WSDL2Constants.ENDPOINT_LOCAL_NAME);
if (axisEndpoint != null) {
AxisBinding axisBinding = axisEndpoint.getBinding();
String soapVersion = (String) axisBinding.getProperty(WSDL2Constants.ATTR_WSOAP_VERSION);
soapFactory = getSOAPFactory(soapVersion);
} else {
soapFactory = getSOAPFactory(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
}
return soapFactory;
}
use of org.apache.axis2.description.AxisBinding in project wso2-synapse by wso2.
the class XFormURLEncodedBuilder method processDocumentWrapper.
/**
* @return Returns the document element.
*/
private OMElement processDocumentWrapper(InputStream inputStream, String contentType, MessageContext messageContext) throws AxisFault {
MultipleEntryHashMap parameterMap = new MultipleEntryHashMap();
SOAPFactory soapFactory;
AxisBindingOperation axisBindingOperation = (AxisBindingOperation) messageContext.getProperty(Constants.AXIS_BINDING_OPERATION);
String queryParameterSeparator = null;
String templatedPath = null;
if (axisBindingOperation != null) {
queryParameterSeparator = (String) axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR);
templatedPath = (String) axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_LOCATION);
}
if (queryParameterSeparator == null) {
queryParameterSeparator = WSDL20DefaultValueHolder.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR_DEFAULT;
}
AxisEndpoint axisEndpoint = (AxisEndpoint) messageContext.getProperty(WSDL2Constants.ENDPOINT_LOCAL_NAME);
if (axisEndpoint != null) {
AxisBinding axisBinding = axisEndpoint.getBinding();
String soapVersion = (String) axisBinding.getProperty(WSDL2Constants.ATTR_WSOAP_VERSION);
soapFactory = getSOAPFactory(soapVersion);
} else {
soapFactory = getSOAPFactory(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
}
EndpointReference endpointReference = messageContext.getTo();
if (endpointReference == null) {
throw new AxisFault("Cannot create DocumentElement without destination EPR");
}
String requestURL = endpointReference.getAddress();
try {
requestURL = extractParametersUsingHttpLocation(templatedPath, parameterMap, requestURL, queryParameterSeparator);
} catch (UnsupportedEncodingException e) {
throw AxisFault.makeFault(e);
}
String query = requestURL;
int index;
if ((index = requestURL.indexOf("?")) > -1) {
query = requestURL.substring(index + 1);
}
extractParametersFromRequest(parameterMap, query, queryParameterSeparator, (String) messageContext.getProperty(Constants.Configuration.CHARACTER_SET_ENCODING), inputStream);
messageContext.setProperty(Constants.REQUEST_PARAMETER_MAP, parameterMap);
return BuilderUtil.buildsoapMessage(messageContext, parameterMap, soapFactory);
}
use of org.apache.axis2.description.AxisBinding in project carbon-business-process by wso2.
the class BPELMessageContextFactory method extractBindingInformation.
private static Binding extractBindingInformation(final AxisService service, final Definition wsdlOfService, final MessageContext inMessageContext) {
AxisEndpoint currentEndpoint = (AxisEndpoint) inMessageContext.getProperty(WSDL2Constants.ENDPOINT_LOCAL_NAME);
if (currentEndpoint == null) {
String defaultEndpointName = service.getEndpointName();
currentEndpoint = service.getEndpoints().get(defaultEndpointName);
if (currentEndpoint == null) {
throw new NullPointerException("AxisEndpoint cannot be null.");
}
}
AxisBinding currentAxisBinding = currentEndpoint.getBinding();
QName bindingQName = currentAxisBinding.getName();
return wsdlOfService.getBinding(bindingQName);
}
Aggregations