[JBossWS] - WebService does not receive all the parameters passed from t
by rkodumagulla1
I am using JBoss IDE Plugin for Eclipse 3.2.1 and running JBoss 4.0.5 GA app server. I am able to create a web service and deploy it to the server. However, when the WSClientProxy sends requests the web service by passing the parameters, the web service only gets the first parameter and the other parameters are always null
Did any body else run into this issue? Any help will be appreciated.
Here is my WSClient Proxy Class
------------------------------------------------------------------
package localhost.mtcse.services.SimpleWebService;
import java.rmi.RemoteException;
public class SimpleWebServiceProxy implements localhost.mtcse.services.SimpleWebService.SimpleWebService {
private String _endpoint = null;
private localhost.mtcse.services.SimpleWebService.SimpleWebService simpleWebService = null;
public SimpleWebServiceProxy() {
_initSimpleWebServiceProxy();
}
private void _initSimpleWebServiceProxy() {
try {
simpleWebService = (new localhost.mtcse.services.SimpleWebService.SimpleWebServiceServiceLocator()).getSimpleWebService();
if (simpleWebService != null) {
if (_endpoint != null)
((javax.xml.rpc.Stub)simpleWebService)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
else
_endpoint = (String)((javax.xml.rpc.Stub)simpleWebService)._getProperty("javax.xml.rpc.service.endpoint.address");
}
}
catch (javax.xml.rpc.ServiceException serviceException) {}
}
public String getEndpoint() {
return _endpoint;
}
public void setEndpoint(String endpoint) {
_endpoint = endpoint;
if (simpleWebService != null)
((javax.xml.rpc.Stub)simpleWebService)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
}
public localhost.mtcse.services.SimpleWebService.SimpleWebService getSimpleWebService() {
if (simpleWebService == null)
_initSimpleWebServiceProxy();
return simpleWebService;
}
public java.lang.String testParameters(java.lang.String parm1, java.lang.String parm2, java.lang.String parm3) throws java.rmi.RemoteException{
if (simpleWebService == null)
_initSimpleWebServiceProxy();
return simpleWebService.testParameters(parm1, parm2, parm3);
}
public static void main(String[] args) throws RemoteException {
SimpleWebServiceProxy swsp = new SimpleWebServiceProxy();
System.out.println(swsp.testParameters("Work1", "Work2", "Work3"));
}
}
-----------------------------------------------------------------
Here is my web service
-----------------------------------------------------------------
package org.dhhs.mtcse.service;
import org.dhhs.mtcse.session.*;
import java.util.*;
import com.finalist.util.log.*;
import org.dhhs.mtcse.exception.GenericBusinessException;
import org.apache.commons.beanutils.BeanUtils;
import org.dhhs.mtcse.util.log.*;
import org.apache.axis.AxisFault;
public class SimpleWebService {
/**
* The logger object.
*/
private static Logger log = LogService
.getLogger(SimpleWebService.class);
public String testParameters(String parm1, String parm2, String parm3) throws Exception {
log.debug("Parm 1: " + parm1);
log.debug("Parm 2: " + parm2);
log.debug("Parm 3: " + parm3);
return "Returned String is " + parm1 + " " + parm2 + " " + parm3;
}
}
------------------------------------------------------------
Here is the wsdl generated by Axis in JBoss
------------------------------------------------------------
?
<wsdl:definitions targetNamespace="http://localhost:8080/mtcse/services/SimpleWebService">
?
<!--
WSDL created by Apache Axis version: 1.2
Built on May 03, 2005 (02:20:24 EDT)
-->
?
<wsdl:types>
?
?
</wsdl:types>
?
<wsdl:message name="testParametersResponse">
<wsdl:part element="impl:testParametersReturn" name="testParametersReturn"/>
</wsdl:message>
?
<wsdl:message name="testParametersRequest">
<wsdl:part element="tns1:parm1" name="parm1"/>
<wsdl:part element="tns1:parm2" name="parm2"/>
<wsdl:part element="tns1:parm3" name="parm3"/>
</wsdl:message>
?
<wsdl:portType name="SimpleWebService">
?
<wsdl:operation name="testParameters" parameterOrder="parm1 parm2 parm3">
<wsdl:input message="impl:testParametersRequest" name="testParametersRequest"/>
<wsdl:output message="impl:testParametersResponse" name="testParametersResponse"/>
</wsdl:operation>
</wsdl:portType>
?
<wsdl:binding name="SimpleWebServiceSoapBinding" type="impl:SimpleWebService">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
?
<wsdl:operation name="testParameters">
<wsdlsoap:operation soapAction=""/>
?
<wsdl:input name="testParametersRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
?
<wsdl:output name="testParametersResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
?
<wsdl:service name="SimpleWebServiceService">
?
<wsdl:port binding="impl:SimpleWebServiceSoapBinding" name="SimpleWebService">
<wsdlsoap:address location="http://localhost:8080/mtcse/services/SimpleWebService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Appreciate your help.
RK
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3998275#3998275
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3998275
17 years, 11 months
[JBossWS] - ws can't map ArrayList to xsd:boolean
by mjea
I have an EJB with the following method exposed as a web service:
public Collection getStatus(Ear data) throws OspMethodException, RemoteException;
I generated the wsdl using wstools. I have the following response generated:
| ...
| <message name="EarAccessService_getStatusResponse">
| <part name="result" type="ns1:Collection"/>
| </message>
| ...
| <operation name="getStatus" parameterOrder="Ear_1">
| <input message="tns:EarAccessService_getStatus"/>
| <output message="tns:EarAccessService_getStatusResponse"/>
| <fault message="tns:OspMethodException" name="OspMethodException"/>
| </operation>
| ...
|
Now when I trigger the web service, the EJB method is correctly executed but the soap response creation fails with this error:
|
| 10:00:33 ERROR .71-8080-1 [server.StandardEndpointServlet] Error processing web service request
| javax.xml.rpc.JAXRPCException: org.jboss.xb.binding.JBossXBValueFormatException: Java value for XSD boolean type expected to be an instance of java.lang.Boolean or java.lang.Number. But the value is of type java.util.ArrayList
| at org.jboss.ws.soap.SOAPContentElement.write(SOAPContentElement.java:986)
| at org.jboss.ws.soap.SAAJElementWriter.writeElement(SAAJElementWriter.java:171)
| at org.jboss.ws.soap.SAAJElementWriter.writeElement(SAAJElementWriter.java:184)
| at org.jboss.ws.soap.SAAJElementWriter.writeElement(SAAJElementWriter.java:184)
| at org.jboss.ws.soap.SAAJElementWriter.writeElement(SAAJElementWriter.java:184)
| at org.jboss.ws.soap.SAAJElementWriter.printInternal(SAAJElementWriter.java:163)
| at org.jboss.ws.soap.SAAJElementWriter.print(SAAJElementWriter.java:142)
| at org.jboss.ws.soap.SOAPMessageImpl.writeTo(SOAPMessageImpl.java:266)
| at org.jboss.ws.server.ServiceEndpointManager.sendResponse(ServiceEndpointManager.java:409)
|
It seems it tries to map my ArrayList (a Collection of Strings to return) to a boolean. How is that possible? Is there something I missed?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3998198#3998198
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3998198
17 years, 11 months