1 Reply Latest reply on Dec 5, 2006 1:33 PM by Thomas Diesler

    Interfaces in Webmethods

    William Conroy Newbie

      I have an EJB that exposes only interfaces that I want to wrap with a webservice. I made the following to illustrate what I am trying to do. I have an app that invokes the web service that gives me the following exception.

      07:59:52,873 ERROR [SOAPFaultExceptionHelper] SOAP request exception
      javax.xml.rpc.JAXRPCException: org.jboss.ws.binding.BindingException: org.jboss.ws.jaxb.UnmarshalException: Failed to parse source: Class com.bo.valueobjects.PersonRequest has no public constructors or the class reflects a primitive type or void
       at org.jboss.ws.soap.SOAPContentElement.getObjectValue(SOAPContentElement.java:292)
       at org.jboss.ws.binding.EndpointInvocation.transformPayloadValue(EndpointInvocation.java:233)
       at org.jboss.ws.binding.EndpointInvocation.getRequestParamValue(EndpointInvocation.java:103)
       at org.jboss.ws.binding.EndpointInvocation.getRequestPayload(EndpointInvocation.java:117)
       at org.jboss.ws.integration.jboss.ServiceEndpointInvokerEJB3.invokeServiceEndpoint(ServiceEndpointInvokerEJB3.java:115)
       at org.jboss.ws.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:115)
       at org.jboss.ws.server.ServiceEndpoint.handleRequest(ServiceEndpoint.java:219)
       at org.jboss.ws.server.ServiceEndpointManager.processSOAPRequest(ServiceEndpointManager.java:355)
       at org.jboss.ws.server.StandardEndpointServlet.doPost(StandardEndpointServlet.java:115)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
       at org.jboss.ws.server.StandardEndpointServlet.service(StandardEndpointServlet.java:76)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: org.jboss.ws.binding.BindingException: org.jboss.ws.jaxb.UnmarshalException: Failed to parse source: Class com.bo.valueobjects.PersonRequest hasno public constructors or the class reflects a primitive type or void
       at org.jboss.ws.jaxrpc.encoding.JAXBDeserializer.deserialize(JAXBDeserializer.java:100)
       at org.jboss.ws.soap.SOAPContentElement.getObjectValue(SOAPContentElement.java:229)
       ... 29 more
      Caused by: org.jboss.ws.jaxb.UnmarshalException: Failed to parse source: Class com.bo.valueobjects.PersonRequest has no public constructors or the class reflects a primitive type or void
       at org.jboss.ws.jaxb.JBossXBUnmarshallerImpl.unmarshal(JBossXBUnmarshallerImpl.java:67)
       at org.jboss.ws.jaxrpc.encoding.JAXBDeserializer.deserialize(JAXBDeserializer.java:92)
       ... 30 more
      Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: Class com.bo.valueobjects.PersonRequest has no public constructors or the class reflects a primitive type or void
       at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:178)
       at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:126)
       at org.jboss.ws.jaxb.JBossXBUnmarshallerImpl.unmarshal(JBossXBUnmarshallerImpl.java:63)
       ... 31 more
      Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Class com.bo.valueobjects.PersonRequest has no public constructors or the class reflects a primitive type or void
       at org.jboss.xb.binding.sunday.unmarshalling.impl.runtime.RtElementHandler.newInstance(RtElementHandler.java:961)
       at org.jboss.xb.binding.sunday.unmarshalling.impl.runtime.RtElementHandler.startElement(RtElementHandler.java:728)
       at org.jboss.xb.binding.sunday.unmarshalling.impl.runtime.RtElementHandler.startParticle(RtElementHandler.java:89)
       at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:504)
       at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHandler.startElement(SaxJBossXBParser.java:323)
       at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
       at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Source)
       at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
       at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
       at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
       at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
       at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
       at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
       at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
       at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
       at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:174)
       ... 33 more
      


      Is there a way that I can generate the WSDL in a way that the request can be properly resolved? Are there different annotations I could be using?

      For now, I am just deploying a jar with this service and letting JBoss generate the wsdl at deploy time.

      public interface PersonRequest {
      
       public String getSsn();
       public void setSsn(String ssn);
      
      }
      


      public class PersonRequestImpl implements PersonRequest {
      
       private String ssn;
      
       public String getSsn() {
       return ssn;
       }
      
       public void setSsn(String ssn) {
       this.ssn = ssn;
       }
      
      }
      


      @Local
      public interface PeopleService {
      
       public String getPersonName(PersonRequest request);
      
      }
      


      @Stateless
      @WebService(name="PeopleService", targetNamespace="http://com.bo/peopleService")
      public class PeopleServiceImpl implements PeopleService {
      
       @WebMethod
       public String getPersonName(PersonRequest request) {
       Logger.getLogger(getClass()).info("Request class: " + request.getClass());
       return "MyName";
       }
      
      }