Expand my Community achievements bar.

WebService for SOAP - problem with wsdl file parser

Avatar

Level 1
Hi group,



I have one problem with WebService class



In my wsdl file I have:






<xsd:complexType name="DirectoryListing">

<xsd:sequence>

<xsd:element name="directories" type="tns:Directory"
minOccurs="1" maxOccurs="unbounded" ></xsd:element>

<xsd:element name="files" type="tns:File" minOccurs="0"
maxOccurs="unbounded"></xsd:element>

</xsd:sequence>

</xsd:complexType>





And I've got the following error when calling function which
return this type of data:






WSDLError faultString="Type tns:DirectoryListing not
resolvable" faultCode="WSDL.BadType" faultDetail="null"]

at mx.rpc.soap::WSDLParser/
http://www.adobe.com/2006/flex/mx/internal::parseMessage()
|C:\dev\enterprise_gmc\frameworks\mx\rpc\soap\WSDLParser.as:749]

at mx.rpc.soap::WSDLOperation/parseMessages()
|C:\dev\enterprise_gmc\frameworks\mx\rpc\soap\WSDLOperation.as:62]

at mx.rpc.soap::Operation/
http://www.adobe.com/2006/flex/mx/internal::invokePendingCall()
|C:\dev\enterprise_gmc\frameworks\mx\rpc\soap\Operation.as:532]

at mx.rpc.soap::Operation/send()
|C:\dev\enterprise_gmc\frameworks\mx\rpc\soap\Operation.as:492]

at Function/
http://adobe.com/AS3/2006/builtin::apply()

at mx.rpc::AbstractService/
http://www.adobe.com/2006/actionscript/flash/proxy::callProperty()
|C:\dev\enterprise_gmc\frameworks\mx\rpc\AbstractService.as:287]







This function work with php soap client, so I assume that
soap communication is ok.



Whole wsdl file:
http://hoborg.zapto.org/~wojtas/workspace/ensure%20back-end/ensure.wsdl

function name: getDirectoryListing

port: FilesPort


test
Page




I can make work around by creating new type DirectoriesList
and FilesList as soap-enc:Array, but I think that it's a bug in
WebService implementation.



...

Also, you can't create a function without input, WebService
won't parse the wsdl file (You have to create fake nullElement or
nullType)
5 Replies

Avatar

Level 2
From a quick look at this WSDL the issue looks like we don't
support SOAP encoded arrays of custom types (instead of built in
types) very well and therefore this is a bug. A suggested work
around may be to use a sequence of an unbounded number of elements
instead of the deprecated soap encoded array for transmitting an
Array.



Also, I'll enter a bug for the second observation 'you can't
create a function without input, WebService won't parse the wsdl
file ' as well.

Avatar

Level 1
The original problem ware predefined values which are not
supported by flex WebService (<choice>).



But the operations with no input are really needed (I think).

Avatar

Former Community Member
Hi,



I have a similar problem. I fail to see how to use the
suggested work around ("a sequence of an unbounded number of
elements"). Would it be possible to post an example of how Bill
Brama's Directory Listing would look like using this strategy?



Best Regards,

Hakon Amundsen



Avatar

Level 1
Let me know If you still want to see this example. The wsdl
file has change since then and I'm using soap-enc array's instead.
I didn't have time to play with wsdl. But... I have to refactor my
code and if I manage to use "a sequence of an unbounded number of
elements" I will post an example.

Avatar

Former Community Member
We have also changed our wsdl file as our problem was related
to the use of xsd:import statements. See this blog-post by my
colleague:




http://kjellsj.blogspot.com/2006/12/how-to-expose-wcf-service-also-as-asmx.html