Refer to
http://www.globus.org/toolkit/docs/latest-stable/common/javawscore/developer
/#javawscore-developer-wsdlsoaprules for details on requirements on
SOAP/WSDL in GT.
 
In summary, we require compliance to WS I basic profle and the
document/literal mode requires that you have at most one part. You need to
wrap the two parameters in a single element. Example:
 
<xsd:element name="addParameter">
   <xsd:complexType>
    <xsd:sequence>
   <xsd:element name="add1" type="xsd:int"/>  
<xsd:element name="add" type="xsd:int"/>
        </xsd:sequence>
   </xsd:complexType>
</xsd:element
 
<wsdl:message name="AddInputMessage">
    <wsdl:part name="parameters" element="tns:addParameter"/>
  </wsdl:message>

Note, I did not validate above and cut/paste might not work. It is just to
illustrate using a single element in part, but with complexTypes.
 
Rachana


  _____  

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Donglai Zhang
Sent: Monday, October 20, 2008 12:25 AM
To: [email protected]
Subject: [gt-user] ws-core 4.2.0 Counter Example with two parameters


Hi,  

I am trying to revise a little bit to the Counter example of ws-core-4.2.0
to have the add method to have two parameters. That is add(int in0, int
int1). 
For the file
ws-core-4.2.0/schema/core/samples/counter/counter_flattened.wsdl, I have
added 
<xsd:element name="add1" type="xsd:int"/>  under the 
<xsd:element name="add" type="xsd:int"/>
and changed the message from 
<wsdl:message name="AddInputMessage">
    <wsdl:part name="parameters" element="tns:add"/>
  </wsdl:message>
To 
<wsdl:message name="AddInputMessage">
    <wsdl:part name="parameters" element="tns:add"/>
    <wsdl:part name="parameters" element="tns:add1"/>
  </wsdl:message>
I leave the binding unchanged.  
I have also changed following java files: 
CounterService.java 
public int add(int arg0) throws RemoteException
To
public int add(int arg0, int arg1) throws RemoteException

client/Add.java 
add(value);
to 
 add(value, value1);

client/CounterClient.java 
 addPort.add(3 );
to addPort.add(3,4);

 addPort.add(10); 
to 
 addPort.add(10, 11);

Then I recompiled the ws-core-4.2.0 package, every thing seems fine and
server can be started. However, when I try to run the 
bin/counter-create command line with the given service url, it told me: 
Error: java.lang.Exception: [CORE] Having more than one input parameter is
not allowed

It seems in the ServiceDescUtil.java file the public static boolean
fixNamespaces() method, the following checking gives the error:
if (params.list.size() > 1) {
                            throw new Exception(
                                i18n.getMessage("invalidNumberOfParams"));
                        }
It seems when the service is initialized, it does not allow the two
parameters for the add operation. Even though the counter creation operation
does not invoke the add operation. 
Would you please explain what is this used for? And how I can change the
add(int in0) method into add(int in0, int in1)? 

Thanks,

-- 
Donglai Zhang




Reply via email to