13 Replies Latest reply on Nov 5, 2003 2:16 PM by stephanenicoll

    Use SOAP Service with JBoss running

    stasky

      Hi all!

      I can't say that I know to 100% how, but I have managed to have my JBoss running and at the same time be able to look at my SOAP Admin Client over http://localhost:80/soap/admin/index.html (I've changed the port from 8080 to 80).
      - First of all, my deployed Web Services didn't exist any more, so I had to deploy a new one. Why did that happen?
      - Then I went to http://localhost:80/fibo/index.html, where my App is running, gave some input and pressed the button to get my answer over the Servlet, Bean etc. The problem is, it looks like he hasn't found the SOAP service, as though it is not deployed or as though it is wrongly deployed. So I get a null pointer exception, and if I ask SOAP for some output I get this:
      :[Header=null] [methodName=null] [targetObjectURI=null] [encodingStyleURI=null] [SOAPContext=[Parts={[cid:null type: text/xml; charset=utf-8 enc: null]}]] [fault=[Attributes={}] [faultCode=SOAP-ENV:Server.BadTargetObjectURI] [faultString=Unable to resolve target object: buch.kapitel7.soap.BeispielServer_1] [faultActorURI=/soap/servlet/rpcrouter] [DetailEntries=] [FaultEntries=]] [Params={}]
      Does anybody know what I have to do?
      Do I have to put classes or something else somewhere special in the JBoss directory?
      Can somebody help me or should I provide some more information?

      Thanks,
      Kosta

        • 1. Re: Use SOAP Service with JBoss running

          Bah yeah, you should provide more information. Are you using Axis, JBossNET or some other third party product to handle the SOAP traffic.

          Your configuration seems to be customized and, as always, it's hard to give an answer for that without more details.

          Regards,

          Stephane

          PS : What version of JBoss are u using?

          • 2. Re: Use SOAP Service with JBoss running

            Bah yeah, you should provide more information. Are you using Axis, JBossNET or some other third party product to handle the SOAP traffic.

            Your configuration seems to be customized and, as always, it's hard to give an answer for that without more details.

            Regards,

            Stephane

            PS : What version of JBoss are u using?

            • 3. Re: Use SOAP Service with JBoss running
              stasky

              I'm running on Windows XP, Eclipse as an IDE and I am using JBoss 3.0.7 in a bundle with Tomcat 4.1.24. Are other versions easier to use?
              I don't use Axis or JBoss.NET, I thought JBoss, Tomcat and my SOAP RPC Router and Admin are enough. Would it make my life easier using one of these two or may I do without?
              Thanks for your interest,
              Kosta

              • 4. Re: Use SOAP Service with JBoss running

                Apache Axis is a follow up of Apache SOAP. I think that you definetly need to upgrade to that one if you need latest features and support.

                Jboss 3.2.2 is out and offers quite cool features but if you have no problem with 3.0.7 I wouldn't suggest to upgrade in a first place.

                JBossNET is a wrapper around Apache Axis for JBoss. Unfortunatetly, JBossNET is not available with your version as far as I know.

                Changing to 3.2.2 will be a big change for you as configuration files have changed a little bit.

                In a first place what I suggest to you is to rollout your application to Apache Axis.

                Download the axis distribution and takes the webappes directory. You'll find a folder named axis, rename it to axis.war so that Jboss can deploy it as a war application.

                Copy this axis.war to your deploy directory. Now you have your Admin and RPC router ready (actually the RPC router is now a servlet, named AxisServlet, check http://localhost:8080/axis for more details)

                When you've done that come back if you still have issue.

                Regards,

                Stephane

                • 5. Re: Use SOAP Service with JBoss running
                  stasky

                  Hi!

                  As you said, I downloaded Axis, renamed the webapps/axis to webapps/axis.war and copied it to my Jboss server's deploy directory. On starting JBoss I can now call http://localhost:8080/axis and see the Axis page, which looks like that:
                  _______
                  Hello! Welcome to Apache-Axis.

                  What do you want to do today?

                  Validate the local installation's configuration
                  see below if this does not work.
                  View the list of deployed Web services
                  Call a local endpoint that list's the caller's http headers (or see its WSDL).
                  Visit the Apache-Axis Home Page
                  Administer Axis
                  [disabled by default for security reasons]
                  SOAPMonitor
                  [disabled by default for security reasons]
                  To enable the disabled features, uncomment the appropriate declarations in WEB-INF/web.xml in the webapplication and restart it.
                  Validating Axis
                  If the "happyaxis" validation page displays an exception instead of a status page, the likely cause is that you have multiple XML parsers in your classpath. Clean up your classpath by eliminating extraneous parsers.
                  If you have problems getting Axis to work, consult the Axis Wiki and then try the Axis user mailing list.
                  --------------------------

                  First of all I did as they say, went to the WEB-INF/web.xml in the axis.war and uncommented the one commented section, without that changing anything. If I now press "Administer Axis" I get a page with following message:
                  _______
                  Server is running
                  Current load = 1
                  -----------

                  If I click "SOAPMonitor" I get a gray page with a red X top left...

                  By the way, the last two lines of my Eclipse output:
                  12:57:52,828 INFO [Server] JBoss (MX MicroKernel) [3.0.7 (CVSTag=JBoss_3_0_7 Date=200304081816)] Started in 0m:22s:543ms
                  13:00:45,806 ERROR [EngineConfigurationFactoryServlet] Unable to find config file. Creating new servlet engine config file: /WEB-INF/server-config.wsdd

                  More questions...:
                  - My application file is called FiboApp.ear, I just deploy it to my running JBoss, is that right?
                  - Inside that application I call a deployed service, but the problem is that in Axis I don't know where to deploy it...Do I have to put the classes somewhere special?
                  - What do I get by using Axis instead of SOAP?

                  I think I am a little confused, but I am really thankful for your help!

                  Regards,
                  Kostas

                  • 6. Re: Use SOAP Service with JBoss running
                    stasky

                    Update:

                    I just managed to get the SOAP Monitor working (I think...) by compiling its class.
                    The Admin remains the same...

                    • 7. Re: Use SOAP Service with JBoss running

                      For a tutorial on Axis, please check

                      http://www.ammai.com/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=4&page=1

                      Soap monitor is not available by default, you need to compile the SOAPMonitorApplet.java which is in the axis.war directory

                      To deploy a Web Service in Axis, you should invoke the AdminService through a traditionnal Java client. Again check the doc/tutorial to know more.

                      If you use axis you'll have the lastest development / Bug fix.

                      Regards,

                      Stephane

                      • 8. Re: Use SOAP Service with JBoss running
                        stasky

                        Although I went to the WEB-INF/web.xml in the axis.war and uncommented the one commented section, that didn't change anything. The Axis page still says that
                        "Administer Axis
                        [disabled by default for security reasons] "

                        If I press "Administer Axis" I get a page with following message:
                        _______
                        Server is running
                        Current load = 1
                        -----------

                        If I try something like http://localhost/axis/services/Version?method=getVersion (I've changed the port...)
                        I get a page with the following:

                        <?xml version="1.0" encoding="UTF-8" ?>
                        - <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                        - <soapenv:Body>
                        - <soapenv:Fault>
                        <faultcode xmlns:ns1="http://xml.apache.org/axis/">ns1:Server.NoService
                        The AXIS engine could not find a target service to invoke! targetService is null

                        </soapenv:Fault>
                        </soapenv:Body>
                        </soapenv:Envelope>

                        Again I am a little confused...

                        Regards, Kostas

                        • 9. Re: Use SOAP Service with JBoss running

                          If I press "Administer Axis" I get a page with following message:
                          _______

                          This is the right message. You should'n get anything else ;)

                          There is no Version service in Axis. Check the list of services for more details

                          Regards,

                          Stephane

                          • 10. Re: Use SOAP Service with JBoss running
                            stasky

                            Stephane, thanks again for your help and I hope I haven't tired you...I hust don't seem to be able to deploy services with axis, in every tutorial I have read that I should do it like:
                            java org.apache.axis.client.AdminClient deploy.wsdd
                            When I do that, I just get a NoClassDefFound Error...
                            Any Ideas?

                            Regards, Kostas

                            • 11. Re: Use SOAP Service with JBoss running

                              Yes, you should have the axis jars in your classpath to run that command (the one which are in axis.war/WEB-INF/lib

                              If you use ant, I can give later on at task that invokes the admin service remotely to register a web service.

                              Are you intereseted?

                              Regards,

                              Stephane

                              • 12. Re: Use SOAP Service with JBoss running
                                stasky

                                I think I have all of the axis jars in my classpath (actually I found out somewhere that I can put them in a special environment variable called AXISCLASSPATH).
                                Usually I use ant through Eclipse, but I could also use it as standalone, your idea with the task sounds good. When you say remotely, can it be on the same computer? Do you want to send it to my email?

                                Thanks, Kostas

                                • 13. Re: Use SOAP Service with JBoss running

                                  Actually, it has to be on the same machine but it could be extended easily (see how AdminClient works)

                                  Add this in your build.properties:

                                  axis.port = 8080

                                  or in the build file if it does not change

                                  You can extend you ant build as follows:






























                                  in the rsources.webservice.dir you have two files:

                                  - deploy.xml deploys your webservice
                                  - undeploy.xml undeploys your webservice

                                  something like:

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




                                  my deploy-webservice task depends on deploy-ejb which deploys my EAR in JBoss. You can extend to your needs

                                  Any question, let me know

                                  Regards,

                                  Stephane