I am new to JAX WS and Geronimo but am having a difficult time with the XML
mapping for a simple POJO Web Service that returns String[].

Here is the code:
--------------------------------------
package com.praxis.webservice.jaxws.reportmanager;

import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;

@WebService(name="ReportManagerPortType",
        targetNamespace = "http://report.webservices.praxis.com";)
public interface ReportManger {

        @WebResult(name="reportName")
        public String getReportName(@WebParam int id);
        @WebResult(name="reportIDs")
        public String[] searchByID(@WebParam String iD);
        @WebResult(name="report")
        public Report getReport(@WebParam int id);
}

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

package com.praxis.webservice.jaxws.reportmanager;

import java.util.ArrayList;

import javax.jws.WebService;

@WebService(serviceName = "ReportManger",
        portName = "ReportMangerPort",
        endpointInterface =
"com.praxis.webservice.jaxws.reportmanager.ReportManger",
        targetNamespace = "http://report.webservices.praxis.com";)
public class ReportManagerService implements ReportManger {

        public String getReportName(int id) {
                return "Got report";
        }

        public String[] searchByID(String id) {
                ArrayList<String> res = new ArrayList<String>();
                res.add(new String("1"));
                res.add(new String("10"));
                return res.toArray(new String[0]);
        }

        public Report getReport(int id) {
                return new Report(1,"Test Report");
        }

}

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

The service deploys to Geronimo "getReportName" and "getReport" work as
expected.
The "searchByID" call always returns an array of size 1 with "" as the
string.

The snippet of the xsd from the Geronimo server descripes the return element
as:

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

<xs:complexType name="searchByIDResponse">
           <xs:sequence>
                   <xs:element maxOccurs="unbounded" minOccurs="0"
name="reportIDs" type="xs:string"/>
            </xs:sequence>
</xs:complexType>

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

However the soap message body returned from the call contains this:

---------------------
<soapenv:Body>
      <searchByIPResponse
xmlns:dlwmin="http://report.webservices.praxis.com";>
          <reportIDs>
               <item>1</item> 
               <item>10</item> 
          </reportIDs>
     </searchByIPResponse>
 </soapenv:Body>
-----------------------

I have used the identical code for the Java classes and deployed the service
to a JBoss server. Although the xsd description is similar to the Geronimo
xsd the JBoss server returns this:
-----------------
<soapenv:Body>
      <searchByIPResponse
xmlns:dlwmin="http://report.webservices.praxis.com";>
          <reportIDs>1</reportIDs> 
           <reportIDs>10</reportIDs>          
     </searchByIPResponse>
 </soapenv:Body>

Does anyone have a suggestion as to what I may be doing wrong?



-- 
View this message in context: 
http://www.nabble.com/Geronimo%2C-JAX-WS%2C-JAXB-tp19559399s134p19559399.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.

Reply via email to