You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Rupesh M G <Ru...@ibsplc.com> on 2009/04/01 15:10:33 UTC

tuscany + ws binding + spring

Hello friend,

        I'm writing a SCA application with Spring composites on Tuscany 
1.4.

My immediate requirement is to invoke a spring composite with web-service 
binding. 
My final target is to invoke this from BPEL.

We followed the calculator-ws-webapp in the tuscany samples for this 
trial.

Now we are stuck at the following point. Kindly refer to the attached 
eclipse workspace (lib not included)

Scenario
--------------

BudgetServiceComponent is a spring composite loaded from 
budgetdata.composite.
index.jsp invokes BudgetServiceComponent. 

BudgetServiceComponent has 2 references --> CalculatorComposite & 
ProfTaxComposite. They are loaded from their respective composite files.

All the composite implementations are Spring.

This situation works well under the default Java binding.

Problem
-------------
>From the budget composite, we are not able to use binding.ws to invoke its 
references.

The workspace is attached, and there we are trying to invoke the 
ProfTaxComposite.

The error details are also attached. 


Analysis
-------------

Seems this is a limitation of Tuscany 1.4. Because when we created a local 
component for the ProfTaxComposite inside the budgetdata.composite, it 
worked.

Please comment on this. Or is there anything wrong with my approach?


Thanks & Regards,
Rupesh







DISCLAIMER: 

"The information in this e-mail and any attachment is intended only for 
the person to whom it is addressed and may contain confidential and/or 
privileged material. If you have received this e-mail in error, kindly 
contact the sender and destroy all copies of the original communication. 
IBS makes no warranty, express or implied, nor guarantees the accuracy, 
adequacy or completeness of the information contained in this email or any 
attachment and is not liable for any errors, defects, omissions, viruses 
or for resultant loss or damage, if any, direct or indirect."





Re: tuscany + ws binding + spring

Posted by Santhosh T R <Sa...@ibsplc.com>.
Thank you for the reply.

To use a webservice binding inside a SCA component, we tried the following 
3 URIs. 
But none of them worked. Your suggestion was the second one.

CASE 1
http://localhost:8080/<webapp context name>/<name of the local component 
targeted by the reference>
Reference will have a local target whose implementation is the external 
composite.
<sca:component name="BudgetDataComponent">
                <sca:implementation.spring location=
"budgetdata-spring-context.xml" />
                <sca:reference name="BusinessCalculatorService" target=
"CalculatorServiceComponent"/>
                <sca:reference name="ProfTaxService" >
            <interface.java interface="com.tcc.ws.ProfTaxService" /> 
            <binding.ws uri="http://localhost:8080/SCA-BPEL-4/
ProfTaxComponent"/> 
        </sca:reference> 
</sca:component>
<sca:component name="ProfTaxComponent">
                 <sca:implementation.composite name="tax:ProfTaxComposite"
/>
</sca:component>

CASE 2
http://localhost:8080/<webapp context name>/<name of the external 
composite level service pointed by the reference>
This service will be promoted to a component inside the external 
composite.
Budget Data Composite
      <sca:component name="BudgetDataComponent">
                <sca:implementation.spring location=
"budgetdata-spring-context.xml" />
                <sca:reference name="BusinessCalculatorService" target=
"CalculatorServiceComponent"/>
                <sca:reference name="ProfTaxService" >
            <interface.java interface="com.tcc.ws.ProfTaxService" /> 
            <binding.ws uri="http://localhost:8080/SCA-BPEL-4/
ProfTaxService"/> 
        </sca:reference> 
        </sca:component>
ProfTaxComposite
     <sca:service name="ProfTaxService" promote="ProfTaxService"/>
    <component name="ProfTaxServiceComponent">
        <implementation.spring location="tax-spring-context.xml" />
        <service name="ProfTaxService1">
            <interface.java interface="com.tcc.ws.ProfTaxService" /> 
            <binding.ws/>
        </service>
    </component>

CASE 3
http://localhost:8080/<webapp context name>/<name of the external 
component pointed by the reference>
Directly calling the component in the external composite.
Budget Data Composite
      <sca:component name="BudgetDataComponent">
                <sca:implementation.spring location=
"budgetdata-spring-context.xml" />
                <sca:reference name="BusinessCalculatorService" target=
"CalculatorServiceComponent"/>
                <sca:reference name="ProfTaxService" >
            <interface.java interface="com.tcc.ws.ProfTaxService" /> 
            <binding.ws uri="http://localhost:8080/SCA-BPEL-4/
ProfTaxServiceComponent"/> 
        </sca:reference> 
        </sca:component>
ProfTaxComposite
      <component name="ProfTaxServiceComponent">
        <implementation.spring location="tax-spring-context.xml" />
        <service name="ProfTaxService1">
            <interface.java interface="com.tcc.ws.ProfTaxService" /> 
            <binding.ws/>
        </service>
    </component>


CASE 4
We got this worked only when we brought the required component locally 
inside our composite, and set it as a target to the reference.

Budget Data Composite
     <component name="BudgetServiceComponent">
                <implementation.java class=
"com.tcc.sca.demo.budget.BudgetServiceImpl" />
                <reference name="businessCalculatorService" target=
"CalculatorComponent" />
                <reference name="addService">
                        <interface.java interface=
"com.tcc.sca.demo.ws.AddService" />
                        <binding.ws uri=
"http://localhost:8080/SCA-BPEL-8/AddServiceComponent" />
                </reference>
                <reference name="profTaxService" >
                        <interface.java interface=
"com.tcc.sca.demo.tax.ProfTaxService" />
                        <binding.ws
                                uri=
"http://localhost:8080/SCA-BPEL-8/ProfTaxServiceComponent" />
                </reference>
        </component>
        <component name="ProfTaxServiceComponent">
                <implementation.spring location="tax-spring-context.xml" 
/>
                <implementation.java class=
"com.tcc.sca.demo.tax.ProfTaxServiceImpl" />
                <service name="ProfTaxService">
                        <interface.java interface=
"com.tcc.sca.demo.tax.ProfTaxService" />
                        <binding.ws />
                </service>
        </component>

Our final target is a POC allowing all binding combinations between JAVA , 
Spring and BPEL.
Please share your knowledge on these questions.

Is it possible to use the contract first approach with tuscany

It seems the embedded Axis implementation is creating WSDL on the fly. How 
can we modify the generated WSDL? Can we disable the WSDL generation and 
supply one? We found some problems with the generated WSDL with some BPEL 
designer tool.

Does Tuscany 1.4 limits invoking a service exposed by a composite form 
another? These are the results we got.




Best Regards,
Santhosh




Ramkumar R <ra...@gmail.com> 
04/02/2009 12:20 PM
Please respond to
user@tuscany.apache.org


To
user@tuscany.apache.org
cc

Subject
Re: tuscany + ws binding + spring






Hi Rupesh,

In your case, I see that the issue is with the uri="
http://localhost:8080/BpelScaWS/taxRef" which is used to reference the 
binding.ws service exposed in the taxComponent of proftax.composite.

You need to mention the service name as part of the uri. I believe using 
uri="http://localhost:8080/BpelScaWS/profTaxService" will resolve your 
issue.

2009/4/1 Rupesh M G <Ru...@ibsplc.com>

Hello friend, 

        I'm writing a SCA application with Spring composites on Tuscany 
1.4. 

My immediate requirement is to invoke a spring composite with web-service 
binding. 
My final target is to invoke this from BPEL. 

We followed the calculator-ws-webapp in the tuscany samples for this 
trial. 

Now we are stuck at the following point. Kindly refer to the attached 
eclipse workspace (lib not included) 

Scenario 
-------------- 

BudgetServiceComponent is a spring composite loaded from 
budgetdata.composite. 
index.jsp invokes BudgetServiceComponent. 

BudgetServiceComponent has 2 references --> CalculatorComposite & 
ProfTaxComposite. They are loaded from their respective composite files. 

All the composite implementations are Spring. 

This situation works well under the default Java binding. 

Problem 
------------- 
>From the budget composite, we are not able to use binding.ws to invoke its 
references. 

The workspace is attached, and there we are trying to invoke the 
ProfTaxComposite. 

The error details are also attached. 


Analysis 
------------- 

Seems this is a limitation of Tuscany 1.4. Because when we created a local 
component for the ProfTaxComposite inside the budgetdata.composite, it 
worked. 

Please comment on this. Or is there anything wrong with my approach? 


Thanks & Regards,
Rupesh 







DISCLAIMER: 

"The information in this e-mail and any attachment is intended only for 
the person to whom it is addressed and may contain confidential and/or 
privileged material. If you have received this e-mail in error, kindly 
contact the sender and destroy all copies of the original communication. 
IBS makes no warranty, express or implied, nor guarantees the accuracy, 
adequacy or completeness of the information contained in this email or any 
attachment and is not liable for any errors, defects, omissions, viruses 
or for resultant loss or damage, if any, direct or indirect."







-- 
Thanks & Regards,
Ramkumar Ramalingam





DISCLAIMER: 

"The information in this e-mail and any attachment is intended only for 
the person to whom it is addressed and may contain confidential and/or 
privileged material. If you have received this e-mail in error, kindly 
contact the sender and destroy all copies of the original communication. 
IBS makes no warranty, express or implied, nor guarantees the accuracy, 
adequacy or completeness of the information contained in this email or any 
attachment and is not liable for any errors, defects, omissions, viruses 
or for resultant loss or damage, if any, direct or indirect."





Re: Java To WSDL

Posted by Raymond Feng <en...@gmail.com>.
Yes, if the property is declared by a public setter, annotate the method with @XmlTransient. If it's by a public field, then annotate the field with @XmlTransient.

Thanks,
Raymond


From: santiago.aranda@telvent.com 
Sent: Tuesday, April 21, 2009 3:42 AM
To: user@tuscany.apache.org 
Cc: user@tuscany.apache.org 
Subject: Re: Java To WSDL



It is working but I have to annotate "get" method instead. 

@XmlTransient 
public String getAddress(){ 
        return this.address; 
} 

Address is not in generated WSLD 

Thank you very much 

Un saludo.
Santiago Miguel Aranda Rojas
Telvent Interactiva 
Extension: 35999 


"Raymond Feng" <en...@gmail.com> 
"Raymond Feng" 
20/04/2009 19:03 
Por favor, responda a user 
      Para:  <us...@tuscany.apache.org>  
      cc:   
      Asunto:  Re: Java To WSDL 




Can you try to annotate the field with @XmlTransient? 
  
http://java.sun.com/javase/6/docs/api/javax/xml/bind/annotation/XmlTransient.html 
  
Thanks, 
Raymond 
From: santiago.aranda@telvent.com 
Sent: Monday, April 20, 2009 7:18 AM 
To: user@tuscany.apache.org 
Subject: Java To WSDL 


Hi. 

I have one method that is called "getPersonList()". This returns a list of people. Person class is very simple. It has attributes like "name", "address". I am publishing this method using Tuscany WS binding. It works.  Could I ignore one of these attributes?. I mean if I wouldn't share the address for example.  Attribute "address" wouldn't be in the generated WSDL. Could I put an annotation in the top of attribute, for example @ignoreWSDL? 

Thanks 

Un saludo.
Santiago Miguel Aranda Rojas
Telvent Interactiva 
Extension: 35999 

Re: Java To WSDL

Posted by sa...@telvent.com.
It is working but I have to annotate "get" method instead. 

@XmlTransient 
public String getAddress(){
        return this.address;
}

Address is not in generated WSLD

Thank you very much

Un saludo.
Santiago Miguel Aranda Rojas
Telvent Interactiva 
Extension: 35999


"Raymond Feng" <en...@gmail.com>
"Raymond Feng"
20/04/2009 19:03
Por favor, responda a user

Para:
<us...@tuscany.apache.org>
cc:

Asunto:
Re: Java To WSDL



Can you try to annotate the field with @XmlTransient?
 
http://java.sun.com/javase/6/docs/api/javax/xml/bind/annotation/XmlTransient.html
 
Thanks,
Raymond
From: santiago.aranda@telvent.com 
Sent: Monday, April 20, 2009 7:18 AM
To: user@tuscany.apache.org 
Subject: Java To WSDL


Hi. 

I have one method that is called "getPersonList()". This returns a list of 
people. Person class is very simple. It has attributes like "name", 
"address". I am publishing this method using Tuscany WS binding. It works. 
 Could I ignore one of these attributes?. I mean if I wouldn't share the 
address for example.  Attribute "address" wouldn't be in the generated 
WSDL. Could I put an annotation in the top of attribute, for example 
@ignoreWSDL? 

Thanks 

Un saludo.
Santiago Miguel Aranda Rojas
Telvent Interactiva 
Extension: 35999

Re: Java To WSDL

Posted by Raymond Feng <en...@gmail.com>.
Can you try to annotate the field with @XmlTransient?

http://java.sun.com/javase/6/docs/api/javax/xml/bind/annotation/XmlTransient.html

Thanks,
Raymond

From: santiago.aranda@telvent.com 
Sent: Monday, April 20, 2009 7:18 AM
To: user@tuscany.apache.org 
Subject: Java To WSDL



Hi. 

I have one method that is called "getPersonList()". This returns a list of people. Person class is very simple. It has attributes like "name", "address". I am publishing this method using Tuscany WS binding. It works.  Could I ignore one of these attributes?. I mean if I wouldn't share the address for example.  Attribute "address" wouldn't be in the generated WSDL. Could I put an annotation in the top of attribute, for example @ignoreWSDL? 

Thanks 

Un saludo.
Santiago Miguel Aranda Rojas
Telvent Interactiva 
Extension: 35999

Java To WSDL

Posted by sa...@telvent.com.
Hi.

I have one method that is called "getPersonList()". This returns a list of 
people. Person class is very simple. It has attributes like "name", 
"address". I am publishing this method using Tuscany WS binding. It works. 
 Could I ignore one of these attributes?. I mean if I wouldn't share the 
address for example.  Attribute "address" wouldn't be in the generated 
WSDL. Could I put an annotation in the top of attribute, for example 
@ignoreWSDL?

Thanks

Un saludo.
Santiago Miguel Aranda Rojas
Telvent Interactiva 
Extension: 35999

Re: tuscany + ws binding + spring

Posted by Ramkumar R <ra...@gmail.com>.
Hi Rupesh,

In your case, I see that the issue is with the uri="
http://localhost:8080/BpelScaWS/taxRef" which is used to reference the
binding.ws service exposed in the taxComponent of proftax.composite.

You need to mention the service name as part of the uri. I believe using
uri="http://localhost:8080/BpelScaWS/profTaxService" will resolve your
issue.

2009/4/1 Rupesh M G <Ru...@ibsplc.com>

>
> Hello friend,
>
>         I'm writing a SCA application with Spring composites on Tuscany
> 1.4.
>
> My immediate requirement is to invoke a spring composite with web-service
> binding.
> My final target is to invoke this from BPEL.
>
> We followed the calculator-ws-webapp in the tuscany samples for this trial.
>
> Now we are stuck at the following point. Kindly refer to the attached
> eclipse workspace (lib not included)
>
> Scenario
> --------------
>
> BudgetServiceComponent is a spring composite loaded from
> budgetdata.composite.
> index.jsp invokes BudgetServiceComponent.
>
> BudgetServiceComponent has 2 references --> CalculatorComposite &
> ProfTaxComposite. They are loaded from their respective composite files.
>
> All the composite implementations are Spring.
>
> This situation works well under the default Java binding.
>
> Problem
> -------------
> From the budget composite, we are not able to use binding.ws to invoke its
> references.
>
> The workspace is attached, and there we are trying to invoke the
> ProfTaxComposite.
>
> The error details are also attached.
>
>
> Analysis
> -------------
>
> Seems this is a limitation of Tuscany 1.4. Because when we created a local
> component for the ProfTaxComposite inside the budgetdata.composite, it
> worked.
>
> Please comment on this. Or is there anything wrong with my approach?
>
>
> Thanks & Regards,
> Rupesh
>
>
>
>
>
> *
>
> DISCLAIMER:** *
>
> "The information in this e-mail and any attachment is intended only for the
> person to whom it is addressed and may contain confidential and/or
> privileged material. If you have received this e-mail in error, kindly
> contact the sender and destroy all copies of the original communication. IBS
> makes no warranty, express or implied, nor guarantees the accuracy, adequacy
> or completeness of the information contained in this email or any attachment
> and is not liable for any errors, defects, omissions, viruses or for
> resultant loss or damage, if any, direct or indirect."
>
>
>
>
>


-- 
Thanks & Regards,
Ramkumar Ramalingam