• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CF10: Consuming SOAP-Service - Axis2 Enumeration

New Here ,
Jun 03, 2013 Jun 03, 2013

Copy link to clipboard

Copied

Hi all,

Im trying to call a webservice with a complex-within-complex structure. Here an extract form the wsdl:

<simpleType name="ProductType">

    <restriction base="xsd:string">

     <enumeration value="Car"/>

     <enumeration value="Truck"/>

    </restriction>

   </simpleType>

<complexType name="Product">

    <sequence>

     <element name="id" type="xsd:string"/>

     <element name="type" type="impl:ProductType"/>

     </sequence>

</complexType>

If i call the webservice with a structure as Parameter

<cfset local.ws.addProduct( {

    id: 'p01234',

    type: 'Truck'

} )>

I get an Error.

Cannot perform web service invocation addProduct.

The fault returned when invoking the web service operation is:
org.apache.axis2.AxisFault: product cannot be null!! 

If i change the wsdl file, so the Type of the element "type" is also "xsd:string", then it works perfectly. Problem is, changing the wsdl file by myself is a absolute no-go, since i have to consume it form our customers.

Based on reserches i've found that older Axis2 version didn't implement the Enumeration-Type, but the one shipped with CF10 should (Axis2 v1.7).

I've found this Thread: http://forums.adobe.com/thread/88154

I tried to copy the generated stubs for productType in the cfusion/wwwroot/WEB-INF/classes and create a object with createObject("java","productType") which -of course- generated an Error saying that i cannot create from abstract classes. sigh.

Did anyone managed to call an Webservice with Enumerations in WSDL?

Best regards,
Maertsch

Views

1.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

New Here , Aug 29, 2014 Aug 29, 2014

Set the wsversion to 1 and try again.


<cfscript>
  args = { refreshWSDL=true, wsversion=1 };
  ws = createObject("webservice", "http://yourwebserivce?wsdl", args);
  result =
ws.addProduct( {

                                         id: 'p01234',

                                         type: 'Truck'

                                           } )>


</cfscript>

http://stackoverflow.com/questions/15385642/issue-using-net-web-service-from-coldfusion

Votes

Translate

Translate
New Here ,
Aug 29, 2014 Aug 29, 2014

Copy link to clipboard

Copied

LATEST

Set the wsversion to 1 and try again.


<cfscript>
  args = { refreshWSDL=true, wsversion=1 };
  ws = createObject("webservice", "http://yourwebserivce?wsdl", args);
  result =
ws.addProduct( {

                                         id: 'p01234',

                                         type: 'Truck'

                                           } )>


</cfscript>

http://stackoverflow.com/questions/15385642/issue-using-net-web-service-from-coldfusion

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation