cancel
Showing results for 
Search instead for 
Did you mean: 

BPMN2-Spec-compliant Webservice-Call: Problem importing WSDL

rguenther
Champ in-the-making
Champ in-the-making
Hey there,
first I would like to say thank you for the wide range of JUnit-Examples which are useful to understand the Engine.
I'm trying to call a simple Webservice the Specification-compliant way. So I did the following steps (meant to be helpful for interested users)
    1) downloaded Eclipse WTP in order to provide own Webservices. Tutorial: eclipse help section.
    2) imported the activiti cxf examples
    3) created a BPMN2-Model with service task which invokes the Webservice (with IOSpecification, without Java Delegate-class)
    4) Edited the org.activiti.engine.test.bpmn.servicetask.WebServiceUELTest in order to execute the process
The WSDL declares a simple string as input and output, but a java.lang.ClassCastException is thrown during it's parsed.
I've posted the WSDL, BPMN 2 Model, the class to execute the BPMN Model and the Console Output while deploying and executing the BPMN Model.
The CxfWSDLImporter.java says:
java.lang.ClassCastException: com.sun.codemodel.JCodeModel$JReferencedClass cannot be cast to com.sun.codemodel.JDefinedClass

This is confusing because I'm using only one xsd:string.

Any suggestions are welcome. Keep up the good work!  Smiley Happy
6 REPLIES 6

jbarrez
Star Contributor
Star Contributor
mmm, the first thing that comnes to mind: do you have the right dependencies on your classpath (ie the apache cxf version that is compliant with the Activiti engine?)

rguenther
Champ in-the-making
Champ in-the-making
Compatibility: good catch!  Smiley Wink
Solution: using Tomcat 7 and Cxf 2.4.1 instead of Tomcat 6 and Axis2.

I am experiencing problems when calling a webservice with custom classes.
The class "ProducerID" keeps two Strings. Activiti seems to fail creating and loading that class from informations provided in the (generated) WSDL
Webservice-Structure:
package "Proxy" with class "ProducerID"

Resulting Exception: ActivitiClassLoadingException: Class not found: proxy.ProducerID

I'm using the latest activiti-5.7 cxf example to call the webservice from BPMN-Process. Are there any settings regarding the classloader?

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
but is that webinf the same as the activiti engine is in?

rguenther
Champ in-the-making
Champ in-the-making
I edited my last post - activiti attempts and fails to create and load a class defined by an external webservice. Itdoesn't matter if soap 1.1 oder soap 1.2 ist used. Are there settings regarding the classloader-stuff?

jbarrez
Star Contributor
Star Contributor
Is it possible to fabricate a simple unit test - with a maven pom with the depenencies you use. That way I can look into it here.
But typically, these things are a pain to get right - it depends on the container ur using and which JDK version, etc ..

mahdsip
Champ in-the-making
Champ in-the-making
Hi there,

I have the same problem. If I use Basic data Object(i.e. String, Int,etc) in the Web Service returning Object there is no problem, but if I try to "envelope" Basic data into Custom Data Object I get in the deployment the following:

org.activiti.engine.ActivitiClassLoadingException: Class not found: package.CustomDataObject

Being the service definition:

    <!– Operation: implementationRef = QName of WSDL Operation –>
    <operation id="carRentalOperation" name="Cars" implementationRef="imath:getCar">
      <inMessageRef>tns:carRequestMessage</inMessageRef>
      <outMessageRef>tns:carResponseMessage</outMessageRef>
    </operation>   

  <message id="carRequestMessage" itemRef="tns:carRequestItem" />
  <message id="carResponseMessage" itemRef="tns:carResponseItem" />

  <itemDefinition id="carRequestItem" structureRef="imath:getCar" />
  <itemDefinition id="carResponseItem" structureRef="imath:getCarResponse" />

Being the XML model:

<xs:complexType name="CarRentalType"><xs:sequence>
<xs:element name="Company" type="xs:string"/>
<xs:element name="Price" type="xs:int"/>
</xs:sequence>
</xs:complexType>

<xs:element name="getCar" type="getCar"/>
<xs:complexType name="getCar">
<xs:sequence>
<xs:element name="parametro" type="xs:int"/>
</xs:sequence>
</xs:complexType>
<xs:element name="getCarResponse" type="getCarResponse"/>
<xs:complexType name="getCarResponse">
<xs:sequence>
<xs:element minOccurs="0" name="car" type="CarRentalType"/>
</xs:sequence>
</xs:complexType>
Any idea??

Thanks