8 Replies Latest reply on Apr 9, 2008 11:13 AM by karnan

    Web Service Response problem

    karnan

      Hi,

      Im using JBossws203GA with jboss405GA.
      I generated interfaces and service classes with wsconsume from wsdl file

      And i also wrote my client which will consume the service.
      BUt i have a prob with the response of the server.

      Details:

      here is my web method:

      
       @WebMethod(operationName = "OpenSession", action = "http://WebServicesToolkit.net/SV/SessionContext/v1.0/OpenSession")
       @RequestWrapper(localName = "OpenSession", targetNamespace = "http://WebServicesToolkit.net/SV/SessionContext/v1.0/", className = "net.webservicestoolkit.sv.sessioncontext.v1.OpenSession")
       @ResponseWrapper(localName = "OpenSessionResponse", targetNamespace = "http://WebServicesToolkit.net/SV/SessionContext/v1.0/", className = "net.webservicestoolkit.sv.sessioncontext.v1.OpenSessionResponse")
       public void openSession(
       @WebParam(name = "UserName", targetNamespace = "http://WebServicesToolkit.net/SV/SessionContext/v1.0/")
       String userName,
       @WebParam(name = "Password", targetNamespace = "http://WebServicesToolkit.net/SV/SessionContext/v1.0/")
       String password,
       @WebParam(name = "projectLanguage", targetNamespace = "http://WebServicesToolkit.net/SV/SessionContext/v1.0/")
       SVLanguage projectLanguage,
       @WebParam(name = "OpenSessionResult", targetNamespace = "http://WebServicesToolkit.net/SV/SessionContext/v1.0/", mode = WebParam.Mode.OUT)
       Holder<Result> openSessionResult,
       @WebParam(name = "SessionId", targetNamespace = "http://WebServicesToolkit.net/SV/SessionContext/v1.0/", mode = WebParam.Mode.OUT)
       Holder<String> sessionId){
      
       Holder<String> tmp = new Holder<String>("12345");
       sessionId = tmp;
       openSessionResult = new Holder<Result>();
       System.out.println("openSession");
      }
      


      here is the client:

      When i call the this remote method from the client, i always get the value 0.
      I checked the type of the response (0) with getClass().getName(), and i got String.

      Where is the prob,
      can someone help me
      thx a lot
       serviceName = new QName("http://WebServicesToolkit.net/SV/SessionContext/v1.0/", "SessionContext");
       SessionContext service = new SessionContext(wsdlLocation, serviceName);
       SessionContextSoap scs = service.getSessionContextSoap();
      
       Holder<Result> openSessionResult = new Holder<Result>();
       Holder<String> sessionId = new Holder<String>();
       System.out.println("sessionId avant appel: " + sessionId.value);
       scs.openSession("Karnan","azerty",SVLanguage.CONTEXT_DEFAULT,openSessionResult,sessionId);
       System.out.println("Karnan sessionId: " + sessionId);
      


        • 1. Re: Web Service Response problem
          karnan

          and i am also using that with java 1.5 because jbossws 405GA can only work with java 1.5

          Can JaxWs2 work with jbossws203ga and jboss405ga ???

          ithink yes but not sure

          thx again,
          i really need help

          • 2. Re: Web Service Response problem
            karnan

            this is what i get when i listen the http port during the remote call of the method

            
            <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><OpenSession xmlns="http://WebServicesToolkit.net/SV/SessionContext/v1.0/"><UserName>Karnan</UserName><Password>azerty</Password><projectLanguage>ContextDefault</projectLanguage></OpenSession></env:Body></env:Envelope>
            


            thx

            what is the real prob ?


            • 3. Re: Web Service Response problem
              thomas.diesler

              Have a look at the jaxws/holder test

              ant -Dtest=jaxws/holder test
              


              • 4. Re: Web Service Response problem
                karnan

                Im new on web services so i dont know what you mean exactly.
                should i test this command on the client side or something else?

                thx

                • 5. Re: Web Service Response problem
                  thomas.diesler

                  You could study an already working test and go from there.

                  http://jbws.dyndns.org/mediawiki/index.php?title=Building_From_Source

                  • 6. Re: Web Service Response problem
                    karnan

                    thx for ur answers but sincerly im little lost...
                    i already installed the jbossws-native203GA on my machine and the jboss405GA is also installed but on a remote machine.
                    And i also tested HelloWorld example and it worked.
                    So i dont know what is the real prob of my implementation or the config prob.
                    I dont have any *.xml files, is it normal?
                    When i consult forum, everybody speak abt xml files of their web services but i dont xml files.
                    it will be greate if somebody can clear my mind on these several problems...

                    thx in advance guys

                    • 7. Re: Web Service Response problem
                      karnan

                      i think the prob come with the fact that my openSession method use a parameters which are "tagged" WebParam.Mode.OUT;
                      And i dont know if this kind of usage is accepted with java 1.5.
                      I think the prob come from this : WebParam.Mode.OUT. And i dont know how to handle it.

                      • 8. Re: Web Service Response problem
                        karnan

                        ok it works now.... thanks everybody

                        Causes:

                        1) The wsdlLocation of my wsdl file was incorrect (wrong machine IP). I redefined it properly

                        2) Variable Holder sessionId (defined as WebParam.Mode.OUT) should not be allocated in both sides (Server&Client) but only in the client side.
                        And on the server side, just use sessionId.value= "something you want"

                        bye