7 Replies Latest reply on Nov 2, 2006 7:41 AM by Chris Lowe

    WStools; Parameter names (Newbie question)

    Jeremy Freeman Newbie

      Hi there,
      I'm using Jboss 4.04 and the version of JbossWS that shipped with it. I've written a basic SOAP handler that is working well.

      My question is this. I am generating my webservices.xml, jaxrpc-mapping.xml,and .wsdl file by the methods described in the users guide for a simple RPCstyle endpoint


      I am using the default wstools-config.xml as also described there.

      Everything is working perfectly with one hitch -- It is automatically designating my parameter names for my rpc functions as String_1, String_2, double_3, etc.I need to change them to specific other names to match a standard (ideally the same names they have as parameters in the java source files). I tried simply replacing all instances of the generic variable names with my own but this simply generated many errors. Is there a different configuration of wstools where these names could be preserved or applied? If not, can someone please explain to me / direct me towards an explanation of the changes I must make for this to work?

      Thank you very much for your attention.

        • 1. Re: WStools; Parameter names (Newbie question)
          sosopk Newbie

          It would be interesting for me too to know how to avoid these ugly parameter names. There must be some way to tell wstools that it should retain parameter names from class file

          • 2. Re: WStools; Parameter names (Newbie question)
            Jason Greene Master

            The problem is that Java does not store the paramter names in the class file. If the class is compiled with debugging, then they can be derrived, but the differing behavior would be confusing, so tools consistently goes with the type_position format.

            You can however use the configuration file to change the name to whatever you like (for both parameters and the return value).

            For example:

            <configuration xmlns="http://www.jboss.org/jbossws-tools"
             xsi:schemaLocation="http://www.jboss.org/jbossws-tools http://www.jboss.org/jbossws-tools/schema/jbossws-tool_1_0.xsd">
             <service name="AccountSignupService"
             <operation name="signup" return-xml-name="SignupResponse">
             <parameter xml-name="accountInfo" type="org.jboss.test.ws.wsse.signup.AccountInfo"/>
             <parameter xml-name="discountAmount" type="float"/>
             <parameter xml-name="signupTime" type="java.util.Date"/>
             <namespaces target-namespace="http://org.jboss.test.ws/wsse"
             type-namespace="http://org.jboss.test.ws/wsse/types" />
             <mapping file="jaxrpc-mapping.xml"/>
             <webservices servlet-link="AccountSignup"/>


            • 3. Re: WStools; Parameter names (Newbie question)
              Jason Greene Master

              I should also note that we are working with sun to try and get parameter information included in the byte code.


              • 4. Re: WStools; Parameter names (Newbie question)
                Olivier PEPIN Newbie


                Do you have a JIRA ticket attached to this task ?

                - Olivier

                • 5. Re: WStools; Parameter names (Newbie question)
                  Scott Balmos Newbie

                  I believe Jason and everyone are completely forgetting the usefulness of @WebParam here. See below:

                  @Remote @WebService @SOAPBinding(style = SOAPBinding.Style.RPC)
                  public interface CoreBackend
                   @WebMethod public String startSession(@WebParam(name = "clientID") long clientID);
                   @WebMethod public void endSession(@WebParam(name = "sessionToken") String sessionToken);
                   @WebMethod public boolean login(@WebParam(name = "sessionToken") String sessionToken,
                   @WebParam(name = "username") String username,
                   @WebParam(name = "password") String password);
                   @WebMethod public void logout(@WebParam(name = "sessionToken") String sessionToken);


                  • 6. Re: WStools; Parameter names (Newbie question)
                    Jon Scobie Newbie

                    This may be a very silly question (and I apologise if it is), but can't the tools look at the source code instead of the byte code? WSAD (websphere application studio) seems to get it right, so I am guessing it interogates the source for this information.

                    • 7. Re: WStools; Parameter names (Newbie question)
                      Chris Lowe Apprentice


                      re: getting parameter information included in the byte code.

                      Is there a bug/rfe database ID that we can add our votes to? This would be incredibly useful.