Hello I am having a problem with a web service. I have a web service deployed in a tomcat server. This web service make some stuff and also calls another web service. Here is the code used by my web service calling the other web service:
Options options = new Options(); EndpointReference targetEPR = new EndpointReference(sURL); options.setTo(targetEPR); options.setProperty(org.apache.axis2.Constants.Configuration.ENABLE_SWA, org.apache.axis2.Constants.VALUE_TRUE); options.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI); options.setTimeOutInMilliSeconds(5000); options.setProperty(HTTPConstants.CHUNKED, false); options.setAction("urn:process"); ServiceClient sender = new ServiceClient(); sender.setOptions(options); OperationClient mepClient = sender.createClient(ServiceClient.ANON_OUT_IN_OP); MessageContext mc = new MessageContext(); SOAPFactory fac = OMAbstractFactory.getSOAP11Factory(); SOAPEnvelope env = fac.getDefaultEnvelope(); OMNamespace omNs = fac.createOMNamespace(Paths.WS_NAMESPACE, "swa"); OMElement uploadFile = fac.createOMElement("process", omNs); OMElement nameEle = fac.createOMElement("message", omNs); nameEle.setText(sMessage); uploadFile.addChild(nameEle); env.getBody().addChild(uploadFile); mc.setEnvelope(env); mepClient.addMessageContext(mc); logger.debug("(callWS) before"); mepClient.execute(true); --> Line where the OMException is thrown ("OMException: Error while writing the OutputStream") I also have this code on a standalone Java Application. The code is exactly the same and the web service call works fine. The differences here between the 2 approaches are: - In the first solution the presented code is executed by a web service. In the second solution the code is executed by a standalone java application - In the first solution the first web service is deployed on a tomcat server. Anyone can help me to solve this problem? Thanks Best regards