Axis WSDL2Java generated code: Server Error when performing requests in quick succession
I have been provided with a 3rd party wsdl and a deployment descriptor etc for custom encryption for an Axis web service. I used WSDL2Java to generate the java classes and it all works pretty well... up to a point. When I invoke the methods several minutes apart they work correctly and return valid data. but when I invoke them (as I need to) in quick succession I get a plain old Server Error (below).
If I ouptut the axisFault fault codes and details I get the following:-
class org.apache.axis.AxisFault Fault Code = {http://xml.apache.org/axis/}Server Fault Reason = Server Error Fault String = Server Error Fault Details = [Lorg.w3c.dom.Element;@2d4ba772 [Server Error at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:473) at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281) at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.jboss.web.tomcat.secu开发者_C百科rity.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:595) , 3rdpartyhostname
Can anyone please help? I'm at my wits end.. Could it be a timing / caching issue? Perhaps one of the cache values in the createCall() method that the WSDL2JAVA tool creates?
Here's how I generate an axis client with an ant build script:
<java classname="org.apache.axis.wsdl.WSDL2Java" fork="true" failonerror="true" classpathref="classpath.path">
<arg value="-v"/>
<arg value="-o"/>
<arg file="tmp/src"/>
<arg value="-p"/>
<arg value="com.your.package"/>
<arg value="${server.url}/${servicename}?wsdl"/>
</java>
Maybe you are using a weird combination of parameters? Have your checked on those? The above is for axis 1.4 as far as I remember.
What version are you using 2.0 or 1.4? I know it took me quite some time to get this right for 2.0. Here's how it works with mvn:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>axistools-maven-plugin</artifactId>
<version>1.3</version>
<configuration>
<outputDirectory>${project.build.directory}/generated/main/java</outputDirectory>
<urls>
<url>http://yourserver:yourport/YourService?wsdl</url>
</urls>
<packageSpace>com.your.package</packageSpace>
<serverSide>false</serverSide>
<subPackageByFileName>false</subPackageByFileName>
<wrapArrays>false</wrapArrays>
</configuration>
<executions>
<execution>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
I hope this helps shed some light or further ideas on the issue.
You might also want to check if the stuff you deployed is working right. This might not be an issue of the client generation at all. After all it says server error. Check the logfiles on the server for stacktraces maybe there is a clue there.
精彩评论