You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Jody Brewster <jo...@hotmail.com> on 2004/01/31 16:09:39 UTC
client returns null values
Maybe someone will find something I'm doing wrong in this code. Instead of
the web service returning a string its returning null. I had this working
awhile back but I forgot how I did it. I remember it possibly being in the
namespace. Any suggestions? Also if anyone sees something I'm doing that's
off the wall. Just let me know, I'm new to axis and Java in general.
I included my ant build, the interface, and the client below. If you need to
see something else, just let me know, and thanks in advance!
/////////// the build.xml
<target name="wsdl2java" depends="axis.init,compile">
<axis-wsdl2java
output="${src}"
url="C:\projects\bjxAS400WebService\src\com\brownjordan\wsTest\testWS.wsdl"
deployscope="session"
serverSide="yes"
skeletonDeploy="yes"
noimports="no"
verbose="no"
typeMappingVersion="1.1"
testcase="no">
<mapping namespace="http://localhost:8080/axis/services/testWS"
package="com.brownjordan.wsTest.build"/>
</axis-wsdl2java>
</target>
<target name="createTestClient" depends="axis.init,compile">
<axis-wsdl2java
output="${src}"
url="http://localhost:8080/axis/services/testWS?wsdl"
deployscope="session"
serverSide="no"
skeletonDeploy="no"
noimports="no"
verbose="no"
typeMappingVersion="1.1"
testcase="no">
<mapping namespace="http://localhost:8080/axis/services/testWS"
package="com.brownjordan.wsTest.client"/>
</axis-wsdl2java>
</target>
<target name="java2wsdl" depends="axis.init,compile">
<axis-java2wsdl
classname="com.brownjordan.wsTest.TestWS"
location="http://localhost:8080/axis/services/testWS"
namespace="http://localhost:8080/axis/services/testWS"
output="${src}/com/brownjordan/wsTest/testWS.wsdl"
>
<!--style="RPC" -->
<classpath>
<pathelement location="${classes}" />
</classpath>
<!--<mappingset>
...
</mappingset>-->
</axis-java2wsdl>
</target>
///////// the client
public class testClass {
public static void main(String args[]) {
TestWSServiceLocator locator = new TestWSServiceLocator();
TestWS service = null;
try {
service = locator.gettestWS();
} catch (ServiceException e) {
e.printStackTrace(); //To change body of catch statement use
Options | File Templates.
}
try {
System.out.println("T: " + service.testThis());
} catch (RemoteException e) {
e.printStackTrace(); //To change body of catch statement use
Options | File Templates.
}
}
}
//////// and the interface:
public class TestWS {
public String testThis()
{
return "Works";
}
}
_________________________________________________________________
There are now three new levels of MSN Hotmail Extra Storage! Learn more.
http://join.msn.com/?pgmarket=en-us&page=hotmail/es2&ST=1