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 .Transport Utils.crea teSOAPMess age(Transp ortUtils.j ava:92)
at org.apache.axis2.transport .Transport Utils.crea teSOAPMess age(Transp ortUtils.j ava:67)
at org.apache.axis2.descripti on.OutInAx isOperatio nClient.ha ndleRespon se(OutInAx isOperatio n.java:354 )
at org.apache.axis2.descripti on.OutInAx isOperatio nClient.se nd(OutInAx isOperatio n.java:417 )
at org.apache.axis2.descripti on.OutInAx isOperatio nClient.ex ecuteImpl( OutInAxisO peration.j ava:229)
at org.apache.axis2.client.Op erationCli ent.execut e(Operatio nClient.ja va:165)
at demo.com.TestProxyStub.say Hello(Test ProxyStub. java:190)
at demo.com.Test.main(Test.ja va:40)
Source Code attached.
Can you please tell how do I fix it ?
Test.txt
Exception in thread "main" org.apache.axis2.AxisFault
at org.apache.axis2.transport
at org.apache.axis2.transport
at org.apache.axis2.descripti
at org.apache.axis2.descripti
at org.apache.axis2.descripti
at org.apache.axis2.client.Op
at demo.com.TestProxyStub.say
at demo.com.Test.main(Test.ja
Source Code attached.
Can you please tell how do I fix it ?
Test.txt
ASKER
comments please.
ASKER
any thoughts ?
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);
ASKER
Hi girionis,
I tried the same but it did not work.
Here is the code and error message
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)
ASKER
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);
ASKER
Ok. did that....but still same error is coming.
is there anything else to try ?
Here is the code:
Error message:
log4j:WARN No appenders could be found for logger (org.apache.axis2.descript ion.AxisSe rvice).
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 .Transport Utils.crea teSOAPMess age(Transp ortUtils.j ava:92)
at org.apache.axis2.transport .Transport Utils.crea teSOAPMess age(Transp ortUtils.j ava:67)
at org.apache.axis2.descripti on.OutInAx isOperatio nClient.ha ndleRespon se(OutInAx isOperatio n.java:354 )
at org.apache.axis2.descripti on.OutInAx isOperatio nClient.se nd(OutInAx isOperatio n.java:417 )
at org.apache.axis2.descripti on.OutInAx isOperatio nClient.ex ecuteImpl( OutInAxisO peration.j ava:229)
at org.apache.axis2.client.Op erationCli ent.execut e(Operatio nClient.ja va:165)
at demo.com.TestProxyStub.say Hello(Test ProxyStub. java:190)
at demo.com.Test.main(Test.ja va:67)
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());
}
}
Error message:
log4j:WARN No appenders could be found for logger (org.apache.axis2.descript
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" org.apache.axis2.AxisFault
at org.apache.axis2.transport
at org.apache.axis2.transport
at org.apache.axis2.descripti
at org.apache.axis2.descripti
at org.apache.axis2.descripti
at org.apache.axis2.client.Op
at demo.com.TestProxyStub.say
at demo.com.Test.main(Test.ja
It probably has to do with the SSL. Can you post the axis2.xml file?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
solved issue myself
ASKER