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 Rafaqat Ali <sm...@gmail.com> on 2008/06/20 12:18:25 UTC

problem in generating stub on https

Hi,
 I am trying to generate stub using $AXIS2_HOME/bin/bin/wsdl2java.sh from
https://localhost:8443/axis2/services/SomeService?wsdl

following instruction from
http://article.gmane.org/gmane.comp.apache.webservices.axis.user/58499*
*
Now when I try to generate stub using command
$AXIS2_HOME//bin/wsdl2java.sh -uri
https://localhost:8443/axis2/services/GreetingService?wsdl -p
test.wstest.client -uw  -o .
It throws Exception

Exception in thread "main"
org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL
        at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.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:
Unable to resolve imported document at '
https://localhost:8443/axis2/services/GreetingService?wsdl'.:
javax.net.ssl.SSLHandshakeException:
java.security.cert.CertificateException: No name matching localhost found
        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)
        ... 2 more
Caused by: javax.net.ssl.SSLHandshakeException:
java.security.cert.CertificateException: No name matching localhost found
        at
com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174)
        at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1591)
        at
com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:187)
        at
com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:181)
        at
com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:975)
        at
com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:123)
        at
com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:516)
        at
com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:454)
        at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:884)
        at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1096)
        at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1123)
        at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1107)
        at
sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:405)
        at
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:166)
        at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:977)
        at
sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)
        at java.net.URL.openStream(URL.java:1009)
        at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown
Source)
        ... 6 more
Caused by: java.security.cert.CertificateException: No name matching
localhost found
        at
sun.security.util.HostnameChecker.matchDNS(HostnameChecker.java:210)
        at sun.security.util.HostnameChecker.match(HostnameChecker.java:77)
        at
com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:264)
        at
com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:250)
        at
com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:954)
        ... 19 more


Can some one tell me how to resolve ?

Thanks,
--RAFI

Re: problem in generating stub on https

Posted by Rafaqat Ali <sm...@gmail.com>.
I developed java code and service.xml and generated service using axis2
binaries

On server this is how wsdl looks

<wsdl:definitions targetNamespace="http://quickstart.samples/">
−
<wsp:Policy wsu:Id="UsernameTokenOverHTTPS">
−
<wsp:ExactlyOne>
−
<wsp:All>
−
<sp:TransportBinding>
−
<wsp:Policy>
−
<sp:TransportToken>
−
<wsp:Policy>
<sp:HttpsToken RequireClientCertificate="false"/>
</wsp:Policy>
</sp:TransportToken>
−
<sp:AlgorithmSuite>
−
<wsp:Policy>
<sp:Basic256/>
</wsp:Policy>
</sp:AlgorithmSuite>
−
<sp:Layout>
−
<wsp:Policy>
<sp:Lax/>
</wsp:Policy>
</sp:Layout>
<sp:IncludeTimestamp/>
</wsp:Policy>
</sp:TransportBinding>
−
<sp:SignedSupportingTokens>
−
<wsp:Policy>
<sp:UsernameToken sp:IncludeToken="
http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient
"/>
</wsp:Policy>
</sp:SignedSupportingTokens>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
<wsdl:documentation>GreetingService</wsdl:documentation>
−
<wsdl:types>
−
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified"
targetNamespace="http://quickstart.samples/xsd">
−
<xs:element name="greetingResponse">
−
<xs:complexType>
−
<xs:sequence>
<xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
−
<xs:element name="greeting2">
−
<xs:complexType>
−
<xs:sequence>
<xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
−
<xs:element name="greeting2Response">
−
<xs:complexType>
−
<xs:sequence>
<xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name="greetingRequest"/>
−
<wsdl:message name="greetingResponse">
<wsdl:part name="parameters" element="ns:greetingResponse"/>
</wsdl:message>
−
<wsdl:message name="greeting2Request">
<wsdl:part name="parameters" element="ns:greeting2"/>
</wsdl:message>
−
<wsdl:message name="greeting2Response">
<wsdl:part name="parameters" element="ns:greeting2Response"/>
</wsdl:message>
−
<wsdl:portType name="GreetingServicePortType"
wsp:PolicyURIs="#UsernameTokenOverHTTPS">
−
<wsdl:operation name="greeting">
<wsdl:input message="axis2:greetingRequest" wsaw:Action="urn:greeting"/>
<wsdl:output message="axis2:greetingResponse"
wsaw:Action="urn:greetingResponse"/>
</wsdl:operation>
−
<wsdl:operation name="greeting2">
<wsdl:input message="axis2:greeting2Request" wsaw:Action="urn:greeting2"/>
<wsdl:output message="axis2:greeting2Response"
wsaw:Action="urn:greeting2Response"/>
</wsdl:operation>
</wsdl:portType>
−
<wsdl:binding name="GreetingServiceSoap11Binding"
type="axis2:GreetingServicePortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document"/>
−
<wsdl:operation name="greeting">
<soap:operation soapAction="urn:greeting" style="document"/>
−
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
−
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
−
<wsdl:operation name="greeting2">
<soap:operation soapAction="urn:greeting2" style="document"/>
−
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
−
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
−
<wsdl:binding name="GreetingServiceSoap12Binding"
type="axis2:GreetingServicePortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document"/>
−
<wsdl:operation name="greeting">
<soap12:operation soapAction="urn:greeting" style="document"/>
−
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
−
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
−
<wsdl:operation name="greeting2">
<soap12:operation soapAction="urn:greeting2" style="document"/>
−
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
−
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
−
<wsdl:binding name="GreetingServiceHttpBinding"
type="axis2:GreetingServicePortType">
<http:binding verb="POST"/>
−
<wsdl:operation name="greeting">
<http:operation location="GreetingService/greeting"/>
−
<wsdl:input>
<mime:content type="text/xml" part="greeting"/>
</wsdl:input>
−
<wsdl:output>
<mime:content type="text/xml" part="greeting"/>
</wsdl:output>
</wsdl:operation>
−
<wsdl:operation name="greeting2">
<http:operation location="GreetingService/greeting2"/>
−
<wsdl:input>
<mime:content type="text/xml" part="greeting2"/>
</wsdl:input>
−
<wsdl:output>
<mime:content type="text/xml" part="greeting2"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
−
<wsdl:service name="GreetingService">
−
<wsdl:port name="GreetingServiceHttpSoap11Endpoint"
binding="axis2:GreetingServiceSoap11Binding">
<soap:address location="
http://172.17.16.86:8080/axis2/services/GreetingService.GreetingServiceHttpSoap11Endpoint
"/>
</wsdl:port>
−
<wsdl:port name="GreetingServiceHttpSoap12Endpoint"
binding="axis2:GreetingServiceSoap12Binding">
<soap12:address location="
http://172.17.16.86:8080/axis2/services/GreetingService.GreetingServiceHttpSoap12Endpoint
"/>
</wsdl:port>
−
<wsdl:port name="GreetingServiceHttpEndpoint"
binding="axis2:GreetingServiceHttpBinding">
<http:address location="
http://172.17.16.86:8080/axis2/services/GreetingService.GreetingServiceHttpEndpoint
"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

--RAFI

On Fri, Jun 20, 2008 at 5:39 PM, keith chapman <ke...@gmail.com>
wrote:

> Could you post your WSDL please?
>
> Thanks,
> Keith.
>
>
> On Fri, Jun 20, 2008 at 4:59 PM, Rafaqat Ali <sm...@gmail.com> wrote:
>
>> I was using http before but when tried to run client, I was getting
>> Exception
>> Exception in thread "main" org.apache.axis2.AxisFault: SOAP message MUST
>> NOT contain a Document Type Declaration(DTD)
>>         at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
>>         at
>> org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:90)
>>         at
>> org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:353)
>>         at
>> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:416)
>>         at
>> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
>>         at
>> org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
>>         at pk.ingen.wstest.client.GreetingServiceStub.greeting(Unknown
>> Source)
>>         at pk.ingen.wstest.client.GreetingServiceCGClient.main(Unknown
>> Source)
>> Caused by: org.apache.axiom.om.OMException: SOAP message MUST NOT contain
>> a Document Type Declaration(DTD)
>>         at
>> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createDTD(StAXSOAPModelBuilder.java:407)
>>         at
>> org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:226)
>>         at
>> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:156)
>>         at
>> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:105)
>>         at
>> org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:677)
>>         at
>> org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:182)
>>         at
>> org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:112)
>>         at
>> org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:88)
>>         ... 6 more
>>
>>
>> So I tried to generate stub from https.
>> And stubs generated from http are giving this exception, coninuesly.
>>
>> --RAFI
>>
>>
>> On Fri, Jun 20, 2008 at 5:21 PM, Charitha Kankanamge <ch...@wso2.com>
>> wrote:
>>
>>> Hi Rafaqat,
>>> Try to generate the stub as follows. Please use http port instead of
>>> https one.
>>> $AXIS2_HOME//bin/wsdl2java.sh -uri
>>> http://localhost:8080/axis2/services/GreetingService?wsdl <
>>> https://localhost:8443/axis2/services/GreetingService?wsdl> -p
>>> test.wstest.client -uw  -o
>>>
>>> regards
>>> Charitha
>>>
>>>
>>> Rafaqat Ali wrote:
>>>
>>>  Hi,
>>>>  I am trying to generate stub using $AXIS2_HOME/bin/bin/wsdl2java.sh
>>>> from
>>>> https://localhost:8443/axis2/services/SomeService?wsdl
>>>> following instruction from
>>>> http://article.gmane.org/gmane.comp.apache.webservices.axis.user/58499*
>>>> *
>>>> Now when I try to generate stub using command
>>>> $AXIS2_HOME//bin/wsdl2java.sh -uri
>>>> https://localhost:8443/axis2/services/GreetingService?wsdl -p
>>>> test.wstest.client -uw  -o .
>>>> It throws Exception
>>>>
>>>> Exception in thread "main"
>>>> org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL
>>>>        at
>>>> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.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: Unable to resolve imported document at '
>>>> https://localhost:8443/axis2/services/GreetingService?wsdl' <
>>>> https://localhost:8443/axis2/services/GreetingService?wsdl%27>.:
>>>> javax.net.ssl.SSLHandshakeException:
>>>> java.security.cert.CertificateException: No name matching localhost found
>>>>
>>>>        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)
>>>>        ... 2 more
>>>> Caused by: javax.net.ssl.SSLHandshakeException:
>>>> java.security.cert.CertificateException: No name matching localhost found
>>>>        at
>>>> com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174)
>>>>        at
>>>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1591)
>>>>        at
>>>> com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:187)
>>>>        at
>>>> com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:181)
>>>>        at
>>>> com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:975)
>>>>        at
>>>> com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:123)
>>>>        at
>>>> com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:516)
>>>>        at
>>>> com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:454)
>>>>        at
>>>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:884)
>>>>        at
>>>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1096)
>>>>        at
>>>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1123)
>>>>        at
>>>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1107)
>>>>        at
>>>> sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:405)
>>>>        at
>>>> sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:166)
>>>>        at
>>>> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:977)
>>>>        at
>>>> sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)
>>>>        at java.net.URL.openStream(URL.java:1009)
>>>>        at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown
>>>> Source)
>>>>        ... 6 more
>>>> Caused by: java.security.cert.CertificateException: No name matching
>>>> localhost found
>>>>        at
>>>> sun.security.util.HostnameChecker.matchDNS(HostnameChecker.java:210)
>>>>        at
>>>> sun.security.util.HostnameChecker.match(HostnameChecker.java:77)
>>>>        at
>>>> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:264)
>>>>        at
>>>> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:250)
>>>>        at
>>>> com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:954)
>>>>        ... 19 more
>>>>
>>>>
>>>> Can some one tell me how to resolve ?
>>>>
>>>> Thanks,
>>>> --RAFI
>>>>
>>>> ------------------------------------------------------------------------
>>>>
>>>> No virus found in this incoming message.
>>>> Checked by AVG. Version: 7.5.524 / Virus Database: 270.4.1/1510 -
>>>> Release Date: 6/19/2008 3:21 PM
>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>>
>>>
>>
>
>
> --
> Keith Chapman
> Senior Software Engineer
> WSO2 Inc.
> Oxygenating the Web Service Platform.
> http://wso2.org/
>
> blog: http://www.keith-chapman.org

Re: problem in generating stub on https

Posted by keith chapman <ke...@gmail.com>.
Could you post your WSDL please?

Thanks,
Keith.

On Fri, Jun 20, 2008 at 4:59 PM, Rafaqat Ali <sm...@gmail.com> wrote:

> I was using http before but when tried to run client, I was getting
> Exception
> Exception in thread "main" org.apache.axis2.AxisFault: SOAP message MUST
> NOT contain a Document Type Declaration(DTD)
>         at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
>         at
> org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:90)
>         at
> org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:353)
>         at
> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:416)
>         at
> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
>         at
> org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
>         at pk.ingen.wstest.client.GreetingServiceStub.greeting(Unknown
> Source)
>         at pk.ingen.wstest.client.GreetingServiceCGClient.main(Unknown
> Source)
> Caused by: org.apache.axiom.om.OMException: SOAP message MUST NOT contain a
> Document Type Declaration(DTD)
>         at
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createDTD(StAXSOAPModelBuilder.java:407)
>         at
> org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:226)
>         at
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:156)
>         at
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:105)
>         at
> org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:677)
>         at
> org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:182)
>         at
> org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:112)
>         at
> org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:88)
>         ... 6 more
>
>
> So I tried to generate stub from https.
> And stubs generated from http are giving this exception, coninuesly.
>
> --RAFI
>
>
> On Fri, Jun 20, 2008 at 5:21 PM, Charitha Kankanamge <ch...@wso2.com>
> wrote:
>
>> Hi Rafaqat,
>> Try to generate the stub as follows. Please use http port instead of https
>> one.
>> $AXIS2_HOME//bin/wsdl2java.sh -uri
>> http://localhost:8080/axis2/services/GreetingService?wsdl <
>> https://localhost:8443/axis2/services/GreetingService?wsdl> -p
>> test.wstest.client -uw  -o
>>
>> regards
>> Charitha
>>
>>
>> Rafaqat Ali wrote:
>>
>>  Hi,
>>>  I am trying to generate stub using $AXIS2_HOME/bin/bin/wsdl2java.sh from
>>> https://localhost:8443/axis2/services/SomeService?wsdl
>>> following instruction from
>>> http://article.gmane.org/gmane.comp.apache.webservices.axis.user/58499*
>>> *
>>> Now when I try to generate stub using command
>>> $AXIS2_HOME//bin/wsdl2java.sh -uri
>>> https://localhost:8443/axis2/services/GreetingService?wsdl -p
>>> test.wstest.client -uw  -o .
>>> It throws Exception
>>>
>>> Exception in thread "main"
>>> org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL
>>>        at
>>> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.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: Unable to resolve imported document at '
>>> https://localhost:8443/axis2/services/GreetingService?wsdl' <
>>> https://localhost:8443/axis2/services/GreetingService?wsdl%27>.:
>>> javax.net.ssl.SSLHandshakeException:
>>> java.security.cert.CertificateException: No name matching localhost found
>>>
>>>        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)
>>>        ... 2 more
>>> Caused by: javax.net.ssl.SSLHandshakeException:
>>> java.security.cert.CertificateException: No name matching localhost found
>>>        at
>>> com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174)
>>>        at
>>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1591)
>>>        at
>>> com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:187)
>>>        at
>>> com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:181)
>>>        at
>>> com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:975)
>>>        at
>>> com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:123)
>>>        at
>>> com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:516)
>>>        at
>>> com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:454)
>>>        at
>>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:884)
>>>        at
>>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1096)
>>>        at
>>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1123)
>>>        at
>>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1107)
>>>        at
>>> sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:405)
>>>        at
>>> sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:166)
>>>        at
>>> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:977)
>>>        at
>>> sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)
>>>        at java.net.URL.openStream(URL.java:1009)
>>>        at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown
>>> Source)
>>>        ... 6 more
>>> Caused by: java.security.cert.CertificateException: No name matching
>>> localhost found
>>>        at
>>> sun.security.util.HostnameChecker.matchDNS(HostnameChecker.java:210)
>>>        at
>>> sun.security.util.HostnameChecker.match(HostnameChecker.java:77)
>>>        at
>>> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:264)
>>>        at
>>> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:250)
>>>        at
>>> com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:954)
>>>        ... 19 more
>>>
>>>
>>> Can some one tell me how to resolve ?
>>>
>>> Thanks,
>>> --RAFI
>>>
>>> ------------------------------------------------------------------------
>>>
>>> No virus found in this incoming message.
>>> Checked by AVG. Version: 7.5.524 / Virus Database: 270.4.1/1510 - Release
>>> Date: 6/19/2008 3:21 PM
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>
>>
>


-- 
Keith Chapman
Senior Software Engineer
WSO2 Inc.
Oxygenating the Web Service Platform.
http://wso2.org/

blog: http://www.keith-chapman.org

Re: problem in generating stub on https

Posted by Rafaqat Ali <sm...@gmail.com>.
I have a little knowledge how Axis framework works but how is it
implemented, I never tried to know.
but I sent message to this mailing list to get rid of this problem.
If you know the solution, it will be helpful for me.

--RAFI

On Sun, Jun 22, 2008 at 11:00 AM, Amila Suriarachchi <
amilasuriarachchi@gmail.com> wrote:

>
>
> On Fri, Jun 20, 2008 at 4:59 PM, Rafaqat Ali <sm...@gmail.com> wrote:
>
>> I was using http before but when tried to run client, I was getting
>> Exception
>> Exception in thread "main" org.apache.axis2.AxisFault: SOAP message MUST
>> NOT contain a Document Type Declaration(DTD)
>
>
> Do you know how actual  service is implemented. I mean the framwork that
> service uses.
> Axis2 Soap messages send the Document type declaration which is wrong
> according to the SOAP spec. But even .Net does not check for this.
>
> Amila.
>
>>
>>         at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
>>         at
>> org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:90)
>>         at
>> org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:353)
>>         at
>> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:416)
>>         at
>> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
>>         at
>> org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
>>         at pk.ingen.wstest.client.GreetingServiceStub.greeting(Unknown
>> Source)
>>         at pk.ingen.wstest.client.GreetingServiceCGClient.main(Unknown
>> Source)
>> Caused by: org.apache.axiom.om.OMException: SOAP message MUST NOT contain
>> a Document Type Declaration(DTD)
>>         at
>> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createDTD(StAXSOAPModelBuilder.java:407)
>>         at
>> org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:226)
>>         at
>> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:156)
>>         at
>> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:105)
>>         at
>> org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:677)
>>         at
>> org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:182)
>>         at
>> org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:112)
>>         at
>> org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:88)
>>         ... 6 more
>>
>>
>> So I tried to generate stub from https.
>> And stubs generated from http are giving this exception, coninuesly.
>>
>> --RAFI
>>
>>
>> On Fri, Jun 20, 2008 at 5:21 PM, Charitha Kankanamge <ch...@wso2.com>
>> wrote:
>>
>>> Hi Rafaqat,
>>> Try to generate the stub as follows. Please use http port instead of
>>> https one.
>>> $AXIS2_HOME//bin/wsdl2java.sh -uri
>>> http://localhost:8080/axis2/services/GreetingService?wsdl <
>>> https://localhost:8443/axis2/services/GreetingService?wsdl> -p
>>> test.wstest.client -uw  -o
>>>
>>> regards
>>> Charitha
>>>
>>>
>>> Rafaqat Ali wrote:
>>>
>>>  Hi,
>>>>  I am trying to generate stub using $AXIS2_HOME/bin/bin/wsdl2java.sh
>>>> from
>>>> https://localhost:8443/axis2/services/SomeService?wsdl
>>>> following instruction from
>>>> http://article.gmane.org/gmane.comp.apache.webservices.axis.user/58499*
>>>> *
>>>> Now when I try to generate stub using command
>>>> $AXIS2_HOME//bin/wsdl2java.sh -uri
>>>> https://localhost:8443/axis2/services/GreetingService?wsdl -p
>>>> test.wstest.client -uw  -o .
>>>> It throws Exception
>>>>
>>>> Exception in thread "main"
>>>> org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL
>>>>        at
>>>> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.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: Unable to resolve imported document at '
>>>> https://localhost:8443/axis2/services/GreetingService?wsdl' <
>>>> https://localhost:8443/axis2/services/GreetingService?wsdl%27>.:
>>>> javax.net.ssl.SSLHandshakeException:
>>>> java.security.cert.CertificateException: No name matching localhost found
>>>>
>>>>        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)
>>>>        ... 2 more
>>>> Caused by: javax.net.ssl.SSLHandshakeException:
>>>> java.security.cert.CertificateException: No name matching localhost found
>>>>        at
>>>> com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174)
>>>>        at
>>>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1591)
>>>>        at
>>>> com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:187)
>>>>        at
>>>> com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:181)
>>>>        at
>>>> com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:975)
>>>>        at
>>>> com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:123)
>>>>        at
>>>> com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:516)
>>>>        at
>>>> com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:454)
>>>>        at
>>>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:884)
>>>>        at
>>>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1096)
>>>>        at
>>>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1123)
>>>>        at
>>>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1107)
>>>>        at
>>>> sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:405)
>>>>        at
>>>> sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:166)
>>>>        at
>>>> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:977)
>>>>        at
>>>> sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)
>>>>        at java.net.URL.openStream(URL.java:1009)
>>>>        at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown
>>>> Source)
>>>>        ... 6 more
>>>> Caused by: java.security.cert.CertificateException: No name matching
>>>> localhost found
>>>>        at
>>>> sun.security.util.HostnameChecker.matchDNS(HostnameChecker.java:210)
>>>>        at
>>>> sun.security.util.HostnameChecker.match(HostnameChecker.java:77)
>>>>        at
>>>> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:264)
>>>>        at
>>>> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:250)
>>>>        at
>>>> com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:954)
>>>>        ... 19 more
>>>>
>>>>
>>>> Can some one tell me how to resolve ?
>>>>
>>>> Thanks,
>>>> --RAFI
>>>>
>>>> ------------------------------------------------------------------------
>>>>
>>>> No virus found in this incoming message.
>>>> Checked by AVG. Version: 7.5.524 / Virus Database: 270.4.1/1510 -
>>>> Release Date: 6/19/2008 3:21 PM
>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>>
>>>
>>
>
>
> --
> Amila Suriarachchi,
> WSO2 Inc.

Re: problem in generating stub on https

Posted by Amila Suriarachchi <am...@gmail.com>.
On Fri, Jun 20, 2008 at 4:59 PM, Rafaqat Ali <sm...@gmail.com> wrote:

> I was using http before but when tried to run client, I was getting
> Exception
> Exception in thread "main" org.apache.axis2.AxisFault: SOAP message MUST
> NOT contain a Document Type Declaration(DTD)


Do you know how actual  service is implemented. I mean the framwork that
service uses.
Axis2 Soap messages send the Document type declaration which is wrong
according to the SOAP spec. But even .Net does not check for this.

Amila.

>
>         at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
>         at
> org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:90)
>         at
> org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:353)
>         at
> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:416)
>         at
> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
>         at
> org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
>         at pk.ingen.wstest.client.GreetingServiceStub.greeting(Unknown
> Source)
>         at pk.ingen.wstest.client.GreetingServiceCGClient.main(Unknown
> Source)
> Caused by: org.apache.axiom.om.OMException: SOAP message MUST NOT contain a
> Document Type Declaration(DTD)
>         at
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createDTD(StAXSOAPModelBuilder.java:407)
>         at
> org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:226)
>         at
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:156)
>         at
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:105)
>         at
> org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:677)
>         at
> org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:182)
>         at
> org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:112)
>         at
> org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:88)
>         ... 6 more
>
>
> So I tried to generate stub from https.
> And stubs generated from http are giving this exception, coninuesly.
>
> --RAFI
>
>
> On Fri, Jun 20, 2008 at 5:21 PM, Charitha Kankanamge <ch...@wso2.com>
> wrote:
>
>> Hi Rafaqat,
>> Try to generate the stub as follows. Please use http port instead of https
>> one.
>> $AXIS2_HOME//bin/wsdl2java.sh -uri
>> http://localhost:8080/axis2/services/GreetingService?wsdl <
>> https://localhost:8443/axis2/services/GreetingService?wsdl> -p
>> test.wstest.client -uw  -o
>>
>> regards
>> Charitha
>>
>>
>> Rafaqat Ali wrote:
>>
>>  Hi,
>>>  I am trying to generate stub using $AXIS2_HOME/bin/bin/wsdl2java.sh from
>>> https://localhost:8443/axis2/services/SomeService?wsdl
>>> following instruction from
>>> http://article.gmane.org/gmane.comp.apache.webservices.axis.user/58499*
>>> *
>>> Now when I try to generate stub using command
>>> $AXIS2_HOME//bin/wsdl2java.sh -uri
>>> https://localhost:8443/axis2/services/GreetingService?wsdl -p
>>> test.wstest.client -uw  -o .
>>> It throws Exception
>>>
>>> Exception in thread "main"
>>> org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL
>>>        at
>>> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.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: Unable to resolve imported document at '
>>> https://localhost:8443/axis2/services/GreetingService?wsdl' <
>>> https://localhost:8443/axis2/services/GreetingService?wsdl%27>.:
>>> javax.net.ssl.SSLHandshakeException:
>>> java.security.cert.CertificateException: No name matching localhost found
>>>
>>>        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)
>>>        ... 2 more
>>> Caused by: javax.net.ssl.SSLHandshakeException:
>>> java.security.cert.CertificateException: No name matching localhost found
>>>        at
>>> com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174)
>>>        at
>>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1591)
>>>        at
>>> com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:187)
>>>        at
>>> com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:181)
>>>        at
>>> com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:975)
>>>        at
>>> com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:123)
>>>        at
>>> com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:516)
>>>        at
>>> com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:454)
>>>        at
>>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:884)
>>>        at
>>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1096)
>>>        at
>>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1123)
>>>        at
>>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1107)
>>>        at
>>> sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:405)
>>>        at
>>> sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:166)
>>>        at
>>> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:977)
>>>        at
>>> sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)
>>>        at java.net.URL.openStream(URL.java:1009)
>>>        at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown
>>> Source)
>>>        ... 6 more
>>> Caused by: java.security.cert.CertificateException: No name matching
>>> localhost found
>>>        at
>>> sun.security.util.HostnameChecker.matchDNS(HostnameChecker.java:210)
>>>        at
>>> sun.security.util.HostnameChecker.match(HostnameChecker.java:77)
>>>        at
>>> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:264)
>>>        at
>>> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:250)
>>>        at
>>> com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:954)
>>>        ... 19 more
>>>
>>>
>>> Can some one tell me how to resolve ?
>>>
>>> Thanks,
>>> --RAFI
>>>
>>> ------------------------------------------------------------------------
>>>
>>> No virus found in this incoming message.
>>> Checked by AVG. Version: 7.5.524 / Virus Database: 270.4.1/1510 - Release
>>> Date: 6/19/2008 3:21 PM
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>
>>
>


-- 
Amila Suriarachchi,
WSO2 Inc.

Re: problem in generating stub on https

Posted by Rafaqat Ali <sm...@gmail.com>.
I was using http before but when tried to run client, I was getting
Exception
Exception in thread "main" org.apache.axis2.AxisFault: SOAP message MUST NOT
contain a Document Type Declaration(DTD)
        at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
        at
org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:90)
        at
org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:353)
        at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:416)
        at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
        at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
        at pk.ingen.wstest.client.GreetingServiceStub.greeting(Unknown
Source)
        at pk.ingen.wstest.client.GreetingServiceCGClient.main(Unknown
Source)
Caused by: org.apache.axiom.om.OMException: SOAP message MUST NOT contain a
Document Type Declaration(DTD)
        at
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createDTD(StAXSOAPModelBuilder.java:407)
        at
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:226)
        at
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:156)
        at
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:105)
        at
org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:677)
        at
org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:182)
        at
org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:112)
        at
org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:88)
        ... 6 more


So I tried to generate stub from https.
And stubs generated from http are giving this exception, coninuesly.

--RAFI

On Fri, Jun 20, 2008 at 5:21 PM, Charitha Kankanamge <ch...@wso2.com>
wrote:

> Hi Rafaqat,
> Try to generate the stub as follows. Please use http port instead of https
> one.
> $AXIS2_HOME//bin/wsdl2java.sh -uri
> http://localhost:8080/axis2/services/GreetingService?wsdl <
> https://localhost:8443/axis2/services/GreetingService?wsdl> -p
> test.wstest.client -uw  -o
>
> regards
> Charitha
>
>
> Rafaqat Ali wrote:
>
>  Hi,
>>  I am trying to generate stub using $AXIS2_HOME/bin/bin/wsdl2java.sh from
>> https://localhost:8443/axis2/services/SomeService?wsdl
>> following instruction from
>> http://article.gmane.org/gmane.comp.apache.webservices.axis.user/58499*
>> *
>> Now when I try to generate stub using command
>> $AXIS2_HOME//bin/wsdl2java.sh -uri
>> https://localhost:8443/axis2/services/GreetingService?wsdl -p
>> test.wstest.client -uw  -o .
>> It throws Exception
>>
>> Exception in thread "main"
>> org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL
>>        at
>> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.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:
>> Unable to resolve imported document at '
>> https://localhost:8443/axis2/services/GreetingService?wsdl' <
>> https://localhost:8443/axis2/services/GreetingService?wsdl%27>.:
>> javax.net.ssl.SSLHandshakeException:
>> java.security.cert.CertificateException: No name matching localhost found
>>
>>        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)
>>        ... 2 more
>> Caused by: javax.net.ssl.SSLHandshakeException:
>> java.security.cert.CertificateException: No name matching localhost found
>>        at
>> com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174)
>>        at
>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1591)
>>        at
>> com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:187)
>>        at
>> com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:181)
>>        at
>> com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:975)
>>        at
>> com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:123)
>>        at
>> com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:516)
>>        at
>> com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:454)
>>        at
>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:884)
>>        at
>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1096)
>>        at
>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1123)
>>        at
>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1107)
>>        at
>> sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:405)
>>        at
>> sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:166)
>>        at
>> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:977)
>>        at
>> sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)
>>        at java.net.URL.openStream(URL.java:1009)
>>        at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown
>> Source)
>>        ... 6 more
>> Caused by: java.security.cert.CertificateException: No name matching
>> localhost found
>>        at
>> sun.security.util.HostnameChecker.matchDNS(HostnameChecker.java:210)
>>        at sun.security.util.HostnameChecker.match(HostnameChecker.java:77)
>>        at
>> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:264)
>>        at
>> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:250)
>>        at
>> com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:954)
>>        ... 19 more
>>
>>
>> Can some one tell me how to resolve ?
>>
>> Thanks,
>> --RAFI
>>
>> ------------------------------------------------------------------------
>>
>> No virus found in this incoming message.
>> Checked by AVG. Version: 7.5.524 / Virus Database: 270.4.1/1510 - Release
>> Date: 6/19/2008 3:21 PM
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

Re: problem in generating stub on https

Posted by Charitha Kankanamge <ch...@wso2.com>.
Hi Rafaqat,
Try to generate the stub as follows. Please use http port instead of 
https one.
$AXIS2_HOME//bin/wsdl2java.sh -uri 
http://localhost:8080/axis2/services/GreetingService?wsdl 
<https://localhost:8443/axis2/services/GreetingService?wsdl> -p 
test.wstest.client -uw  -o

regards
Charitha


Rafaqat Ali wrote:

> Hi,
>  I am trying to generate stub using $AXIS2_HOME/bin/bin/wsdl2java.sh from
> https://localhost:8443/axis2/services/SomeService?wsdl 
>
> following instruction from
> http://article.gmane.org/gmane.comp.apache.webservices.axis.user/58499*
> *
> Now when I try to generate stub using command
> $AXIS2_HOME//bin/wsdl2java.sh -uri 
> https://localhost:8443/axis2/services/GreetingService?wsdl -p 
> test.wstest.client -uw  -o .
> It throws Exception
>
> Exception in thread "main" 
> org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL
>         at 
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.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: Unable to resolve imported document at 
> 'https://localhost:8443/axis2/services/GreetingService?wsdl' 
> <https://localhost:8443/axis2/services/GreetingService?wsdl%27>.: 
> javax.net.ssl.SSLHandshakeException: 
> java.security.cert.CertificateException: No name matching localhost found
>         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)
>         ... 2 more
> Caused by: javax.net.ssl.SSLHandshakeException: 
> java.security.cert.CertificateException: No name matching localhost found
>         at 
> com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174)
>         at 
> com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1591)
>         at 
> com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:187)
>         at 
> com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:181)
>         at 
> com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:975)
>         at 
> com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:123)
>         at 
> com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:516)
>         at 
> com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:454)
>         at 
> com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:884)
>         at 
> com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1096)
>         at 
> com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1123)
>         at 
> com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1107)
>         at 
> sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:405)
>         at 
> sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:166)
>         at 
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:977)
>         at 
> sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)
>         at java.net.URL.openStream(URL.java:1009)
>         at 
> com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown Source)
>         ... 6 more
> Caused by: java.security.cert.CertificateException: No name matching 
> localhost found
>         at 
> sun.security.util.HostnameChecker.matchDNS(HostnameChecker.java:210)
>         at 
> sun.security.util.HostnameChecker.match(HostnameChecker.java:77)
>         at 
> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:264)
>         at 
> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:250)
>         at 
> com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:954)
>         ... 19 more
>
>
> Can some one tell me how to resolve ?
>
> Thanks,
> --RAFI
>
>------------------------------------------------------------------------
>
>No virus found in this incoming message.
>Checked by AVG. 
>Version: 7.5.524 / Virus Database: 270.4.1/1510 - Release Date: 6/19/2008 3:21 PM
>  
>


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