0 Replies Latest reply on May 18, 2007 10:11 AM by SUNDARRAJAN SUYAMBOO

    webservices development/deployment in jboss 4.0.5 and jboss

    SUNDARRAJAN SUYAMBOO Newbie

      Hi,
      I tried the following webservice ,

      package com.javasrc.webservices.age;

      public class AgeServlet {
      public String age( String name, Integer age ) {
      return name + " is " + age + " years old!";
      }
      }


      SEI is ,
      package com.javasrc.webservices.age;

      import java.rmi.Remote;
      import java.rmi.RemoteException;

      public interface Age extends Remote {
      public String age( String name, Integer age ) throws RemoteException;
      }


      web.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
      version="2.4">



      <servlet-name>AgeServlet</servlet-name>
      <servlet-class>com.javasrc.webservices.age.AgeServlet</servlet-class>


      <servlet-mapping>
      <servlet-name>AgeServlet</servlet-name>
      <url-pattern>/Age</url-pattern>
      </servlet-mapping>

      </web-app>



      used this config file

      <?xml version="1.0" encoding="UTF-8"?>






      to generate wsdl and mapping file using Webservices Developer Pack which runs on jre 1.5 and my jboss server runs on java 1.4

      my directory structure looks like ,

      age.war
      /WEB-INF
      /classes
      mapping.xml
      web.xml
      webservices.xml
      /wsdl
      AgeService.wsdl

      When I opened up mapping and webservices.xml in jboss IDE 2 Beta , it showed some schema errors.

      cvc-id.3: A field of identity constraint 'port-component-name-key' matched element 'webservice-description', but this element does not have a simple type.

      I resolved this by removing ,

      'http://java.sun.com/xml/ns/j2ee from the following

      <?xml version='1.0' encoding='UTF-8'?><java-wsdl-mapping version='1.1' xmlns='http://java.sun.com/xml/ns/j2ee' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd'>.

      And then published using jboss IDE Beta. Though I see the webservice in the console http://localhost:8080/jbossws/services , I couldn't invoke the webservice using client program in which I was thrown with error 500.


      How do I resolve this ? Any help would be greatly appreciated.

      Is the jbossws is a suggested environment to develop webservices?



      Thanks
      Sundar