axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From laredotornado <laredotorn...@gmail.com>
Subject Ant task: generating client code when a username/password is required
Date Tue, 15 Feb 2011 17:50:18 GMT

Hi,

I downloaded Axis2 and am trying to run the client code generation Ant task. 
Here is my simple build file (right from the web site):


==========Begin ant buildfile ================
<?xml version="1.0"?>
<project name="CodegenExample" default="main" basedir=".">

        <path id="example.classpath">
                <fileset dir="/Users/davea/axis2-1.5.4/lib">
                        <include name="**/*.jar" />
                </fileset>
        </path>

        <target name="declare" >
                <taskdef name="codegen"
                        classname="org.apache.axis2.tool.ant.AntCodegenTask"
                        classpathref="example.classpath"/>
        </target>

        <target name="main" depends="declare">
                <codegen
wsdlfilename="https://subdomain.mydomain.com/EWS/Services.wsdl"
                        output="./"
                        serverside="true"
                        generateservicexml="true"/>
        </target>

</project>
===========end ant buildfile ===============

However my external WSDL requires a username and password, and I can't
figure out how I tell the Ant task what those are.  How do you pass those
in?  Consequently, running the task results in

declare:

main:
  [codegen] Retrieving document at
'https://subdomain.mydomain.com/EWS/Services.wsdl'.

BUILD FAILED
/Users/davea/buildclient.xml:20:
org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL
	at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:156)
	at
org.apache.axis2.tool.ant.AntCodegenTask.execute(AntCodegenTask.java:416)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
	at org.apache.tools.ant.Task.perform(Task.java:348)
	at org.apache.tools.ant.Target.execute(Target.java:390)
	at org.apache.tools.ant.Target.performTasks(Target.java:411)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1366)
	at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1249)
	at org.apache.tools.ant.Main.runBuild(Main.java:801)
	at org.apache.tools.ant.Main.startAnt(Main.java:218)
	at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
	at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=OTHER_ERROR:
Unable to resolve imported document at
'https://subdomain.mydomain.com/EWS/Services.wsdl'.: java.io.IOException:
Server returned HTTP response code: 401 for URL:
https://subdomain.mydomain.com/EWS/Services.wsdl
	at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
	at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
	at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.readInTheWSDLFile(CodeGenerationEngine.java:288)
	at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:111)
	... 18 more
Caused by: java.io.IOException: Server returned HTTP response code: 401 for
URL: https://subdomain.mydomain.com/EWS/Services.wsdl
	at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
	at
sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)
	at java.net.URL.openStream(URL.java:1010)
	at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown Source)
	... 22 more


Thanks, - Dave
-- 
View this message in context: http://old.nabble.com/Ant-task%3A-generating-client-code-when-a-username-password-is-required-tp30933403p30933403.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Mime
View raw message