Please be more specific - where is the NPE?
Main Topics
Browse All TopicsHow to avoid NullPointerException while creating a client stub from a given WSDL using axis ?
Details as follows
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
r u sure -I works ? i tried with this and got OPTIONS warning !
anyway,
i tried with -v only....it shows generating 4 java files (i found 4 java files in the folder) and after that it throws the same NullPointerError message i posted ?
i tried with -D only ....it shows some lists which i don't understand whether those are errors or just simple print out.
-h, --help
print this message and exit
-v, --verbose
print informational messages
-n, --noImports
only generate code for the immediate WSDL document
-O, --timeout <argument>
timeout in seconds (default is 45, specify -1 to disable)
-D, --Debug
print debug information
-W, --noWrapped
turn off support for "wrapped" document/literal
-q, --quiet
do not print any informational or debug messages (except err
ors)
-s, --server-side
emit server-side bindings for web service
-S, --skeletonDeploy <argument>
deploy skeleton (true) or implementation (false) in deploy.w
sdd. Default is false. Assumes --server-side.
-N, --NStoPkg <argument>=<value>
mapping of namespace to package
-f, --fileNStoPkg <argument>
file of NStoPkg mappings (default NStoPkg.properties)
-p, --package <argument>
override all namespace to package mappings, use this package
name instead
-o, --output <argument>
output directory for emitted files
-d, --deployScope <argument>
add scope to deploy.wsdd: "Application", "Request", "Session
"
-t, --testCase
emit junit testcase class for web service
-a, --all
generate code for all elements, even unreferenced ones
-T, --typeMappingVersion <argument>
indicate 1.1 or 1.2. The default is 1.1 (SOAP 1.1 JAX-RPC c
ompliant. 1.2 indicates SOAP 1.1 encoded.)
-F, --factory <argument>
name of a custom class that implements GeneratorFactory inte
rface (for extending Java generation functions)
-H, --helperGen
emits separate Helper classes for meta data
-B, --buildFile
emit Ant Buildfile for web service
-U, --user <argument>
username to access the WSDL-URI
-P, --password <argument>
password to access the WSDL-URI
-X, --classpath
additional classpath elements
-i, --nsInclude <argument>
include namespace in generated code
-x, --nsExclude <argument>
exclude namespace from generated code
-c, --implementationClassName <argument>
custom name of web service implementation
-u, --allowInvalidURL
emit file even if WSDL endpoint URL is not a valid URL
-w, --wrapArrays
Prefers building beans to straight arrays for wrapped XML ar
ray types (defaults to off).
i tried with I and i but none worked
I think you might have a different version. This is the guide i was using:
http://ws.apache.org/axis/
I did as @mbodewes: above and got
<?xml version="1.0" encoding="UTF-8" ?>
- <soapenv:Envelope xmlns:soapenv="http://sche
- <soapenv:Body>
- <soapenv:Fault>
<faultcode xmlns:ns1="http://xml.apac
<faultstring>The AXIS engine could not find a target service to invoke! targetService is null</faultstring>
- <detail>
<ns2:hostname xmlns:ns2="http://xml.apac
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
i have masked the hostname in the above.
I have used ant axis ......this comes with the distribution.
i am pasting the sample tags here .
<taskdef name="axis-java2wsdl" classname="org.apache.axis
loaderref="axis" >
<classpath refid="classpath.id"/>
</taskdef>
<taskdef name="axis-admin" classname="org.apache.axis
loaderref="axis" >
<classpath refid="classpath.id"/>
</taskdef>
<taskdef name="axis-wsdl2java" classname="org.apache.axis
loaderref="axis" >
<classpath refid="classpath.id"/>
</taskdef>
Business Accounts
Answer for Membership
by: cofactorPosted on 2008-05-12 at 00:48:50ID: 21545181
I have a WSDL file.
Java ./myservice.wsdl
tion a.JavaBean Writer.pre process(Ja vaBeanWrit er.java:29 5) a.JavaBean Writer.<in it>(JavaBe anWriter.j ava:160) a.JavaType Writer.get BeanWriter (JavaTypeW riter.java :174) a.JavaType Writer.<in it>(JavaTy peWriter.j ava:89) a.JavaGene ratorFacto ry.getGene rator(Java GeneratorF actory.jav a:318) arser.gene rateTypes( Parser.jav a:545) arser.gene rate(Parse r.java:432 ) arser.acce ss$000(Par ser.java:4 5) arser$WSDL Runnable.r un(Parser. java:362) d.java:595 )
I want to generate client stub from it .
The WSDL uses complex types .i have a srv.XSD file
I tried to generate the client stub this way..
D:\folder\java org.apache.axis.wsdl.WSDL2
java.lang.NullPointerExcep
at org.apache.axis.wsdl.toJav
at org.apache.axis.wsdl.toJav
at org.apache.axis.wsdl.toJav
at org.apache.axis.wsdl.toJav
at org.apache.axis.wsdl.toJav
at org.apache.axis.wsdl.gen.P
at org.apache.axis.wsdl.gen.P
at org.apache.axis.wsdl.gen.P
at org.apache.axis.wsdl.gen.P
at java.lang.Thread.run(Threa
whats the resolution ?