Am Tue, 8 Oct 2019 08:34:23 -1000 schrieb "robertlazarski ." <robertlazar...@gmail.com>:
> Please see my comments inline. > > On Tue, Oct 1, 2019 at 11:51 PM camikusch <camiku...@web.de> wrote: > > > Hi, > > > > I'm trying to implement something like a SOAP Proxy. > > Database sends SOAP request to my Tomcat Server, Tomcat Server > > sends a Request to > > a Remote Server. The Answer from the Remote Server gets back to > > Tomcat and from there back to the Database. > > > > The single steps "Database to Tomcat" and "Tomcat to remote Server" > > are working, but > > as soon as i try to combine them the "Tomcat to remote Server" part > > fails with an AxisFault. > > > > The following code runs on my Tomcat Server and receives Requests > > just fine (here: login() ). > > I'm creating a new Stub Service with the URL of the remote Server > > and then i try to send > > a request with it (stub.login()) which fails with an > > "org.apache.axis2.AxisFault: Function 'To' does not exist". The problem was resolved by creating a new connection manager in the constructor of the receiving service class. It seems in standard configuration its not possible to make a SOAP request while still working on an incoming request. /** * Constructor that takes in a configContext and useseperate listner */ public BGNILIASSoapWebserviceStub(org.apache.axis2.context.ConfigurationContext configurationContext, java.lang.String targetEndpoint, boolean useSeparateListener) throws org.apache.axis2.AxisFault { //To populate AxisService populateAxisService(); populateFaults(); // mikusch start if (null == configurationContext) { try { configurationContext = ConfigurationContextFactory.createDefaultConfigurationContext(); } catch (Exception ex) { throw new AxisFault(ex.getMessage()); } } MultiThreadedHttpConnectionManager conmgr = new MultiThreadedHttpConnectionManager(); conmgr.getParams().setDefaultMaxConnectionsPerHost(10); HttpClient client = new HttpClient(conmgr); configurationContext.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, client); configurationContext.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, "true"); // mikusch ende _serviceClient = new org.apache.axis2.client.ServiceClient(configurationContext, _service); _serviceClient.getOptions().setTo(new org.apache.axis2.addressing.EndpointReference( targetEndpoint)); _serviceClient.getOptions().setUseSeparateListener(useSeparateListener); } --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@axis.apache.org For additional commands, e-mail: java-user-h...@axis.apache.org