Sunday, November 6, 2011

Oracle SOA Suite - Abstract WSDL - Resolving the composite dependency issue during deployment and server restart.

Oracle SOA Suite - Abstract WSDL - Resolving the composite dependency issue during deployment and server restart:


Dependency order is not recorded in SOA Suite for composites. So, during server start-up, there might be multiple retries before all composites are loaded to the server if a wrong dependency order is followed by the server.
This does not necessarily mean the composites are not loaded at all, but server may end up trying to load a composite multiple times before it is finally succeeds after restart. This results in multiple errors in logs and also overall time taken for restart. E.g., as seen in the diagram below, if the server tries to load A before B and C are deployed then the composite loading fails. This can also happen during deployment time if there is a circular dependency between composites.


Solution to this problem is isolating design time and runtime dependencies. This can be done by moving WSDL dependencies to abstract WSDL’s. We can store the abstract copies of all such WSDL’s in MDS.
Consider the XML snippets below which can be found in composite.xml.
<reference name="SubmitOrderToCOMPASSRS" ui:wsdlLocation="http://eaidev2:8004/soa-infra/services/MEDIATOR/CSOM_SubmitOrderToCOMPASS/CSOM_SubmitOrderToCOMPASSRS.wsdl">

<binding.ws port="******" location="http://eaidev2:8004/soa-infra/services/MEDIATOR/CSOM_SubmitOrderToCOMPASS/CSOM.SubmitOrderToCOMPASSRS_ep?WSDL" soapVersion="1.1">


ui:wsdlLocation signifies design time and binding.ws stands for runtime.
So, we need to change the value in ui: wsdlLocation, so that it refers to MDS rather than the deployed component through http. The changed value should look something similar as below to point it to MDS.
oramds:/apps/EAIMetaData/Abstract/WSDL/MEDIATOR/CSOM_SubmitOrderToCOMPASS/CSOM_SubmitOrderToCOMPASSRS.wsdl
By following the approach, during compile time the compiler finds all the references it needs and the runtime engine does not bother about the abstract WSDL’s once it is loaded. So for both initial deployment and subsequent server restarts this approach helps in avoiding design time dependencies.

The steps to implement the solution:

1. Copy all the dependency WSDL’s and the schemas or the WSDL’s imported from the dependency WSDL to a particular MDS location and change all the import location (Schema and WSDL) in the Abstract WSDL to refer the MDS than deployed location.





2. Change the import location of dependent WSDL in Composite.xml to the abstract WSDL in MDS.
Change From:
<import namespace="http://www.reuters.com/ns/2007/09/01/GCAP/EAI/CS/OM"
location="http://10.15.35.244/soa-infra/services/MEDIATOR/CSOM_SubmitOrderToCOMPASS/CSOM_SubmitOrderToCOMPASSRS.wsdl" importType="wsdl"/>





Change To:
<import namespace="http://www.reuters.com/ns/2007/09/01/GCAP/EAI/CS/OM" location="oramds:/apps/EAIMetaData/Abstract/WSDL/MEDIATOR/CSOM_SubmitOrderToCOMPASS/CSOM_SubmitOrderToCOMPASSRS.wsdl" importType="wsdl"/>





3. Change the ui: wsdlLocation in composite.xml and the Component files to refer to MDS for the dependent WSDL’s rather than deployed composites through http.
Change From:
<reference name="SubmitOrderToCOMPASSRS" ui: wsdlLocation=" http://10.15.35.244/soa-infra/services/MEDIATOR/CSOM_SubmitOrderToCOMPASS/CSOM_SubmitOrderToCOMPASSRS.wsdl ">




Change To:
<reference name="SubmitOrderToCOMPASSRS" ui: wsdlLocation=" oramds:/apps/EAIMetaData/Abstract/WSDL/MEDIATOR/CSOM_SubmitOrderToCOMPASS/CSOM_SubmitOrderToCOMPASSRS.wsdl ">





In the same way change the reference ui: wsdlLocation for the same dependent WSDL in component file (file with the extension .componentType) also.
This will help us to resolve the dependency issue with the composites during deployment and server restart.

23 comments:

  1. Hi Albin,

    If we will reference to same wsdl which contains abstract and concrete and this wsdl is stored in MDS, do you think that we may have problems?

    I mean MDS should solve reference problems when loading SCA...

    Thanks,A

    ReplyDelete
  2. Hi Augustin

    There will not be any issue until we are referring the WSDL(abstract/concrete) from the MDS.

    Regards
    Albin I

    ReplyDelete
  3. Albin

    Thanks for sharing this. It has been very helpful.

    - Chandu

    ReplyDelete
  4. Thanks for Sharing. Nicely documented.
    Thanks,
    Shailesh

    ReplyDelete
  5. This is really good - explains in simple terms and sometimes the best way.

    ReplyDelete
  6. Thanks for explaining the concept of this Design time and Runtime WSDL ..Really helpful

    ReplyDelete
  7. thanks for sharing this info... really helpful.

    ReplyDelete
  8. Thanks for this information..Really helpful

    ReplyDelete
  9. Very well explained, Thank you
    -Ziaur

    ReplyDelete
  10. Hi, one question here , while creating the reference if i use the option to copy the referenced wsdl into my local directory it will solve any design time issues right?
    what will be the difference between this (copying while creating the reference )and referring it from oramds?

    ReplyDelete
  11. There is no difference both the approaches will work fine, but only the different is reusing the same wsdl with the other components.

    Also when ever there is a change in the parent wsdl the same change needs to be done in multiple places(if the same wsdl is refereed from multiple components)

    The MDS is the best place to keep the common artifacts.

    Regards
    Albin I

    ReplyDelete
  12. Hi Albin,
    Thanks for the info.I have one doubt

    if i have the following scenario A calls B--> i will keep the artifacts of B (wsdl ,xsd ) in MDS. Lets say i have to make a change in B wsdl or XSD. How do i load B wsdl or xsd updated version in to MDS?? what i mean is how do i replace with the new version in MDS in case any change? what are the steps involved here.

    ReplyDelete
  13. You have to redploy(deploy) the MDS jar as you deployed first time.

    If still u are having doubt,please let me know i can help u.

    Regards
    Albin I

    ReplyDelete
  14. Hi Albin,

    Nice blog.
    You said composite will do the retry in case of dependencies but in my case i have just two composite one is called the other(a->b) and after restart composite 'a' status is still pending even after composite 'b' is deployed for long time. Do i have to do any setting to increase the retries??

    I Appreciate your assistance.

    Thanks

    ReplyDelete
  15. Also ...how can i create the abstract wsdl from concrete wsdl? in order to upload in MDS.

    Thanks

    ReplyDelete
    Replies
    1. The difference between the concrete and abstract wsdl is abstract wsdl will not have the binding and service details.

      You can get the abstract wsdl from the jdeveloper project in design time else you can get the runtime concrete wsdl and upload to MDS, if you want you can remove the binding and service details from the concrete wsdl before uploading to MDS.

      Regards
      Albin I

      Delete
  16. Hi,

    Do abstarct wsdl in MDS should have port binding and service.

    ReplyDelete
  17. Refer the following url for difference between abstract and concrete wsdl - http://sathyam-soa.blogspot.in/2012/10/abstract-wsdl-vs-concrete-wsdl.html

    Abstract wsdl in MDS normally wont have binding and service section but there is no harm in having that.

    Regards
    Albin I

    ReplyDelete
  18. Hi:
    I'm following your suggestions and I don't know how to import the WSDL's to a particular MDS location (apps).

    ReplyDelete
    Replies
    1. Refer the below url for details on deploying the shared artifacts to MDS.
      https://blogs.oracle.com/reynolds/entry/share_enjoy_using_a_jdeveloper

      The deployment also can be done through ANT script.

      Regards
      Albin I

      Delete
  19. Hi Albin,
    What should the location attribute in the binding.ws element of the reference point to- oramds/local OR actual endpointURI ? And how does the service endpointURI get applied for runtime?


    Thank you.
    --

    ReplyDelete
  20. Hi Albin,
    Will this resolve the error "java.lang.NoClassDefFoundError: oracle/mds/net/OraMDSURLInfoProvider" ???
    I am facing this while deploying any SOA Composite project in JDeveloper.
    Thanks.

    ReplyDelete
  21. Hello.! Actually i have exactly the same problem, but i have two environments, the first it's my local weblogic in my own pc and the other it's a production server, both servers had a weblogic version 10.3.6, but in my local machine that solution working but in the server not work ... any suggestion?

    ReplyDelete