AnsweredAssumed Answered

Problems with Actitivi 5.9 and Web Service calls

Question asked by erny18031 on May 8, 2012
Latest reply on Oct 9, 2012 by frederikheremans1
Hi.

Hi would like to use the standard BPMN way to call web services (no specific clients).

My BPMN is something like this:

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xmlns:activiti="http://activiti.org/bpmn"
             xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
             xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"
             xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI"
             typeLanguage="http://www.w3.org/2001/XMLSchema"
             expressionLanguage="http://www.w3.org/1999/XPath"
             targetNamespace="http://www.activiti.org/test"
             xmlns:tns="http://www.activiti.org/test"
             xmlns:weather="http://www.webserviceX.NET">
  <import importType="http://schemas.xmlsoap.org/wsdl/"
        location="http://www.webservicex.net/globalweather.asmx?WSDL"
        namespace="http://www.webserviceX.NET" />

  <process id="ProcesoEjemplo" name="ProcesoEjemplo">
    <ioSpecification>
        <dataInput id="dataInputOfProcess" itemSubjectRef="tns:requestItem" />
        <dataOutput id="dataOutputOfProcess" itemSubjectRef="tns:responseItem" />
        <inputSet>
           <dataInputRefs>dataInputOfProcess</dataInputRefs>
        </inputSet>
        <outputSet>
           <dataOutputRefs>dataOutputOfProcess</dataOutputRefs>
        </outputSet>
     </ioSpecification>
    <startEvent id="startevent1" name="Start"></startEvent>

    <serviceTask id="wscall" name="LLamar WS" implementation="##WebService" operationRef="tns:operationId">
        <ioSpecification>
              <dataInput itemSubjectRef="tns:requestItem" id="dataInputOfServiceTask" />
              <dataOutput itemSubjectRef="tns:responseItem" id="dataOutputOfServiceTask" />
              <inputSet>
                      <dataInputRefs>dataInputOfServiceTask</dataInputRefs>
              </inputSet>
              <outputSet>
                      <dataOutputRefs>dataOutputOfServiceTask</dataOutputRefs>
              </outputSet>
        </ioSpecification>
        <dataInputAssociation>
            <sourceRef>dataInputOfProcess</sourceRef>
              <targetRef>dataInputOfServiceTask</targetRef>
            <assignment>
                  <from>${dataInputOfProcess.pais}</from>
                  <to>${dataInputOfServiceTask.CountryName}</to>
                </assignment>
        </dataInputAssociation>
        <dataOutputAssociation>
            <sourceRef>dataOutputOfServiceTask</sourceRef>
              <targetRef>dataOutputOfProcess</targetRef>
            <assignment>
                  <from>${dataOutputOfServiceTask}</from>
                  <to>${dataInputOfProcess.ciudades}</to>
                </assignment>
          </dataOutputAssociation>
    </serviceTask>

  </process>
  <interface name="Interface" implementationRef="weather:GlobalWeatherSoap">
      <!– Operation: implementationRef = QName of WSDL Operation –>
      <operation id="operationId" name="Operacion WS" implementationRef="weather:GetCitiesByCountry">
         <inMessageRef>tns:requestMessage</inMessageRef>
         <outMessageRef>tns:responseMessage</outMessageRef>
      </operation>
  </interface>
<message id="requestMessage" itemRef="tns:requestItem" />
<message id="responseMessage" itemRef="tns:responseItem" />
<itemDefinition id="requestItem" structureRef="weather:GetCitiesByCountry" />
<itemDefinition id="responseItem" structureRef="weather:GetCitiesByCountryResponse" />

</definitions>

Whenever I run the test (whithout activiti-cxf) I get :

org.activiti.engine.ActivitiException: Could not find importer for type http://schemas.xmlsoap.org/wsdl/ | diagrams/ProcesoEjemplo.bpmn20.xml | line 16 | column 50
Could not import item of type http://schemas.xmlsoap.org/wsdl/ | diagrams/ProcesoEjemplo.bpmn20.xml | line 16 | column 50

When I include activiti-cxf, I get the following error:

java.lang.ClassCastException: com.sun.codemodel.JCodeModel$JReferencedClass cannot be cast to com.sun.codemodel.JDefinedClass
   at org.activiti.engine.impl.webservice.CxfWSDLImporter.importStructure(CxfWSDLImporter.java:152)
   at org.activiti.engine.impl.webservice.CxfWSDLImporter.importTypes(CxfWSDLImporter.java:146)
   at org.activiti.engine.impl.webservice.CxfWSDLImporter.importFrom(CxfWSDLImporter.java:106)
   at org.activiti.engine.impl.webservice.CxfWSDLImporter.importFrom(CxfWSDLImporter.java:69)
   at org.activiti.engine.impl.bpmn.parser.BpmnParse.parseImports(BpmnParse.java:310)


What do I wrong?

Thanx.
Erny

Outcomes