This discussion is archived
1 Reply Latest reply: Jan 6, 2010 6:29 AM by 843830 RSS

BPEL process that works as a "proxy"

843830 Newbie
Currently Being Moderated
Hi

This is my case:
I have a Web Service already installed in server1. I am developing a Web application that has to use this web service. I need that this web app not to be directly related with the web service in server1 so I used GlassfishESB and make a simple BPEL process that acts as a "proxy", it means that this process receive the request from the web app, invoke the web service in server1 and the result will be delivered without any changes to the web app. It will work initially this way and maybe in the future some changes to the data could happen.

I did this:
- I created a new BPEL Module
- Import the WSDL (of the Web Service) through the option: New -> External WSDL Document
- Change the soap:address property to: http://localhost:${HttpDefaultPort}/Services/Service9999/Interface/Service9999.serviceagent/portTypeEndpoint
- Add this as Partner Link in the left side of the BPEL Designer's Design view.
- Import (again) the WSDL (of the Web Service but with a different name) through the option: New -> External WSDL Document
- Leave the soap:address property as it was with the original URL http://server1/Services/Service9999/Interface/Service9999.serviceagent/portTypeEndpoint
- Add this as Partner Link in the right side of the BPEL Designer's Design view.
- Add Receive1, Assign1, Invoke1, Assign2 and Reply1. The Assign1 maps the input from the web application to the input for the external web service. And the Assign2 maps the output from the external web service to the output of the Reply1.

I built it.

- Create a CompositeApp
- Add the JBI component
- Build it

But when I deploy it I get serveral errors:
{color:#ff0000}ERROR: Successful execution of Start: CompositeApp1
WARNING: (JBIMA0405) Start of service assembly CompositeApp1 succeeded partially; some service units failed to start.
* Component: sun-bpel-engine
ERROR: (BPELSE) Service unit CompositeApp1-BpelModule1 failed to load deployment C:\Archivos de programa\glassfish-v2ur2\domains\domain1\jbi\service-assemblies\CompositeApp1\CompositeApp1-BpelModule1\sun-bpel-engine :C:\Archivos de programa\glassfish-v2ur2\domains\domain1\jbi\service-assemblies\CompositeApp1\CompositeApp1-BpelModule1\sun-bpel-engine\Service9999_1_1.wsdl:13: error: sch-props-correct.2: Duplicate global type: FinancingDetails_Block_t@http://www.fixprotocol.org/FIXML-5-0 (Original global type found in file: Service9999_1.wsdl)
Detailed Message :
1: SEVERE :Duplicate global type: FinancingDetails_Block_t@http://www.fixprotocol.org/FIXML-5-0 (Original global type found in file: Service9999_1.wsdl)
2: SEVERE :Duplicate global type: AttrbGrp_Block_t@http://www.fixprotocol.org/FIXML-5-0 (Original global type found in file: Service9999_1.wsdl)
3: SEVERE :Duplicate global type: RootSubParties_Block_t@http://www.fixprotocol.org/FIXML-5-0 (Original global type found in file: Service9999_1.wsdl)
4: SEVERE :Duplicate global type: NestedParties2_Block_t@http://www.fixprotocol.org/FIXML-5-0 (Original global type found in file: Service9999_1.wsdl)
{color}......... and it continues until:
{color:#ff0000}1593: SEVERE :Duplicate attribute group: EvntGrpAttributes@http://www.fixprotocol.org/FIXML-5-0 (Original attribute group found in file: Service9999_1.wsdl)
* Component: sun-http-binding
INFO: (JBIMA0409) Lifecycle operation start succeeded for Service Unit CompositeApp1-sun-http-binding.{color}



The cause seems pretty obvious as both WSDL has the same Schemas and the same types defined so when it tries to deploy it, it finds exactly the same types twice (well, that's what I think)

Am I doing something wrong? Am I missing something? How can I avoid that GlassfishESB duplicates the types?
  • 1. Re: BPEL process that works as a "proxy"
    843830 Newbie
    Currently Being Moderated
    Hi.

    The solution for this was to import the WSDL only once and add a portType2, its binding and its endpoint. I had to create two partnerlinks, one for myRole and another for an externalRol. I linked mypartnerlink with portType2 and the externalpartnerlink with portType. The soap:address for the endpoint related with portType2 had this URL: http://localhost:${HttpDefaultPort}/Services/Service9999/Interface/Service9999.serviceagent/portTypeEndpoint, and the soap:address for the other endpoint had this: http://server1/Services/Service9999/Interface/Service9999.serviceagent/portTypeEndpoint.

    With this setup I could add the same WSDL twice in the process, one for the left side and the other one for the right side. Make sure that the one you add to the left side has the soap:address with the localhost (http://localhost:${HttpDefaultPort}/Servi.....
    ) so choose the correct partnerlink (mypartnerlink). Now you can create the Receive, Assign1, Invoke, Assign2 and Reply and do what I said in the previous post.

    In this way there's not such "Duplicate global type" because the WSDL is imported only once.