Results 1 to 3 of 3

Thread: services.xml

  1. #1
    madness is offline Member
    Join Date
    Nov 2010
    Posts
    5
    Rep Power
    0

    Smile services.xml

    Hi everybody! I'm using axis2, ant and apache tomcat to create an md5 web service. The tutorial that i'm working on is: Apache Axis2 - Axis2 Quick Start Guide
    and the code that i use is the following:

    import java.io.UnsupportedEncodingException;
    import java.security.MessageDigest;
    import java.security.NoSuchAlgorithmException;

    public class AeSimpleMD5 {

    private static String convertToHex(byte[] data) {
    StringBuffer buf = new StringBuffer();
    for (int i = 0; i < data.length; i++) {
    int halfbyte = (data[i] >>> 4) & 0x0F;
    int two_halfs = 0;
    do {
    if ((0 <= halfbyte) && (halfbyte <= 9))
    buf.append((char) ('0' + halfbyte));
    else
    buf.append((char) ('a' + (halfbyte - 10)));
    halfbyte = data[i] & 0x0F;
    } while(two_halfs++ < 1);
    }
    return buf.toString();
    }

    public static String MD5(String text)
    throws NoSuchAlgorithmException, UnsupportedEncodingException {
    MessageDigest md;
    md = MessageDigest.getInstance("MD5");
    byte[] md5hash = new byte[32];
    md.update(text.getBytes("iso-8859-1"), 0, text.length());
    md5hash = md.digest();
    return convertToHex(md5hash);
    }
    }

    I have created the .wsdl the .aar and i'm missing the services.xml. I have deployed the .aar on tomcat and my service appeares as a faulty service (which is normal as long as i don't have the services.xml) with the list of errors shown below:

    Error: org.apache.axis2.deployment.DeploymentException: The services.xml file cannot be found for the service: E:\Project\apache-tomcat-6.0.29\webapps\axis2\WEB-INF\services\Main.aar at org.apache.axis2.deployment.repository.util.Archiv eReader.processServiceGroup(ArchiveReader.java:150 ) at org.apache.axis2.deployment.ServiceDeployer.deploy (ServiceDeployer.java:81) at org.apache.axis2.deployment.repository.util.Deploy mentFileData.deploy(DeploymentFileData.java:136) at org.apache.axis2.deployment.DeploymentEngine.doDep loy(DeploymentEngine.java:659) at org.apache.axis2.deployment.repository.util.WSInfo List.update(WSInfoList.java:144) at org.apache.axis2.deployment.RepositoryListener.upd ate(RepositoryListener.java:337) at org.apache.axis2.deployment.RepositoryListener.che ckServices(RepositoryListener.java:241) at org.apache.axis2.deployment.DeploymentEngine.loadS ervices(DeploymentEngine.java:131) at org.apache.axis2.deployment.WarBasedAxisConfigurat or.loadServices(WarBasedAxisConfigurator.java:284) at org.apache.axis2.context.ConfigurationContextFacto ry.createConfigurationContext(ConfigurationContext Factory.java:95) at org.apache.axis2.transport.http.AxisServlet.initCo nfigContext(AxisServlet.java:559) at org.apache.axis2.transport.http.AxisServlet.init(A xisServlet.java:448) at org.apache.catalina.core.StandardWrapper.loadServl et(StandardWrapper.java:1173) at org.apache.catalina.core.StandardWrapper.load(Stan dardWrapper.java:993) at org.apache.catalina.core.StandardContext.loadOnSta rtup(StandardContext.java:4350) at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4659) at org.apache.catalina.core.ContainerBase.addChildInt ernal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(Co ntainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(Sta ndardHost.java:546) at org.apache.catalina.startup.HostConfig.deployWAR(H ostConfig.java:905) at org.apache.catalina.startup.HostConfig.deployWARs( HostConfig.java:740) at org.apache.catalina.startup.HostConfig.deployApps( HostConfig.java:500) at org.apache.catalina.startup.HostConfig.start(HostC onfig.java:1277) at org.apache.catalina.startup.HostConfig.lifecycleEv ent(HostConfig.java:321) at org.apache.catalina.util.LifecycleSupport.fireLife cycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1053) at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:785) at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:445) at org.apache.catalina.core.StandardService.start(Sta ndardService.java:519) at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalin a.java:581) at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootst rap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:414) Caused by: org.apache.axis2.deployment.DeploymentException: The services.xml file cannot be found for the service: E:\Project\apache-tomcat-6.0.29\webapps\axis2\WEB-INF\services\Main.aar at org.apache.axis2.deployment.repository.util.Archiv eReader.processServiceGroup(ArchiveReader.java:147 ) ... 37 more

    The problem is that i'm trying to write the services.xml but i don't seem to manage it. I have found a tutorial tha shows how to write one:
    Writing Your Own services.xml for Axis2 Web Services | WSO2 Oxygen Tank

    Any ideas on what i must do or what the services.xml must look like?

    Thanx a lot!!!:o

  2. #2
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    6

    Default

    Has you read Hello World with Apache Axis2 | WSO2 Oxygen Tank ?

    where services.xml goes inside the META-INF folder inside the service .aar.

    Note, for development and testing, inside your war file, you dont need to build a .aar file.
    instead you can just create the folder structure of what would go inside a .aar inside the WEB-INF/services/ folder
    Java Code:
    WEB-INF/
       services/
         MyService/
           META-INF/
             services.xml
    Last edited by travishein; 01-05-2011 at 10:31 PM.

  3. #3
    madness is offline Member
    Join Date
    Nov 2010
    Posts
    5
    Rep Power
    0

    Default

    Thanks alot for aswering me! I've found every tutorial available including the above. My problem is that i must write the services.xml all by my self and i'm not really familiar with this kind of code. I used NETBeans that creates all the files automaticaly but do i still have to change the services.xml file that is automatically created? I tried to deploy the service from the NETBeans files and even though the service doesn't appear as a faulty service anymore it still doesn't work. Maybe it's a code problem?I don't get any errors when compiling.

Similar Threads

  1. Web Services
    By Cbani in forum Advanced Java
    Replies: 6
    Last Post: 01-24-2010, 03:15 PM
  2. web services
    By k_paramesh82 in forum Java Software
    Replies: 5
    Last Post: 04-02-2009, 01:03 PM
  3. Web Services: Axis vs Metro vs Spring Web Services
    By davidbaker29 in forum Advanced Java
    Replies: 0
    Last Post: 01-28-2009, 12:20 PM
  4. Web Services
    By d_raghu9 in forum New To Java
    Replies: 0
    Last Post: 02-17-2008, 03:12 AM
  5. Web Services
    By d_raghu9 in forum XML
    Replies: 0
    Last Post: 02-17-2008, 03:11 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •