1 Reply Latest reply on May 9, 2008 10:11 AM by Pramod Nair

    Error: ...Port does not contain operation meta data for: ...

    Leandro Hermida Newbie

      Hi everyone,

      I have written a test web service with JBoss 4.2.2.GA and I have what seems to be an oversight error (on my part I am sure) that I cannot figure out :) I searched this forum and others have had the same problem but then there is no clear answer in the responses as to what is the real source of the problem and how to fix it. My code compiles and deploys into the application server properly but when I use a web service client to test a method call I get the following strange error about operation meta data not being there:

      2008-05-08 16:48:46,996 ERROR [org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS] SOAP request exception
      org.jboss.ws.core.CommonSOAPFaultException: Endpoint {http://wstest.fmi.ch/}UserServiceBeanPort does not contain operation meta data for: {http://wstest.fmi.ch/}GetUserByUsername
      at org.jboss.ws.core.server.ServiceEndpointInvoker.getDispatchDestination(ServiceEndpointInvoker.java:457)
      at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:176)
      at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:408)
      at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:272)
      at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:189)


      Here is the POSTed SOAP body:

      <soap:Body xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>
       <tns:GetUserByUsername xmlns:tns='http://wstest.fmi.ch/'>
       <Username xsi:type='xsd:string' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>hermida</Username>
       </tns:GetUserByUsername>
      </soap:Body>


      Here are the important web service code (and where a possible error could be):

      UserServiceWSInterface.java
      //package ch.fmi.wstest;
      
      /**
       * Web service interface for the UserServiceBean session bean.
       *
       */
      @javax.jws.WebService(targetNamespace = "http://ch.fmi/wstest", name = "UserService")
      @javax.jws.soap.SOAPBinding(style = javax.jws.soap.SOAPBinding.Style.RPC, use = javax.jws.soap.SOAPBinding.Use.LITERAL, parameterStyle = javax.jws.soap.SOAPBinding.ParameterStyle.WRAPPED)
      public interface UserServiceWSInterface
       extends java.rmi.Remote
      {
       @javax.jws.WebMethod(operationName = "GetUserByUsername")
       public ch.fmi.wstest.User getUserByUsername(
       @javax.jws.WebParam(name = "Username") java.lang.String username
       ) throws java.rmi.RemoteException;
      
      }


      UserServiceBean.java
      // license-header java merge-point
      //
      // Generated by: SessionBeanImpl.vsl in andromda-ejb3-cartridge.
      //
      package ch.fmi.wstest;
      
      /**
       * @see ch.fmi.wstest.UserServiceBase
       *
       * Remember to manually configure the local business interface this bean implements if originally you only
       * defined the remote business interface. However, this change is automatically reflected in the ejb-jar.xml.
       *
       * Do not specify the javax.ejb.Stateless annotation
       * Instead, the session bean is defined in the ejb-jar.xml descriptor.
       */
      @javax.jws.WebService(endpointInterface = "ch.fmi.wstest.UserServiceWSInterface")
      @org.jboss.wsf.spi.annotation.WebContext(contextRoot = "/wstest-ws", urlPattern="/services/UserService/*")
      public class UserServiceBean
       extends ch.fmi.wstest.UserServiceBase
       implements ch.fmi.wstest.UserServiceRemote
      {
      
       // --------------- Constructors ---------------
      
       /**
       * Default constructor extending base class default constructor
       */
       public UserServiceBean()
       {
       super();
       }
      
       // -------- Business Methods Impl --------------
      
       /**
       * @see ch.fmi.wstest.UserServiceBase#getUserByUsername(java.lang.String)
       */
       protected ch.fmi.wstest.User handleGetUserByUsername(java.lang.String username)
       throws java.lang.Exception
       {
       //TODO: put your implementation here.
       // Dummy return value, just that the file compiles
       return null;
       }
      
      
       // -------- Lifecycle Callback Implementation --------------
      
      }
      


      Here are the WSDLs:

      http://localhost:8080/wstest-ws/services/UserService?wsdl
      <definitions name="UserServiceBeanService" targetNamespace="http://wstest.fmi.ch/">
       <import location="http://localhost.fmi.ch:8080/wstest-ws/services/UserService?wsdl&resource=UserService_PortType36597.wsdl" namespace="http://ch.fmi/wstest"/>
       <service name="UserServiceBeanService">
       <port binding="ns1:UserServiceBinding" name="UserServiceBeanPort">
       <soap:address location="http://localhost.fmi.ch:8080/wstest-ws/services/UserService"/>
       </port>
       </service>
      </definitions>


      http://localhost.fmi.ch:8080/wstest-ws/services/UserService?wsdl&resource=UserService_PortType36597.wsdl
      <definitions name="UserServiceBeanService" targetNamespace="http://ch.fmi/wstest">
       <types>
       <xs:schema targetNamespace="http://ch.fmi/wstest" version="1.0">
       <xs:complexType name="user">
       <xs:sequence>
       <xs:element minOccurs="0" name="id" type="xs:long"/>
       <xs:element minOccurs="0" name="password" type="xs:string"/>
       <xs:element minOccurs="0" name="username" type="xs:string"/>
       </xs:sequence>
       </xs:complexType>
       </xs:schema>
       </types>
       <message name="UserService_GetUserByUsernameResponse">
       <part name="return" type="ns1:user"/>
       </message>
       <message name="UserService_GetUserByUsername">
       <part name="Username" type="xsd:string"/>
       </message>
       <portType name="UserService">
       <operation name="GetUserByUsername" parameterOrder="Username">
       <input message="ns1:UserService_GetUserByUsername"/>
       <output message="ns1:UserService_GetUserByUsernameResponse"/>
       </operation>
       </portType>
       <binding name="UserServiceBinding" type="ns1:UserService">
       <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
       <operation name="GetUserByUsername">
       <soap:operation soapAction=""/>
       <input>
       <soap:body namespace="http://wstest.fmi.ch/" use="literal"/>
       </input>
       <output>
       <soap:body namespace="http://wstest.fmi.ch/" use="literal"/>
       </output>
       </operation>
       </binding>
      </definitions>


      Why is it not finding the operation meta data? Is it a namespace problem?

      thanks for any help,
      leandro