DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21687>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21687

Getting null values while using accessing a  document style web service

           Summary: Getting null values while using accessing a  document
                    style web service
           Product: Axis
           Version: 1.1
          Platform: All
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: Serialization/Deserialization
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


1)Develop a web service using document style
2)Provide a function (say) "getDetails", which takes no parameters return a 
java bean (say) "detailsBean".
3)Generate the WSDL file
4)Generate the client stub files from WSDL file using WSDL2Java
5)Write a client (accessing the "getDetails" function) using the stub files
6)Values of various fields of "detailsBean"  will be obtained as "null" in case 
of string data types and "0" in case of integers.

However, soap response (verified by using TCPMon) contains the correct values 
of all the fields of the "detailsBean".

Also, the strange behaviour is that, if you add a dummy input parameter to the 
function like :

detailsBean getDetails(String dummy)

Then thing works fine!!

I'm pasting the deployment descriptor and service implementation files for 
reference:

1) deploy.wsdd
--------------------
deployment xmlns="http://xml.apache.org/axis/wsdd/"; 
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java";>
        <service name="documentstyle" style="document">
        <parameter name="className" value="myprograms.documentstyle.document"/>
        <parameter name="allowedMethods" value="*"/>
        <beanMapping qname="myNS:detailsBean" xmlns:myNS="urn:BeanService" 
languageSpecificType="java:myprograms.documentstyle.detailsBean"/>
    </service>
</deployment>
--------------------


2)document.java (the main class, which implements the service)
-------------------

package myprograms.documentstyle;

public class document {


    public document() {
    }

    public detailsBean getDetails() {

                detailsBean bean = new detailsBean();
                bean.setZip("560025");
                bean.setCity("Bangalore");
                bean.setState("Karnatka");
                bean.setPhone(555);

                return bean;
    }
}
-------------------


3)detailsBean.java(the java bean class)
-------------------
package myprograms.documentstyle;

public class detailsBean {
    
    String zip = null;
    String city = null;
    String state = null;
    int phone;

    public detailsBean() {
    }

    public void setZip(String theZip) {
                zip = theZip;
        }

        public String getZip() {
                return zip;
        }

        public void setCity(String theCity) {
                city = theCity;
        }

        public String getCity() {
                return city;
        }

        public void setState(String theState) {
                state= theState;
        }

        public String getState() {
                return state;
        }

        public void setPhone(int thePhone) {
                phone = thePhone;
        }

        public int getPhone() {
                return phone;
        }


}

---------------------


The SOAP response, when i invoke the function "getDetails" is as follows:

-----------------
HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Date: Thu, 17 Jul 2003 
12:36:33 GMT Server: Apache Coyote/1.0 Connection: close  <?xml version="1.0" 
encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
 <soapenv:Body>
  <getDetailsReturn xmlns="http://documentstyle.myprograms";>
   <phone>555</phone>
   <zip>560025</zip>
   <state>Karnatka</state>
   <city>Bangalore</city>
  </getDetailsReturn>
 </soapenv:Body>
</soapenv:Envelope>
-----------------

thanks,
Naresh Agarwal

Reply via email to