use of org.apache.axis2.addressing.metadata.WSDLLocation in project axis-axis2-java-core by apache.
the class ProxyTests method testInvoke.
@Test
public void testInvoke() throws Exception {
if (!runningOnAxis) {
return;
}
TestLogger.logger.debug("---------------------------------------");
File wsdl = new File(wsdlLocation);
URL wsdlUrl = wsdl.toURI().toURL();
Service service = Service.create(null, serviceName);
String request = new String("some string request");
Object proxy = service.getPort(portName, DocLitWrappedProxy.class);
TestLogger.logger.debug(">>Invoking Binding Provider property");
BindingProvider p = (BindingProvider) proxy;
p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, getEndpoint());
DocLitWrappedProxy dwp = (DocLitWrappedProxy) proxy;
TestLogger.logger.debug(">> Invoking Proxy Synchronously");
String response = dwp.invoke(request);
TestLogger.logger.debug("Proxy Response =" + response);
// Try again
response = dwp.invoke(request);
TestLogger.logger.debug("Proxy Response =" + response);
TestLogger.logger.debug("---------------------------------------");
}
use of org.apache.axis2.addressing.metadata.WSDLLocation in project axis-axis2-java-core by apache.
the class ProxyTests method testInvokeAsyncPolling.
@Test
public void testInvokeAsyncPolling() throws Exception {
TestLogger.logger.debug("---------------------------------------");
File wsdl = new File(wsdlLocation);
URL wsdlUrl = wsdl.toURI().toURL();
Service service = Service.create(null, serviceName);
DocLitWrappedProxy proxy = service.getPort(portName, DocLitWrappedProxy.class);
String request = new String("some string request");
TestLogger.logger.debug(">> Invoking Binding Provider property");
BindingProvider p = (BindingProvider) proxy;
p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, getEndpoint());
TestLogger.logger.debug(">> Invoking Proxy with async polling request");
Response<ReturnType> asyncResponse = proxy.invokeAsync(request);
await(asyncResponse);
ReturnType response = asyncResponse.get();
assertNotNull(response);
// Try again
asyncResponse = proxy.invokeAsync(request);
await(asyncResponse);
response = asyncResponse.get();
assertNotNull(response);
}
use of org.apache.axis2.addressing.metadata.WSDLLocation in project axis-axis2-java-core by apache.
the class ProxyTests method testInvokeWithWSDL.
@Test
public void testInvokeWithWSDL() throws Exception {
if (!runningOnAxis) {
return;
}
TestLogger.logger.debug("---------------------------------------");
File wsdl = new File(wsdlLocation);
URL wsdlUrl = wsdl.toURI().toURL();
Service service = Service.create(wsdlUrl, serviceName);
String request = new String("some string request");
Object proxy = service.getPort(portName, DocLitWrappedProxy.class);
TestLogger.logger.debug(">>Invoking Binding Provider property");
BindingProvider p = (BindingProvider) proxy;
p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, getEndpoint());
DocLitWrappedProxy dwp = (DocLitWrappedProxy) proxy;
TestLogger.logger.debug(">> Invoking Proxy Synchronously");
String response = dwp.invoke(request);
TestLogger.logger.debug("Proxy Response =" + response);
// Try again
response = dwp.invoke(request);
TestLogger.logger.debug("Proxy Response =" + response);
TestLogger.logger.debug("---------------------------------------");
}
use of org.apache.axis2.addressing.metadata.WSDLLocation in project axis-axis2-java-core by apache.
the class RPCProxyTests method getProxy.
/**
* Utility method to get the proxy
* @return RPCLit proxy
* @throws MalformedURLException
*/
public RPCLit getProxy() throws Exception {
File wsdl = new File(wsdlLocation);
URL wsdlUrl = wsdl.toURI().toURL();
Service service = Service.create(null, serviceName);
Object proxy = service.getPort(portName, RPCLit.class);
BindingProvider p = (BindingProvider) proxy;
p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, server.getEndpoint("RPCLitService.RPCLitImplPort"));
return (RPCLit) proxy;
}
use of org.apache.axis2.addressing.metadata.WSDLLocation in project axis-axis2-java-core by apache.
the class ServiceDescriptionImpl method setWSDLDefinitionOnDBC.
/**
* This method accepts a location of a WSDL document and attempts to
* load and set the WSDL definition on the DBC object.
* @param wsdlLocation
*/
private void setWSDLDefinitionOnDBC(String wsdlLocation) {
if (log.isDebugEnabled()) {
log.debug("Attempting to load WSDL file from location specified in annotation: " + wsdlLocation);
}
if (composite.getClassLoader() == null) {
if (log.isDebugEnabled()) {
log.debug("A classloader could not be found for class: " + composite.getClassName() + ". The WSDL file: " + wsdlLocation + " will not be " + "processed, and the ServiceDescription will be built from " + "annotations");
}
}
try {
if (log.isDebugEnabled()) {
log.debug("Attempting to read WSDL: " + wsdlLocation + " for web " + "service endpoint: " + composite.getClassName());
}
if (log.isDebugEnabled()) {
if (configContext != null) {
log.debug("new WSDL4JWrapper-ConfigContext not null5");
} else {
log.debug("new WSDL4JWrapper-ConfigContext null5");
}
}
URL url = getWSDLURL(wsdlLocation);
ConfigurationContext cc = composite.getConfigurationContext();
if (cc != null) {
this.wsdlWrapper = new WSDL4JWrapper(url, cc, this.catalogManager);
} else {
// Probably shouldn't get here. But if we do, use a memory sensitive
// wsdl wrapper
this.wsdlWrapper = new WSDL4JWrapper(url, this.catalogManager, true, 2);
}
composite.setWsdlDefinition(wsdlWrapper.getDefinition());
} catch (Exception e) {
if (log.isDebugEnabled()) {
log.debug("The WSDL file: " + wsdlLocation + " for class: " + composite.getClassName() + "could not be processed. The ServiceDescription will be built from " + "annotations");
}
}
}
Aggregations