开发者

Why is jboss seeing an empty List<Object> from Coldfusion webservice that returns an array of structs?

I have a coldfusion 8 webservice that returns an array

<cffunction access="remote" name="testMethod" returntype="array">
    <cfset myArray = ArrayNew(1)>
    <cfset myArray[1] = "Steve">
    <cfreturn myArray/>
</cffunction>

I am using jboss 5.1 GA community with Jbossws 3.2.2.GA consuming the service. The stubs are being built with axis 1.4

VerityService_Service locator = new VerityService_Service(verityServiceURL, new QName("http://webservices", "verityService"));      
ChunkedEncodingFeature feature = new ChunkedEncodingFeature(false);
VerityS开发者_C百科ervice verityService = locator.getVerityServiceCfc(feature);
List<Object> helloWorld = verityService.testMethod();

if I call this from a coldfusion page I get a nice array. If I call it from my java code running on the jboss server it returns: [[testMethodReturn: null]]

I used wireshark and sniffed the http protocol and I get an xml packet:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<testMethodResponse xmlns="http://webservices">
<testMethodReturn>
 <testMethodReturn xsi:type="xsd:string">Steve</testMethodReturn>
</testMethodReturn>
</testMethodResponse>
</soapenv:Body>
</soapenv:Envelope>

A very similiar but a little more useful webservice has been working fine with jboss 4.0.2 for a few years now and we are just migrating to jboss 5.1 and this is happening.

Anyone have a similiar issue


Just a shot in the dark here - but shouldn't you be storing the result in an Array rather than a List?

i.e.

Array<Object> helloWorld = verityService.testMethod();

Just a thought.


I changed the Coldfusion webservice to return a query type rather than an array. Then the generated stub returned a DocumentQueryBean. That object was populated by the webservice call where the array was not. I don't know why jbossws libraries don't handle the xml returned when the service returns an array. The wsdl indicates that a query returns the type tns1:DocumentQueryBean and an array returns the type xsd:anyType.

Although I didn't solve this I am ok with the change and will use this instead.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜