You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Derek Tam <cw...@gmail.com> on 2008/01/08 16:38:49 UTC
EJB-based web services cannot find WSDL
Trying to call the web services from a client but geronimo reports WSDL
fileNotFoundException. Any ideas what may caused it.
Web services client:
...
int v1 = Integer.parseInt(value1);
int v2 = Integer.parseInt(value2);
URL url = new URL("http://localhost:8080/Calculator/calculator?wsdl");
QName qname = new QName("http://jws.samples.geronimo.apache.org",
"Calculator");
Service service = Service.create(url, qname);
CalculatorService calc =
(CalculatorService)service.getPort(CalculatorService.class);
int sum = calc.add(v1, v2);
...
WSDL:
<wsdl:definitions name="Calculator"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://jws.samples.geronimo.apache.org"
xmlns:tns="http://jws.samples.geronimo.apache.org">
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://jws.samples.geronimo.apache.org"
targetNamespace="http://jws.samples.geronimo.apache.org"
attributeFormDefault="unqualified"
elementFormDefault="qualified">
<xsd:element name="add">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value1" type="xsd:int"/>
<xsd:element name="value2" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="addResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="return" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
<wsdl:message name="add">
<wsdl:part name="add" element="tns:add"/>
</wsdl:message>
<wsdl:message name="addResponse">
<wsdl:part name="addResponse" element="tns:addResponse"/>
</wsdl:message>
<wsdl:portType name="CalculatorPortType">
<wsdl:operation name="add">
<wsdl:input name="add" message="tns:add"/>
<wsdl:output name="addResponse" message="tns:addResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="CalculatorSoapBinding"
type="tns:CalculatorPortType">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="add">
<soap:operation soapAction="add" style="document"/>
<wsdl:input name="add">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="addResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Calculator">
<wsdl:port name="CalculatorPort"
binding="tns:CalculatorSoapBinding">
<soap:address
location="http://localhost:8080/Calculator/calculator"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
geronimo.log:
javax.xml.ws.WebServiceException: The following WSDL exception occurred:
WSDLException: faultCode=WS
DL4JWrapper : : WSDLException: faultCode=WSDL4JWrapper : :
java.io.FileNotFoundException: http://loc
alhost:8080/Calculator/calculator?wsdl
at
org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:1
72)
at
org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:69)
at
org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.setupWsdlDefinition(Servic
eDescriptionImpl.java:551)
at
org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.<init>(ServiceDescriptionI
mpl.java:143)
at
org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.createServiceDescription(D
escriptionFactoryImpl.java:101)
at
org.apache.axis2.jaxws.description.DescriptionFactory.createServiceDescription(Descriptio
nFactory.java:69)
at
org.apache.axis2.jaxws.spi.ServiceDelegate.<init>(ServiceDelegate.java:87)
at
org.apache.axis2.jaxws.spi.Provider.createServiceDelegate(Provider.java:45)
at javax.xml.ws.Service.<init>(Unknown Source)
at javax.xml.ws.Service.create(Unknown Source)
at org.apache.jsp.add_jsp._jspService(add_jsp.java:107)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
--
View this message in context: http://www.nabble.com/EJB-based-web-services-cannot-find-WSDL-tp14692118s134p14692118.html
Sent from the Apache Geronimo - Dev mailing list archive at Nabble.com.
Re: EJB-based web services cannot find WSDL
Posted by Derek Tam <cw...@gmail.com>.
I don't see any "Configuring EJB JAX-WS Web Service" message in log file.
Will it be problem in ejb config files?
ejb-jar.xml:
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
version="3.0">
<enterprise-beans>
<session>
<description>EJB3 Session Bean Encapsulating all addition
Operations</description>
<display-name>CalculatorBean</display-name>
<ejb-name>CalculatorBean</ejb-name>
<service-endpoint>org.apache.geronimo.samples.ejb.CalculatorService</service-endpoint>
<ejb-class>org.apache.geronimo.samples.ejb.CalculatorBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<service-ref>
<service-ref-name>services/Calculator</service-ref-name>
<service-interface>javax.xml.ws.Service</service-interface>
<wsdl-file>META-INF/wsdl/CalculatorService.wsdl</wsdl-file>
</service-ref>
</session>
</enterprise-beans>
</ejb-jar>
openejb-jar.xml:
<?xml version="1.0" encoding="UTF-8"?>
<openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.1"
xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.1"
xmlns:security="http://geronimo.apache.org/xml/ns/security-1.1"
xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2">
<sys:environment>
<sys:moduleId>
<sys:groupId>org.apache.geronimo.samples</sys:groupId>
<sys:artifactId>Calculator</sys:artifactId>
<sys:version>1.0-SNAPSHOT</sys:version>
<sys:type>car</sys:type>
</sys:moduleId>
<sys:dependencies />
<sys:hidden-classes />
<sys:non-overridable-classes />
</sys:environment>
<enterprise-beans>
<session>
<ejb-name>CalculatorBean</ejb-name>
<service-ref>
<service-ref-name>services/Calculator</service-ref-name>
<port>
<port-name>CalculatorPort</port-name>
<protocol>http</protocol>
<host>localhost</host>
<port>8080</port>
<uri>/Calculator/calculator</uri>
</port>
</service-ref>
</session>
</enterprise-beans>
</openejb-jar>
Jarek Gawor-2 wrote:
>
> Derek,
>
> Please use user@geronimo.apache.org for questions like this. We just
> had a similar question on the users mailing list.
>
> Anyway, look for "Configuring EJB JAX-WS Web Service: " log message in the
> var/log/geronimo.log file. That log message contains the uri
> address at which the service is published at (the address specified in
> the wsdl is ignored).
>
> Jarek
>
> On Jan 8, 2008 10:38 AM, Derek Tam <cw...@gmail.com> wrote:
>>
>> Trying to call the web services from a client but geronimo reports WSDL
>> fileNotFoundException. Any ideas what may caused it.
>>
>> Web services client:
>> ...
>> int v1 = Integer.parseInt(value1);
>> int v2 = Integer.parseInt(value2);
>> URL url = new
>> URL("http://localhost:8080/Calculator/calculator?wsdl");
>> QName qname = new
>> QName("http://jws.samples.geronimo.apache.org",
>> "Calculator");
>> Service service = Service.create(url, qname);
>>
>> CalculatorService calc =
>> (CalculatorService)service.getPort(CalculatorService.class);
>> int sum = calc.add(v1, v2);
>> ...
>>
>> WSDL:
>>
>> <wsdl:definitions name="Calculator"
>> xmlns="http://schemas.xmlsoap.org/wsdl/"
>> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>> targetNamespace="http://jws.samples.geronimo.apache.org"
>> xmlns:tns="http://jws.samples.geronimo.apache.org">
>>
>> <wsdl:types>
>> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>> xmlns="http://jws.samples.geronimo.apache.org"
>>
>> targetNamespace="http://jws.samples.geronimo.apache.org"
>> attributeFormDefault="unqualified"
>> elementFormDefault="qualified">
>>
>> <xsd:element name="add">
>> <xsd:complexType>
>> <xsd:sequence>
>> <xsd:element name="value1" type="xsd:int"/>
>> <xsd:element name="value2" type="xsd:int"/>
>> </xsd:sequence>
>> </xsd:complexType>
>> </xsd:element>
>>
>> <xsd:element name="addResponse">
>> <xsd:complexType>
>> <xsd:sequence>
>> <xsd:element name="return" type="xsd:int"/>
>> </xsd:sequence>
>> </xsd:complexType>
>> </xsd:element>
>> </xsd:schema>
>> </wsdl:types>
>>
>> <wsdl:message name="add">
>> <wsdl:part name="add" element="tns:add"/>
>> </wsdl:message>
>>
>> <wsdl:message name="addResponse">
>> <wsdl:part name="addResponse" element="tns:addResponse"/>
>> </wsdl:message>
>>
>> <wsdl:portType name="CalculatorPortType">
>> <wsdl:operation name="add">
>> <wsdl:input name="add" message="tns:add"/>
>> <wsdl:output name="addResponse" message="tns:addResponse"/>
>> </wsdl:operation>
>> </wsdl:portType>
>>
>> <wsdl:binding name="CalculatorSoapBinding"
>> type="tns:CalculatorPortType">
>> <soap:binding style="document"
>> transport="http://schemas.xmlsoap.org/soap/http"/>
>>
>> <wsdl:operation name="add">
>> <soap:operation soapAction="add" style="document"/>
>> <wsdl:input name="add">
>> <soap:body use="literal"/>
>> </wsdl:input>
>> <wsdl:output name="addResponse">
>> <soap:body use="literal"/>
>> </wsdl:output>
>> </wsdl:operation>
>>
>> </wsdl:binding>
>>
>> <wsdl:service name="Calculator">
>> <wsdl:port name="CalculatorPort"
>> binding="tns:CalculatorSoapBinding">
>> <soap:address
>> location="http://localhost:8080/Calculator/calculator"/>
>> </wsdl:port>
>> </wsdl:service>
>>
>>
>> </wsdl:definitions>
>>
>> geronimo.log:
>>
>> javax.xml.ws.WebServiceException: The following WSDL exception occurred:
>> WSDLException: faultCode=WS
>> DL4JWrapper : : WSDLException: faultCode=WSDL4JWrapper : :
>> java.io.FileNotFoundException: http://loc
>> alhost:8080/Calculator/calculator?wsdl
>> at
>> org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:1
>> 72)
>> at
>> org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:69)
>>
>> at
>> org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.setupWsdlDefinition(Servic
>> eDescriptionImpl.java:551)
>> at
>> org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.<init>(ServiceDescriptionI
>> mpl.java:143)
>> at
>> org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.createServiceDescription(D
>> escriptionFactoryImpl.java:101)
>> at
>> org.apache.axis2.jaxws.description.DescriptionFactory.createServiceDescription(Descriptio
>> nFactory.java:69)
>> at
>> org.apache.axis2.jaxws.spi.ServiceDelegate.<init>(ServiceDelegate.java:87)
>> at
>> org.apache.axis2.jaxws.spi.Provider.createServiceDelegate(Provider.java:45)
>> at javax.xml.ws.Service.<init>(Unknown Source)
>> at javax.xml.ws.Service.create(Unknown Source)
>> at org.apache.jsp.add_jsp._jspService(add_jsp.java:107)
>> at
>> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
>> at
>> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
>> at
>> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
>> at
>> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
>> --
>> View this message in context:
>> http://www.nabble.com/EJB-based-web-services-cannot-find-WSDL-tp14692118s134p14692118.html
>> Sent from the Apache Geronimo - Dev mailing list archive at Nabble.com.
>>
>>
>
>
--
View this message in context: http://www.nabble.com/EJB-based-web-services-cannot-find-WSDL-tp14692118s134p14695420.html
Sent from the Apache Geronimo - Dev mailing list archive at Nabble.com.
Re: EJB-based web services cannot find WSDL
Posted by Jarek Gawor <jg...@gmail.com>.
Derek,
Please use user@geronimo.apache.org for questions like this. We just
had a similar question on the users mailing list.
Anyway, look for "Configuring EJB JAX-WS Web Service: " log message in the
var/log/geronimo.log file. That log message contains the uri
address at which the service is published at (the address specified in
the wsdl is ignored).
Jarek
On Jan 8, 2008 10:38 AM, Derek Tam <cw...@gmail.com> wrote:
>
> Trying to call the web services from a client but geronimo reports WSDL
> fileNotFoundException. Any ideas what may caused it.
>
> Web services client:
> ...
> int v1 = Integer.parseInt(value1);
> int v2 = Integer.parseInt(value2);
> URL url = new URL("http://localhost:8080/Calculator/calculator?wsdl");
> QName qname = new QName("http://jws.samples.geronimo.apache.org",
> "Calculator");
> Service service = Service.create(url, qname);
>
> CalculatorService calc =
> (CalculatorService)service.getPort(CalculatorService.class);
> int sum = calc.add(v1, v2);
> ...
>
> WSDL:
>
> <wsdl:definitions name="Calculator"
> xmlns="http://schemas.xmlsoap.org/wsdl/"
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> targetNamespace="http://jws.samples.geronimo.apache.org"
> xmlns:tns="http://jws.samples.geronimo.apache.org">
>
> <wsdl:types>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns="http://jws.samples.geronimo.apache.org"
> targetNamespace="http://jws.samples.geronimo.apache.org"
> attributeFormDefault="unqualified"
> elementFormDefault="qualified">
>
> <xsd:element name="add">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="value1" type="xsd:int"/>
> <xsd:element name="value2" type="xsd:int"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
>
> <xsd:element name="addResponse">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="return" type="xsd:int"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> </xsd:schema>
> </wsdl:types>
>
> <wsdl:message name="add">
> <wsdl:part name="add" element="tns:add"/>
> </wsdl:message>
>
> <wsdl:message name="addResponse">
> <wsdl:part name="addResponse" element="tns:addResponse"/>
> </wsdl:message>
>
> <wsdl:portType name="CalculatorPortType">
> <wsdl:operation name="add">
> <wsdl:input name="add" message="tns:add"/>
> <wsdl:output name="addResponse" message="tns:addResponse"/>
> </wsdl:operation>
> </wsdl:portType>
>
> <wsdl:binding name="CalculatorSoapBinding"
> type="tns:CalculatorPortType">
> <soap:binding style="document"
> transport="http://schemas.xmlsoap.org/soap/http"/>
>
> <wsdl:operation name="add">
> <soap:operation soapAction="add" style="document"/>
> <wsdl:input name="add">
> <soap:body use="literal"/>
> </wsdl:input>
> <wsdl:output name="addResponse">
> <soap:body use="literal"/>
> </wsdl:output>
> </wsdl:operation>
>
> </wsdl:binding>
>
> <wsdl:service name="Calculator">
> <wsdl:port name="CalculatorPort"
> binding="tns:CalculatorSoapBinding">
> <soap:address
> location="http://localhost:8080/Calculator/calculator"/>
> </wsdl:port>
> </wsdl:service>
>
>
> </wsdl:definitions>
>
> geronimo.log:
>
> javax.xml.ws.WebServiceException: The following WSDL exception occurred:
> WSDLException: faultCode=WS
> DL4JWrapper : : WSDLException: faultCode=WSDL4JWrapper : :
> java.io.FileNotFoundException: http://loc
> alhost:8080/Calculator/calculator?wsdl
> at
> org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:1
> 72)
> at
> org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:69)
>
> at
> org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.setupWsdlDefinition(Servic
> eDescriptionImpl.java:551)
> at
> org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.<init>(ServiceDescriptionI
> mpl.java:143)
> at
> org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.createServiceDescription(D
> escriptionFactoryImpl.java:101)
> at
> org.apache.axis2.jaxws.description.DescriptionFactory.createServiceDescription(Descriptio
> nFactory.java:69)
> at
> org.apache.axis2.jaxws.spi.ServiceDelegate.<init>(ServiceDelegate.java:87)
> at
> org.apache.axis2.jaxws.spi.Provider.createServiceDelegate(Provider.java:45)
> at javax.xml.ws.Service.<init>(Unknown Source)
> at javax.xml.ws.Service.create(Unknown Source)
> at org.apache.jsp.add_jsp._jspService(add_jsp.java:107)
> at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
> at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
> at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
> at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
> --
> View this message in context: http://www.nabble.com/EJB-based-web-services-cannot-find-WSDL-tp14692118s134p14692118.html
> Sent from the Apache Geronimo - Dev mailing list archive at Nabble.com.
>
>