Anyone know how to stop Apache Axis2 from fetching the WSDL before
every request? Or change where it thinks the WSDL is?
I have a WS client that will hit the same SOAP service on multiple
boxes. I have Maven fetching the WSDL from a dev server and
generating Java code, using Axis and the XmlBeans Data Binding. Every
time I make a WS call, Axis requests the WSDL from the dev server, and
then proceeds to make the correct call to the web service.
I'm not using CXF or JAXB because I'm writing a Clojure app, and need
something a bit more stand-alone.
Here's some code:
(ns rivelin.integration.magento.ws-client
(:import [rivelin.integration.magento MagentoServiceCallbackHandler
MagentoServiceStub]
[magento LoginDocument LoginDocument$Factory LoginDocument$Login]
[rivelin Err]
[org.apache.axis2 AxisFault]))
(defn login [magento-api-url username api-key]
(let [request (LoginDocument$Factory/newInstance)
stub (MagentoServiceStub. nil magento-api-url)]
(try
(doto (.addNewLogin request)
(.setUsername username)
(.setApiKey api-key))
(.. (.login stub request)
getLoginResponse getLoginReturn)
(catch AxisFault fault
(throw (Err. {:handle :magento-login-failed
:message "Magento API login failed - check url, username and api-key"
:soap-fault fault
:soap-fault-message (.getMessage fault)}))))))
I'm running this at the REPL:
rivelin.integration.magento.ws-client> (login
"http://othermagento.dev/index.php/api/" "test" "1234567890")
and getting this in the Apache HTTPD logs:
magento.dev - - [15/Mar/2011:14:09:16 +0000] "GET
/index.php/api/index/index/wsdl/1/ HTTP/1.1" 200 9222
othermagento.dev - - [15/Mar/2011:14:09:16 +0000] "POST
/index.php/api/ HTTP/1.1" 200 538
I've found things like this on the internets:
http://stackoverflow.com/questions/5127678/apache-axis-fails-after-change-in-wsdl
Any ideas where I can go from here?
Ed
P.S. Are we planning on having another meet-up at some point?
i'm getting like that with everything but clojure now ... ;)
> Erm, I'm sure you've solved this by now, but can't you just look at
> the Axis 2 source?
>
> http://axis.apache.org/axis2/java/core/svn.html
that was my strategy, and it was making me sad ... so i thought i'd
ask you guys, but it turned out to not be an Axis problem. The PHP
SOAP service was requesting it's own WSDL on every request, and I just
assumed it was the old Axis bug. My bad.
> as for another meet, that'd be great - do you reckon we could do an
> extended lunch meeting?
sure ... anyone else?
+1
:)
--
Ian Ibbotson
W: http://ianibbo.me
E: ian...@gmail.com
skype: ianibbo
twitter: ianibbo
yeah, dunno about the extended part at the moment, but I'm for for a meetup.