Link to home
Start Free TrialLog in
Avatar of cofactor
cofactor

asked on

AxisFault: The input stream for an incoming message is null

I am getting this error message:

Exception in thread "main" org.apache.axis2.AxisFault: The input stream for an incoming message is null.
      at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:92)
      at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:67)
      at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:354)
      at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417)
      at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
      at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
      at demo.com.TestProxyStub.sayHello(TestProxyStub.java:190)
      at demo.com.Test.main(Test.java:40)



Source Code  attached.


Can you please tell how do I fix it ?
Test.txt
Avatar of cofactor
cofactor

ASKER

comments please.
comments please.
any thoughts ?
Avatar of girionis
In your options, try to set the following:

o.setProperty(Constants.Configuration.MESSAGE_TYPE,HTTPConstants.MEDIA_TYPE_APPLICATION_ECHO_XML);
o.setProperty(Constants.Configuration.DISABLE_SOAP_ACTION,Boolean.TRUE);

Open in new window

Hi girionis,

I tried the same but it did not work.

Here is the code and error message

package demo.com;

import java.rmi.RemoteException;


import org.apache.axis2.Constants;
import org.apache.axis2.client.Options;
import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.transport.http.HTTPConstants;

public class Test {

	/**
	 * @param args
	 * @throws RemoteException
	 */
	public static void main(String[] args) throws RemoteException {
		// TODO Auto-generated method stub

		TestProxyStub tsb = new TestProxyStub();
		ServiceClient client = tsb._getServiceClient();
          
        Options o = client.getOptions();
		o.setPassword("admin");
        o.setUserName("admin");
        
       
        
        
        o.setProperty(Constants.Configuration.MESSAGE_TYPE,HTTPConstants.MEDIA_TYPE_APPLICATION_ECHO_XML);
        o.setProperty(Constants.Configuration.DISABLE_SOAP_ACTION,Boolean.TRUE);
        
        client.setOptions(o); 
        
        System.setProperty("javax.net.ssl.trustStore", "C:/wso2esb-4.7.0/repository/resources/security/wso2carbon.jks");
        System.setProperty("javax.net.ssl.trustStorePassword", "wso2carbon");
       

		SayHello sh = new SayHello();
		sh.setName("Demo");
		SayHelloResponse shr = tsb.sayHello(sh);
		System.out.println(shr.get_return());

	}

}







Error:
------------------

Exception in thread "main" org.apache.axis2.AxisFault: The input stream for an incoming message is null.
	at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:92)
	at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:67)
	at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:354)
	at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417)
	at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
	at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
	at demo.com.TestProxyStub.sayHello(TestProxyStub.java:190)
	at demo.com.Test.main(Test.java:41)

Open in new window

any thoughts ?
Add all the properties, the ones you have and the new ones

o.setPassword("admin");
o.setUserName("admin");
o.setProperty(HTTPConstants.CHUNKED,Constants.VALUE_TRUE);
o.setProperty(Constants.Configuration.MESSAGE_TYPE,HTTPConstants.MEDIA_TYPE_APPLICATION_ECHO_XML);
o.setProperty(Constants.Configuration.DISABLE_SOAP_ACTION,Boolean.TRUE);        

Open in new window

Ok.  did that....but still same error is coming.

is there anything else to try ?

Here is the code:

import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMXMLBuilderFactory;
import org.apache.axiom.om.OMXMLParserWrapper;
import org.apache.axis2.Constants;
import org.apache.axis2.client.Options;
import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.context.MessageContext;
import org.apache.axis2.description.Parameter;

import org.apache.axis2.transport.http.HTTPConstants;
import org.apache.neethi.Policy;
import org.apache.neethi.PolicyEngine;


public class Test {

	/**
	 * @param args
	 * @throws RemoteException
	 */
	public static void main(String[] args) throws RemoteException {
		// TODO Auto-generated method stub

		TestProxyStub tsb = new TestProxyStub();
		ServiceClient client = tsb._getServiceClient();
          
        Options o = client.getOptions();
		
       
        
              
        o.setPassword("admin");
        o.setUserName("admin");
        o.setProperty(HTTPConstants.CHUNKED,Constants.VALUE_TRUE);
        o.setProperty(Constants.Configuration.MESSAGE_TYPE,HTTPConstants.MEDIA_TYPE_APPLICATION_ECHO_XML);
        o.setProperty(Constants.Configuration.DISABLE_SOAP_ACTION,Boolean.TRUE); 
        
       
        
        
        client.setOptions(o); 
        
        System.setProperty("javax.net.ssl.trustStore", "C:/wso2esb-4.7.0/repository/resources/security/wso2carbon.jks");
        System.setProperty("javax.net.ssl.trustStorePassword", "wso2carbon");
       

		SayHello sh = new SayHello();
		sh.setName("Demo");
		SayHelloResponse shr = tsb.sayHello(sh);
		System.out.println(shr.get_return());

	}
	
	
}

Open in new window



Error message:

log4j:WARN No appenders could be found for logger (org.apache.axis2.description.AxisService).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" org.apache.axis2.AxisFault: The input stream for an incoming message is null.
      at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:92)
      at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:67)
      at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:354)
      at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417)
      at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
      at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
      at demo.com.TestProxyStub.sayHello(TestProxyStub.java:190)
      at demo.com.Test.main(Test.java:67)
It probably has to do with the SSL. Can you post the axis2.xml file?
ASKER CERTIFIED SOLUTION
Avatar of cofactor
cofactor

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
solved issue myself