org.apache.axiom.soap.SOAP12Constants Java Examples

The following examples show how to use org.apache.axiom.soap.SOAP12Constants. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WSXACMLMessageReceiver.java    From carbon-identity-framework with Apache License 2.0 6 votes vote down vote up
private SOAPEnvelope createDefaultSOAPEnvelope(MessageContext inMsgCtx) {

        String soapNamespace = inMsgCtx.getEnvelope().getNamespace()
                .getNamespaceURI();
        SOAPFactory soapFactory = null;
        if (soapNamespace.equals(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {
            soapFactory = OMAbstractFactory.getSOAP11Factory();
        } else if (soapNamespace
                .equals(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {
            soapFactory = OMAbstractFactory.getSOAP12Factory();
        } else {
            log.error("Unknown SOAP Envelope");
        }
        if (soapFactory != null) {
            return soapFactory.getDefaultEnvelope();
        }

        return null;
    }
 
Example #2
Source File: XdsTest.java    From openxds with Apache License 2.0 6 votes vote down vote up
protected Options getOptions(String action, boolean enableMTOM, String url) {
		Options options = new Options();
		options.setAction(action);		
	    options.setProperty(WSDL2Constants.ATTRIBUTE_MUST_UNDERSTAND,"1");
	    options.setTo( new EndpointReference(url) );
		options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
//		try {
//			String from = InetAddress.getLocalHost().getHostAddress();	
//			options.setFrom(new EndpointReference(from));
//		}catch(UnknownHostException e) {
//			//ignore From
//		}
		if (enableMTOM)
			options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
		else
			options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_FALSE);
		//use SOAP12, 
		options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
		return options;
	}
 
Example #3
Source File: WSXACMLMessageReceiver.java    From carbon-identity with Apache License 2.0 6 votes vote down vote up
private SOAPEnvelope createDefaultSOAPEnvelope(MessageContext inMsgCtx) {

        String soapNamespace = inMsgCtx.getEnvelope().getNamespace()
                .getNamespaceURI();
        SOAPFactory soapFactory = null;
        if (soapNamespace.equals(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {
            soapFactory = OMAbstractFactory.getSOAP11Factory();
        } else if (soapNamespace
                .equals(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {
            soapFactory = OMAbstractFactory.getSOAP12Factory();
        } else {
            log.error("Unknown SOAP Envelope");
        }
        if (soapFactory != null) {
            return soapFactory.getDefaultEnvelope();
        }

        return null;
    }
 
Example #4
Source File: DBDeployer.java    From micro-integrator with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a AxisBinding and populates it with default SOAP 1.2 properties
 */
private AxisBinding createDefaultSOAP12Binding(String name, String interfaceName) {
	AxisBinding soap12Binding = new AxisBinding();
	soap12Binding.setName(new QName(name + Java2WSDLConstants.SOAP12BINDING_NAME_SUFFIX));
	soap12Binding.setType(WSDL2Constants.URI_WSDL2_SOAP);
	soap12Binding.setProperty(WSDL2Constants.ATTR_WSOAP_PROTOCOL, WSDL2Constants.HTTP_PROTOCAL);
	soap12Binding.setProperty(WSDL2Constants.ATTR_WSOAP_VERSION, SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
	soap12Binding.setProperty(WSDL2Constants.INTERFACE_LOCAL_NAME, interfaceName);
	soap12Binding.setProperty(WSDL2Constants.HTTP_LOCATION_TABLE, httpLocationTable);
       soap12Binding.setProperty(WSDL2Constants.HTTP_LOCATION_TABLE_FOR_RESOURCE, httpLocationTableForResource);
	return soap12Binding;
}
 
Example #5
Source File: EntitlementMediator.java    From micro-integrator with Apache License 2.0 5 votes vote down vote up
private SOAPEnvelope createDefaultSOAPEnvelope(MessageContext inMsgCtx) {

        String soapNamespace = inMsgCtx.getEnvelope().getNamespace().getNamespaceURI();
        SOAPFactory soapFactory = null;
        if (soapNamespace.equals(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {
            soapFactory = OMAbstractFactory.getSOAP11Factory();
        } else if (soapNamespace.equals(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {
            soapFactory = OMAbstractFactory.getSOAP12Factory();
        } else {
            log.error("Unknown SOAP Envelope");
        }
        return soapFactory.getDefaultEnvelope();
    }
 
Example #6
Source File: DataServiceCallMediator.java    From micro-integrator with Apache License 2.0 5 votes vote down vote up
private SOAPEnvelope createDefaultSOAPEnvelope(MessageContext inMsgCtx) {

        String soapNamespace = inMsgCtx.getEnvelope().getNamespace().getNamespaceURI();
        SOAPFactory soapFactory = null;
        if (soapNamespace.equals(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {
            soapFactory = OMAbstractFactory.getSOAP11Factory();
        } else if (soapNamespace.equals(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {
            soapFactory = OMAbstractFactory.getSOAP12Factory();
        } else {
            log.error("Unknown SOAP Envelope");
        }
        return soapFactory.getDefaultEnvelope();
    }
 
Example #7
Source File: HeaderFactory.java    From garoon-google with MIT License 5 votes vote down vote up
/**
 * ヘッダ全体を表すノードを生成します。
 * @return org.apache.axiom.om.OMElement ヘッダ
 */
private static OMElement getHeaderElement() {
    OMFactory omFactory = OMAbstractFactory.getOMFactory();
    OMNamespace headerNs = omFactory.createOMNamespace(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI, "soapenv");
    OMElement soapHeader = omFactory.createOMElement("Header", headerNs);

    return soapHeader;
}
 
Example #8
Source File: OptionsFactory.java    From garoon-google with MIT License 5 votes vote down vote up
/**
 * パラメータを元に設定インスタンスを生成します。
 * 
 * @param uri URL
 * @param scheme スキーマ (ex:http,https,...)
 * @param actionName API名
 * @return org.apache.axis2.client.Options パラメータを元に生成された設定
 */
public static Options create(URI uri, String scheme, String actionName) {
    Options options = new Options();
    EndpointReference targetEPR = new EndpointReference(uri.toString());
    options.setTo(targetEPR);
    options.setTransportInProtocol(scheme);
    options.setProperty(HTTPConstants.CHUNKED, Constants.VALUE_FALSE);
    options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
    options.setAction(actionName);

    return options;
}
 
Example #9
Source File: TcpClient.java    From micro-integrator with Apache License 2.0 4 votes vote down vote up
public OMElement send12(String trpUrl, String action, OMElement payload, String contentType) throws AxisFault {

        Options options = new Options();
        options.setTo(new EndpointReference(trpUrl));
        options.setTransportInProtocol(Constants.TRANSPORT_TCP);
        options.setAction("urn:" + action);

        options.setProperty(Constants.Configuration.MESSAGE_TYPE, contentType);
        options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);

        serviceClient.engageModule(Constants.MODULE_ADDRESSING);

        serviceClient.setOptions(options);

        OMElement result = serviceClient.sendReceive(payload);

        return result;

    }
 
Example #10
Source File: TcpClient.java    From product-ei with Apache License 2.0 4 votes vote down vote up
public OMElement send12(String trpUrl, String action, OMElement payload, String contentType)
        throws AxisFault {

    Options options = new Options();
    options.setTo(new EndpointReference(trpUrl));
    options.setTransportInProtocol(Constants.TRANSPORT_TCP);
    options.setAction("urn:" + action);

    options.setProperty(Constants.Configuration.MESSAGE_TYPE, contentType);
    options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);

    serviceClient.engageModule(Constants.MODULE_ADDRESSING);

    serviceClient.setOptions(options);

    OMElement result = serviceClient.sendReceive(payload);

    return result;

}