Data service invocation fails due to a NPE at client side (Response soap body 
is blank)
---------------------------------------------------------------------------------------

                 Key: WSAS-636
                 URL: http://wso2.org/jira/browse/WSAS-636
             Project: WSO2 WSAS
          Issue Type: Bug
          Components: data-services
    Affects Versions: Nightly
         Environment: winxp, jdk15, WSAS-2.2-QAbuild1
            Reporter: Charitha Kankanamge
         Assigned To: sumedha rubasinghe
            Priority: Blocker


I couldn't invoke a simple data service either with REST or generated stub. 

- The sample data service configuration is as follows.

<data name="Employeedataservice">
<config>
<property name="org.wso2.ws.dataservice.driver">com.mysql.jdbc.Driver</property>
<property 
name="org.wso2.ws.dataservice.protocol">jdbc:mysql://localhost:3306/EmployeeDB</property>
<property name="org.wso2.ws.dataservice.user">root</property>
<property name="org.wso2.ws.dataservice.password">root</property>
</config>
<query id="Mtlaviniaemployees">
<result element="employees" rowName="employee">
<element name="name" column="name" />
<element name="id" column="id" />
<element name="address" column="address" />
</result>
</query>
<operation name="getMtLaviniaEmployees">
<call-query href="Mtlaviniaemployees" />
</operation>
</data>

 - Deploy this service in WSAS and generate ADB client 
- Write a client 

public class Client {
        
        public static void main(String[] args) throws AxisFault {
                EmployeedataserviceStub stub = new 
EmployeedataserviceStub("http://127.0.0.1:9763/services/Employeedataservice";);
                EmployeedataserviceStub.GetMtLaviniaEmployees req = new 
EmployeedataserviceStub.GetMtLaviniaEmployees();
                
                try {
                        EmployeedataserviceStub.Employees res = 
stub.getMtLaviniaEmployees(req);
                        System.out.println(res.getEmployee()[0]);
                } catch (RemoteException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }
        }

}
- Run the client

following exception will be thrown at  client side.

org.apache.axis2.AxisFault
        at org.apache.axis2.AxisFault.makeFault(AxisFault.java:417)
        at 
org.wso2.wsas.client.EmployeedataserviceStub.fromOM(EmployeedataserviceStub.java:2210)
        at 
org.wso2.wsas.client.EmployeedataserviceStub.getMtLaviniaEmployees(EmployeedataserviceStub.java:178)
        at Client.main(Client.java:14)
Caused by: java.lang.NullPointerException
        at 
org.wso2.wsas.client.EmployeedataserviceStub.fromOM(EmployeedataserviceStub.java:2204)
        ... 2 more


====================================================================================================================================
Soap request
-------------------
<?xml version='1.0' encoding='UTF-8'?>
   <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
      <soapenv:Body>
         <ns1:getMtLaviniaEmployees xmlns:ns1="http://ws.wso2.org/dataservice"; 
/>
      </soapenv:Body>
   </soapenv:Envelope>

Soap response
----------------------
<?xml version='1.0' encoding='UTF-8'?>
   <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
      <soapenv:Body />
   </soapenv:Envelope>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://wso2.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

_______________________________________________
Wsas-java-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/wsas-java-dev

Reply via email to