Axis2

37 views
Skip to first unread message

Ed Bowler

unread,
Mar 15, 2011, 10:26:37 AM3/15/11
to java-sh...@googlegroups.com
Hey,

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?

James Jefferies

unread,
Mar 19, 2011, 5:06:33 PM3/19/11
to Sheffield Java User Group
Sorry, my brain switched off once I saw Clojure before my eyes ;)

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

as for another meet, that'd be great - do you reckon we could do an
extended lunch meeting?

James
> http://stackoverflow.com/questions/5127678/apache-axis-fails-after-ch...

Ed Bowler

unread,
Mar 22, 2011, 11:40:55 AM3/22/11
to java-sh...@googlegroups.com
On Sat, Mar 19, 2011 at 9:06 PM, James Jefferies
<jamesje...@gmail.com> wrote:
> Sorry, my brain switched off once I saw Clojure before my eyes ;)

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?

ian...@gmail.com

unread,
Mar 22, 2011, 11:50:02 AM3/22/11
to java-sh...@googlegroups.com, Ed Bowler
I fancy a meetup,

+1

:)

--
Ian Ibbotson
W: http://ianibbo.me
E: ian...@gmail.com
skype: ianibbo
twitter: ianibbo

James Jefferies

unread,
Mar 22, 2011, 5:30:28 PM3/22/11
to Sheffield Java User Group
On Mar 22, 3:40 pm, Ed Bowler <ed.bow...@gmail.com> wrote:
> On Sat, Mar 19, 2011 at 9:06 PM, James Jefferies
>
> <jamesjeffer...@gmail.com> wrote:
> > Sorry, my brain switched off once I saw Clojure before my eyes ;)
>
> 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,

well, at least we had the same 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.

your bad indeed, blaming Axis ;)

Stuart Grimshaw

unread,
Mar 23, 2011, 4:42:02 AM3/23/11
to java-sh...@googlegroups.com
On Tue, Mar 22, 2011 at 3:40 PM, Ed Bowler <ed.b...@gmail.com> wrote:
>> as for another meet, that'd be great - do you reckon we could do an
>> extended lunch meeting?
>
> sure ... anyone else?

yeah, dunno about the extended part at the moment, but I'm for for a meetup.

Reply all
Reply to author
Forward
0 new messages