in reply to Re: SOAP::Lite, .NET, and complex structures
in thread SOAP::Lite, .NET, and complex structures

Thanks, but isn't SOAP::WSDL a client library? Perl is running the service, and an MS client is reading the data as a .NET service.

If I am wrong, I would be happy to learn more about it, but my reading of the documents indicates that SOAP::WSDL is only a client.

--MidLifeXis

  • Comment on Re^2: SOAP::Lite, .NET, and complex structures

Replies are listed 'Best First'.
Re^3: SOAP::Lite, .NET, and complex structures
by erroneousBollock (Curate) on Aug 11, 2007 at 04:12 UTC
    Ok, I didn't understand it that way from your description.

    The .NET client is likely doing all the right things wrt SOAP, so let's look at the perl web-service (assuming you used the standard tools to generate your proxy class).

    Firstly, are you publishing WSDL for your service? If so, how did you construct it?
    If your WSDL is not exactly correct, you'll get all sorts of namespace/type/arity issues.

    I use Pod::WSDL to generate WSDL from my web-service classes. It requires you to add some POD to each method and class because perl doesn't handle types/arity statically. In practice, this just makes your class better documented.

    WSDL descriptions of each method can generally be a little loose because perl (and SOAP::Lite) doesn't really molest the data too much before passing to the method... however, it's really important to properly describe (annotate) your classes (complex types).

    I actually have my web-services serve up the WSDL at http://server/path/to/service?WSDL

    Microsoft's wsdl.exe proxy class generator tool should have no problem consuming WSDL generated by Pod::WSDL.

    -David

      Do you have an example of returning a complex structure to the client? I see the examples of returning complex error types, can get arrays of internal types to return with no problem, but cannot, for the life of me, figure out how to get a complex type returned.

      I will be digging into the source, but if there is an example of this somewhere, it would be most helpful.

      thanks,

      --MidLifeXis

        The steps I use are as follows:
        1. Publish the proper WSDL (generate with Pod::WSDL) after having annotated your (dispatchable) classes with POD as described for classes in Pod::WSDL's documentation.
        2. Please check that the generated WSDL actually contains nice-looking descriptions of your classes (properly marked as complex types).
        3. Don't try to "construct" your complex types. Use normal hash-based perl objects. Return them (or arrays of them) directly.

        I'll try to find the time to put up a working example soon.

        Update:

        Example of annotated class:

        Example (excerpt) of complexType generated by Pod::WSDL:

        Example of method returning a list of complex values:

        Example (excerpts) of WSDL generated by Pod::WSDL for above method:

        That all works fine for me.

        Are you doing anything terribly more complicated than that?

        -David.