Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: Separate WSDLs or a single WSDL for CRUD functions?

  1. #1

    Default Separate WSDLs or a single WSDL for CRUD functions?

    I have an architectural question that I would like to ask. First some background: I need to create some webservices that provide basic CRUD functions and are backed by a database. My question concerns the WSDL and whether or not is it best to have a separate WSDL for each of the functions (e.g. create, read, update, delete), or should they all be inside a single WSDL? What are the best practices?

    Shannon Kendrick

  2. #2
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    Well, it depends on whether you want the ability to change them independently. If so, it makes sense to separate them. But I think that's most often not the case.
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  3. #3
    Join Date
    Mar 2006
    Location
    Germany, Karlsruhe
    Posts
    157

    Default

    But it's useful to seperate the xml schema and the wsdl file.
    I also have my fault related things (fault types and constants) in a seperate file.

    I have an other question regarding the wsdl.
    I've wrote the wsdl and manually added the URL of the web service. But if i have an application-server which runs on different machines, so the URL is different (of course ).
    Do i have to write my own tool which automatically modifies the WSDL file or has someone before wrote it? Or is a variable available which will be replaced automatically by the server-URL?

    Cheers,

    Ingo

  4. #4
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    Quote Originally Posted by res1st
    Do i have to write my own tool which automatically modifies the WSDL file or has someone before wrote it? Or is a variable available which will be replaced automatically by the server-URL?
    For now, you have to write your own solution. However, there seems to be much request for this feature, so I think i'll add it somehow before I do a M2.
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  5. #5
    Join Date
    Mar 2006
    Location
    Germany, Karlsruhe
    Posts
    157

    Default

    Thank you Arjen.

  6. #6
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    I've create a feature issue here: http://opensource.atlassian.com/proj.../browse/SWS-47. Check it out.
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  7. #7
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    And the issue is fixed. Please read the way it works, or check out the echo sample, which uses this functionality.
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  8. #8
    Join Date
    Mar 2006
    Location
    Germany, Karlsruhe
    Posts
    157

    Default

    Very good Arjen, it's looking nice.
    As soons as M2 is released, i'll try it. At the moment, i have to fight with JAXB2 and other client WS technologies.

    Ingo

  9. #9

    Default

    Arjen,
    I tried implementing the WSDL dynamic-location solution using WsdlDefinitionHandlerAdapter, and I ran into a slight problem. Apparently the rewrite of the location URL does not include the web context from the request - only the scheme, host, and port is modified. So if I deploy my WAR file to another web context in my app server, then the new context is not picked up.

    WSDL file
    Code:
    <soap:address location="http://localhost:8080/pcc-web/services" />
    Actual rewritten WSDL
    Code:
    <soap:address location="https://www.myhost.com/pcc-web/services" />
    Expected rewritten WSDL
    Code:
    <soap:address location="https://www.myhost.com/production/services" />
    I think that the web context should be updated in addition to the scheme, host, and port. What do you think?

    Shannon Kendrick

  10. #10
    Join Date
    Mar 2006
    Location
    Germany, Karlsruhe
    Posts
    157

    Default

    I think you are right, Shannon. It would be nice if the application context can also be changed.

    But how does it work? I did it like in the echo example and i get this log message:
    Code:
    DEBUG handler.SimpleUrlHandlerMapping  - Mapped URL path [/eim.wsdl] onto handler [org.springframework.ws.wsdl.wsdl11.SimpleWsdl11Definition@26fb32]
    But if i open my browser and request
    Code:
    http://localhost:8080/eim/eim.wsdl
    , i get my unchanged wsdl file.

    Cheers,

    Ingo
    Last edited by res1st; Jul 27th, 2006 at 05:03 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •