You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by "Akotaobi, Uche" <Uc...@xerox.com> on 2007/02/23 21:52:37 UTC

Reducing the number of WSDL stub classes I have to generate

Good afternoon, everyone.  Apologies for the length of the message that follows.

It's pretty clear that I can define several services for a custom hot-deploy component like this:

[In ofbiz-component.xml]

  <ofbiz-component name="widgetlib"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/ofbiz-component.xsd">
      <resource-loader name="main" type="component"/>
      <service-resource type="model" loader="main" location="servicedef/services.xml"/>
  </ofbiz-component>

[In servicedef/services.xml]

  <?xml version="1.0" encoding="UTF-8"?>
  <services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/services.xsd">
      <description>Innotech Hello Services</description>
  
    <service name="helloWorld"
             engine="java"
             location="com.innotech.widgetlib.HelloServices"
             auth="false"
             export="true"
             invoke="hello">
    </service>
    
    <service name="goodbyeWorld"
             engine="java"
             location="com.innotech.widgetlib.HelloServices"
             auth="false"
             export="true"
             invoke="goodbye">
             <attribute name="message" type="String" mode="IN" optional="false" />
             <attribute name="result" type="String" mode="OUT" optional="false" />
    </service>
  </services>

Adding export="true" instantly turns HelloServices.hello() and HelloServices.goodbye(String) into bona fide web services named "helloWorld" and "goodbyeWorld".  Extremely cool!

Once OFBiz is up and running via startofbiz, I can get the WSDL for any individual service by accessing a URL like this:

	http://localhost:8080/webtools/control/SOAPService/goodbyeWorld?WSDL

Using that WSDL, I can generate SOAP client stub code with a WSDL generator like SoapUi, no problem.  With Microsoft's WSDL.exe, these are generated as partial C# classes having method names and arguments that match the service names and arguments, and you just stick the generated files into your application's source tree.  That works okay.  But!

...There is only one service per WSDL definition.  Exposing 45 services means having 45 separate WSDL definitions, which means I have to invoke the WSDL stub generator 45 times and add 45 classes to my project--which just seems wrong.

How can I define my services such that I only need to retrieve one WSDL definition to generate all of my stub code from it?  That is, how can I get WSDL which includes definitions for both the "helloWorld" and "goodbyeWorld" services?  I'm no SOAP expert, so it's quite possible that I have no idea what I'm talking about.


-----


Also, I remember David Jones was asking me earlier if I could provide a patch for the JUnit XML modifications that I made to our copy of the TestRunContainer a few weeks ago.  The answer I got back from the legal team was a pretty firm "no", sorry!


--
Uche O. Akotaobi
Workflow Engineer
Xerox Corporation
701 South Aviation Blvd., ESAE-116
El Segundo, CA  90245
Phone (310) 333-2403  Internal 8*823-2403
Fax (310) 333-8419
Uche.Akotaobi@xerox.com

XEROX
Technology.  Document Management.  Consulting Services

www.xerox.com