You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Rupesh M G <Ru...@ibsplc.com> on 2009/05/25 15:44:23 UTC

Tuscany + BPEL + Webservice

Hello friend,

        I'm working on a sample application to evaluate the different 
possibilities with Tuscany. And I'm stuck at invoking an existing 
web-service from a tuscany implementation.BPEL. 


The flow starts from a jsp page invoking a tuscany implementation.spring. 
This will trigger an implementation.bpel. This bpel has to invoke an 
existing web-service.

So I did the following steps, and got the below mentioned error situation. 
Please check if I missed any steps. I feel the partner link is not 
properly established.


(1) Created a new wsdl file & declared the partnerlinktype
-------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="TaxServiceDefinition"
        targetNamespace="http://ws.tcc.com/" xmlns:tns="http://ws.tcc.com/
"
        xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:SOAP11="
http://schemas.xmlsoap.org/wsdl/soap/"
        xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="
http://schemas.xmlsoap.org/wsdl/"
        xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/">
 
        <wsdl:import namespace="http://ws.tcc.com/" location=
"proftax.wsdl"/>
 
        <plnk:partnerLinkType name="TaxPartnerLinkType">
                <plnk:role name="askForTax" portType="tns:ProfTaxPortType" 
/>
        </plnk:partnerLinkType>

</wsdl:definitions>


(2) Imported the new wsdl to the bpel & created the partnerlink.
--------------------------------------------------------------------------------------------
        <import location="tax-service.wsdl" importType="
http://schemas.xmlsoap.org/wsdl/"
                namespace="http://ws.tcc.com/" />

        <partnerLinks>
                <partnerLink name="taxPartnerLink" partnerLinkType=
"tax:TaxPartnerLinkType"
                        partnerRole="askForTax" />
        </partnerLinks>


(3) Invoked the partner link from bpel
------------------------------------------------------
                <invoke partnerLink="taxPartnerLink" operation="getTax" 
                                        portType="tax:ProfTaxPortType" 
inputVariable="myTaxRequest"
                                        outputVariable="myTaxResponse"/>


(4) Observation
-----------------------
05-25@17:57:15 ERROR - Error sending message 
(mex={PartnerRoleMex#hqejbhcnphr4avl8up3384 [PID 
{http://tuscany.apache.org/implementation/bpel/example/helloworld}HelloWorld-1] 
calling null.getTax(...)}): Cannot stringify null Node!
java.lang.IllegalArgumentException: Cannot stringify null Node!
        at org.apache.ode.utils.DOMUtils.domToString(DOMUtils.java:419)
        at 
org.apache.tuscany.sca.implementation.bpel.ode.ODEExternalService$1$1.call(
ODEExternalService.java:114)
        at java.util.concurrent.FutureTask$Sync.innerRun(
FutureTask.java:269)
        at java.util.concurrent.FutureTask.run(FutureTask.java:123)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
ThreadPoolExecutor.java:650)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(
ThreadPoolExecutor.java:675)
        at java.lang.Thread.run(Thread.java:595)


(5) Tuscany debug level information
-----------------------------------------------------
05-25@17:57:15 DEBUG - ASSIGN Writing variable 'myTaxRequest' value '<?xml 
version="1.0" encoding="UTF-8"?>
<message><getTax><getTax xmlns="http://ws.tcc.com/" xmlns:tax="
http://ws.tcc.com/" xmlns:tns="
http://tuscany.apache.org/implementation/bpel/example/helloworld" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                                                        <arg0 xmlns:ns2="
http://helloworld/">bpel world!!!</arg0>
 </getTax></getTax></message>'
05-25@17:57:15 DEBUG - INVOKING PARTNER: partnerLink={PartnerLinkInstance 
partnerLinkDecl=OPartnerLink#20,scopeInstanceId=5}, op=getTax 
channel=InvokeResponseChannel#20)
05-25@17:57:15 DEBUG - INVOKE PARTNER (SEP): sessionId=null 
partnerSessionId=null
05-25@17:57:15 DEBUG - Routed: svcQname 
{http://tuscany.apache.org}taxPartnerLink --> null
05-25@17:57:15 DEBUG - Invoking a partner operation: getTax
05-25@17:57:15 DEBUG - replyAsync mex=hqejbhcnphr4avl8up3384
05-25@17:57:15 DEBUG - Setting execution state on instance 4


(6) Additional information
-------------------------------------
The above mentioned pre-existing web-service is actually a tuscany 
implementation.spring with binding.ws. 
I saved the generated wsdl to a local file. Then imported it to the new 
wsdl mentioned in step 1, and declared the partnerlink type.

This is the wsdl obtained when I type the url of the existing webservice.


<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="taxComponent.$promoted$profTaxService" 
targetNamespace="http://ws.tcc.com/taxComponent/$promoted$profTaxService" 
xmlns:tns="http://ws.tcc.com/taxComponent/$promoted$profTaxService" 
xmlns:ns0="http://ws.tcc.com/" xmlns:SOAP11="
http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="
http://schemas.xmlsoap.org/wsdl/">
  <wsdl:import namespace="http://ws.tcc.com/" 
location="/Sca_Bpel/profTaxService?wsdl=WEB-INF/proftax.wsdl">
    </wsdl:import>
  <wsdl:service name="ProfTaxPortTypeService">
    <wsdl:port name="ProfTaxServicePort" 
binding="ns0:ProfTaxServiceBindingsss">
      <SOAP11:address location="
http://192.168.2.222:8080/Sca_Bpel/profTaxService"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>



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."