Reducing the number of WSDL stub classes I have to generate

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Reducing the number of WSDL stub classes I have to generate

Akotaobi, Uche
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
[hidden email]

XEROX
Technology.  Document Management.  Consulting Services

www.xerox.com
Reply | Threaded
Open this post in threaded view
|

Re: Reducing the number of WSDL stub classes I have to generate

Cameron Smith-6
Uche, what version of wsdl.exe (or Visual Studio .NET) where you using?  Because I have had problems using it against OFBiz-generated WSDL files.

cameron




               
___________________________________________________________
The all-new Yahoo! Mail goes wherever you go - free your email address from your Internet provider. http://uk.docs.yahoo.com/nowyoucan.html
Reply | Threaded
Open this post in threaded view
|

Re: Reducing the number of WSDL stub classes I have to generate

Peter Tracey
The problem is probably related to the style="document" instead of
style="rpc" confusion, discussed here a while back. Moral of the story
was MS's thingy (and PHP pear::SOAP, I've found) works fine if it gets
style="rpc"

Uche: If you're worried about the performance of all those calls, the
generated WSDL should be cached by the MS stuff. I don't see why calling
the stub generator before using the service is a problem, perhaps give
yourself a wrapper so that you just give it the service name and it
gives you the stub? You'd have to have the service name somewhere
anyway, I would think. 45 times or not.

Pete

Cameron Smith wrote:

> Uche, what version of wsdl.exe (or Visual Studio .NET) where you using?  Because I have had problems using it against OFBiz-generated WSDL files.
>
> cameron
>
>
>
>
>
> ___________________________________________________________
> The all-new Yahoo! Mail goes wherever you go - free your email address from your Internet provider. http://uk.docs.yahoo.com/nowyoucan.html
>  
Akotaobi, Uche wrote:
> ...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.
>  
Reply | Threaded
Open this post in threaded view
|

RE: Reducing the number of WSDL stub classes I have to generate

Akotaobi, Uche
In reply to this post by Cameron Smith-6
[Cameron Smith]

> Uche, what version of wsdl.exe (or Visual Studio .NET) where
> you using?  Because I have had problems using it against
> OFBiz-generated WSDL files.


We have two versions of wsdl.exe, actually--version 1.1.4322.573 (which came with Visual Studio 2003) and version 2.0.50727.42 (which came with Visual Studio 2005.)  We're working on a .NET 2.0 client, so we used the second version.

Both versions seem to work, though neither does anything more than write the constructor and boilerplate class attribute stuff.  I ended up having to implement the actual methods (with appropriately named arguments and this.Invoke() calls) myself, which was annoying.

The wsdl.exe implementations both emit warning comments when run on our OFBiz WSDL definitions:

        // CODEGEN: The operation binding 'goodbyeWorld' from namespace 'http://www.ofbiz.org/service/' was ignored.  Specifying a type for use=literal messages is not supported.

Wsdl.exe 2.0 goes further, specifically outlining the areas of the WS-I Basic Profile v1.1 that it felt OFBiz's WSDL definition violated (R2204 and R2210; I have full error messages available if you are interested.)

But those are just warnings.  There are no errors.


--
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
[hidden email]

XEROX
Technology.  Document Management.  Consulting Services

www.xerox.com