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

    WStools; Parameter names (Newbie question)

    bcguitar33

      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

      (http://labs.jboss.com/portal/jbossws/user-guide/en/html/getting-started.html#rpc-endpoints)

      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

          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

            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"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://www.jboss.org/jbossws-tools http://www.jboss.org/jbossws-tools/schema/jbossws-tool_1_0.xsd">
             <java-wsdl>
             <service name="AccountSignupService"
             endpoint="org.jboss.test.ws.wsse.signup.AccountSignup"
             style="document">
             <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"/>
             </operation>
             </service>
             <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"/>
             </java-wsdl>
            </configuration>
            


            -Jason

            • 3. Re: WStools; Parameter names (Newbie question)
              jason.greene

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

              -Jason

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

                Hello,

                Do you have a JIRA ticket attached to this task ?

                - Olivier

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

                  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);
                  }
                  


                  --Scott


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

                    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)
                      lowecg2004

                      Jason,

                      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.

                      Chris.