You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Vassilis Virvilis <v....@biovista.com> on 2009/04/08 13:04:29 UTC

apache cxf service and soappy client

Hello everybody,

recently I was able to debug and successfully use an apache cxf webservice from a soappy client.

There were 3 distinct tricks I had to use and so I figured to document the tricks to a public place in case anybody else is interested

The first observation is that for methods not containing any input everything works as advertised

The problem starts when you want to actually pass any parameters. In that case you have to:
1) specify the namespace
2) use the patch below to enable the namespace per argument support
3) if the medhod has multiple parameters you have to specify the correct ordering

here are the steps in an example

#!/usr/bin/python

import SOAPpy

ns1="http://iface.ws.lib.biovista.com/";

server = SOAPpy.SOAPProxy("http://srv-eu.biovista.com/ws/BEAService", namespace=ns1); # step 1

print server.getAvailableTypes();
print server.getText(pubmed_id=1233);
#server.config.dumpSOAPOut = 1;
#server.config.dumpSOAPIn = 1;
server.config.argsOrdering = {'getBibliography': ['name', 'type', 'max_results']}; # step 3
print server.getBibliography(name="il-6", type="Gene", max_results=4);

----------------- patch to SOAPpy -----------------------   # step 2

--- SOAPBuilder.py.orig 2009-04-08 12:00:34.000000000 +0300
+++ SOAPBuilder.py      2009-04-08 13:23:02.000000000 +0300
@@ -316,6 +316,8 @@

         tag = tag or self.gentag()

+        if self.namespace:
+            tag = ns_map.get(self.namespace) + ":" + tag
         tag = toXMLname(tag) # convert from SOAP 1.2 XML name encoding

         a = n = t = ''


     .bill