Search in sources :

Example 6 with ClientConfigFeature

use of org.jboss.ws.api.configuration.ClientConfigFeature in project jbossws-cxf by jbossws.

the class Helper method testCustomClientConfigurationOnDispatchFromFileUsingFeature.

public boolean testCustomClientConfigurationOnDispatchFromFileUsingFeature() throws Exception {
    Service service = Service.create(new URL(address + "?wsdl"), serviceName);
    Dispatch<SOAPMessage> dispatch = service.createDispatch(portName, SOAPMessage.class, Mode.MESSAGE, new ClientConfigFeature("META-INF/jaxws-client-config.xml", "Custom Client Config", true));
    return ((DispatchImpl<?>) dispatch).getClient().getEndpoint().get("propA").equals("fileValueA");
}
Also used : ClientConfigFeature(org.jboss.ws.api.configuration.ClientConfigFeature) Service(javax.xml.ws.Service) SOAPMessage(javax.xml.soap.SOAPMessage) URL(java.net.URL)

Example 7 with ClientConfigFeature

use of org.jboss.ws.api.configuration.ClientConfigFeature in project jbossws-cxf by jbossws.

the class Helper method testCustomClientConfigurationFromFileUsingFeature.

public boolean testCustomClientConfigurationFromFileUsingFeature() throws Exception {
    Service service = Service.create(new URL(address + "?wsdl"), serviceName);
    Endpoint port = (Endpoint) service.getPort(Endpoint.class, new ClientConfigFeature("META-INF/jaxws-client-config.xml", "Custom Client Config", true));
    return ClientProxy.getClient(port).getEndpoint().get("propA").equals("fileValueA");
}
Also used : ClientConfigFeature(org.jboss.ws.api.configuration.ClientConfigFeature) Service(javax.xml.ws.Service) URL(java.net.URL)

Example 8 with ClientConfigFeature

use of org.jboss.ws.api.configuration.ClientConfigFeature in project jbossws-cxf by jbossws.

the class Helper method testCustomClientConfigurationUsingFeature.

public boolean testCustomClientConfigurationUsingFeature() throws Exception {
    final URL wsdlURL = new URL(address + "?wsdl");
    final String testConfigName = "MyTestConfig";
    try {
        // -- add test client configuration
        TestUtils.addTestCaseClientConfiguration(testConfigName);
        // --
        Service service = Service.create(wsdlURL, serviceName);
        Endpoint port = (Endpoint) service.getPort(Endpoint.class, new ClientConfigFeature(null, testConfigName, true));
        org.apache.cxf.endpoint.Endpoint ep = ClientProxy.getClient(port).getEndpoint();
        ep.put("propZ", "valueZ");
        return (ep.get("propT").equals("valueT") && ep.get("propZ").equals("valueZ"));
    } finally {
        // -- remove test client configuration --
        TestUtils.removeTestCaseClientConfiguration(testConfigName);
    // --
    }
}
Also used : ClientConfigFeature(org.jboss.ws.api.configuration.ClientConfigFeature) Service(javax.xml.ws.Service) URL(java.net.URL)

Aggregations

URL (java.net.URL)8 Service (javax.xml.ws.Service)8 ClientConfigFeature (org.jboss.ws.api.configuration.ClientConfigFeature)8 QName (javax.xml.namespace.QName)4 BindingProvider (javax.xml.ws.BindingProvider)4 Handler (javax.xml.ws.handler.Handler)4 SOAPMessage (javax.xml.soap.SOAPMessage)2 Source (javax.xml.transform.Source)2 DOMSource (javax.xml.transform.dom.DOMSource)2