While the CodeGenerator is reading the wsdlDocument, it is not using the
username and password.
Definition wsdl4jDef = readInTheWSDLFile(wsdlUri);
public Definition readInTheWSDLFile(final String uri) throws WSDLException {
WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
reader.setFeature("javax.wsdl.importDocuments", true);
return reader.readWSDL(uri);
}
It is just passing the uri to get the WSDL.
I have modified the CodeGenerator to take not read the WSDL using
WSDLReader. Instead I am retrieving the WSDL(using HTTPConnection) and using
it.
Paul
On Wed, Oct 20, 2010 at 3:51 PM, carsten madsen (JIRA) <[email protected]>wrote:
>
> [
> https://issues.apache.org/jira/browse/AXIS2-4060?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12922902#action_12922902]
>
> carsten madsen commented on AXIS2-4060:
> ---------------------------------------
>
> This is also an issue here!
>
> > wsdl2java is unable to retrieve a WSDL when basic authentication is
> required
> >
> ----------------------------------------------------------------------------
> >
> > Key: AXIS2-4060
> > URL: https://issues.apache.org/jira/browse/AXIS2-4060
> > Project: Axis2
> > Issue Type: Bug
> > Affects Versions: 1.4.1, 1.4
> > Reporter: Jorge Medina
> > Assignee: Dimuthu Leelarathne
> >
> > When access to the WSDL requires basic authentication, wsdl2java fails to
> send the credentials in version 1.4.1
> > while version 1.3 works fine.
> > Using version 1.4.1:
> > > wsdl2java -uri
> http://ssmith:[email protected]:8080/webservices/mywsdl.wsdl -s
> -uw -u
> > you will get HTTP error 401 as shown below, while the same command works
> fine when using version 1.3.
> > ------ ---- --- --- --- --- --- ---
> > Retrieving document at '
> http://ssmith:[email protected]:8080/company-webservices/mywsdl.wsdl
> '.
> > Exception in thread "main"
> org.apache.axis2.wsdl.codegen.CodeGenerationException
> > : Error parsing WSDL
> > at
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat
> > ionEngine.java:156)
> > at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
> > at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
> > Caused by: javax.wsdl.WSDLException: WSDLException:
> faultCode=OTHER_ERROR: Unabl
> > e to resolve imported document at '
> http://ssmith:[email protected]:8
> > 080/webservices/mywsdl.wsdl'.: java.io.IOException: Server retu
> > rned HTTP response code: 401 for URL:
> http://ssmith:[email protected]
> > m:8080/webservices/mywsdl.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>(CodeGenerat
> > ionEngine.java:111)
> > ... 2 more
> > Caused by: java.io.IOException: Server returned HTTP response code: 401
> for URL:
> > http://ssmith:[email protected]:8080/webservices/mailingCru
> > dWsdl.wsdl
> > at
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
> > nection.java:1241)
> > at java.net.URL.openStream(URL.java:1009)
> > at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown
> Source)
> >
> > ... 6 more
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>