Skip to Content.
Sympa Menu

en - [sympa-users] Problems with SOAP and java

Subject: The mailing list for listmasters using Sympa

List archive

Chronological Thread  
  • From: <address@concealed>
  • To: address@concealed
  • Subject: [sympa-users] Problems with SOAP and java
  • Date: Wed, 21 May 2008 16:43:08 +0200

Hi,

I'm currently working with Sympa 5.3.3 and the SOAP interface.

I have created my Java client code as directed on your page:
http://www.sympa.org/manual/soap#web_server_setup

using axis 1.4. I've then used the stubs to create a list.

I posted a request for help back in March regarding a Bad types exception, the
java code, produced from the wsdl was expecting a boolean but the perl sub
"createList" with sympasoap.pm returned 1, which Java interpreted as an int.
Serge kindly suggested a fix which was just to change "createList" from
"return
1" to just "return", unfortunately this resulted in a null pointer error my
java code. Eventually I settled for "return true". This has worked well up
until now when I have been exploring the soap service
authenticateRemoteAppAndRun.

According to the WSDL this service must return an array of string. When I use
this method using the "createList" service I was getting the SAXException:
Found character data inside an array element while deserializing. This was
because the createList service was just returning "true" which is a string not
a string array. To overcome this I have had to change the sympasoap.pm sub
createList to return the following:
return SOAP::Data->name('result')->type('boolean')->value(1);

this ensures that a standalone call to createList results in a valid response
of type boolean as defined by the wsdl.
The down side of this now is that the return from authenticateRemoteAppAndRun
still throws a SAXExceptionl. In order to overcome this I am now writing code
within the sub authenticateRemoteAppAndRun to check what is being returned by
the service being accessed from it and if it is something other than a string
array I am altering it ensure it is returned as a string element within an
array. For example with the boolean returned from createList I create a new
SOAP:Data item of type string with a value of true and push this onto a new
array object which gets successfully returned to my java code containing a
value I can work with.

Has anyone else come across issues such a this and am I missing something? If
the service authenticateRemoteAppAndRun is supposed to work with all other
services such as createList, review, closeList etc should it not be checking
that the return types from these services are applicable to what
authenticateRemoteAppAndRun is returning? I don't think java is quite a
forgiving as perl.

many thanks in advance,

Catherine



Archive powered by MHonArc 2.6.19+.

Top of Page