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 Stadelmann Josef <jo...@axa-winterthur.ch> on 2012/04/16 14:26:24 UTC

[axis2-1.6.1] samples - JAX-WS Calculator

My environment: PC with Vista, Axis2-1.6.1, Apache Tomcat 6.0.26, JDK
1.7.0_03 installed, used from NetBeans 7.1.1 running on JDK 1.7.0_03
I have built the
E:\Users\C770817\SW-UMGEBUNG\axis2-1.6.1\samples\jaxws-calculator
sample.
The results in target are two jars, classes/, maven-archiver/, and
surefire/ 
The two jars are: jaxws-calculator-1.6.1.jar and
jaxws-calculator-1.6.1-client.jar

When I debugg the CalculatorService Client I encounter 2 errors
1.	the url used to define the wsdl location is wrong -
CALCULATORSERVICE_WSDL_LOCATION
the url is given as 
url = new
URL("http://localhost:8080/axis2/services/CalculatorService.CalculatorSe
rvicePort?wsdl");
when you try to get a wsdl definition from the running server using this
url from by a browser an error is triggered to the browser!
also an exception is raised by the CalculatorService Client.
when you change the url to
url = new
URL("http://localhost:8080/axis2/services/CalculatorService?wsdl");
the server returns a correct wsdl definition AND no exception is raised
in code by the ServiceCalculator Client

My question is: which of the two is correct?

So I corrected the url = new
URL("http://localhost:8080/axis2/services/CalculatorService?wsdl");


BUT now the client runs a bit further but fails at a different place
described by 2. below


2.	the EndpointDescriptionImpl.java gets an error
"java.lang.RuntimeException:
org.apache.ws.commons.schema.XmlSchemaException:
E:\Users\C770817\SW-UMGEBUNG\axis2-1.6.1\samples\jaxws-calculator\Calcul
atorService?xsd=http:\www.w3.org\2006\03\addressing\ws-addr.xsd (The
filename, directory name, or volume label syntax is incorrect)"

Is it the intention to demonstrate that the client gets the wsdl
definition (?wsdl) 
and the schema (?xsd) definition from some client side files or by using
a url to the remote server location?

The XmlSchemaException indicates somehow this, but as such is not
usebale !!!
do we refere to a file or doe we refere to a resource indicated by an
url?
What is correct here?

	
3.	Regarding the service, I have checked that
jaxws-calculator-1.6.1.jar has in META-INF/CalculatorService.wsdl and
CalculatorService_schema1.xsd, In other words the files are provided,
the question is how does or shall the JAXWSDeployer or any other part of
axis engaged thereafter make use of it? Given the case that the client
uses a url as wsdl location not a file reference, I would assume that in
this case the schema is retzreived the same way; but looking at the
XmlSchemaException, I getthe impression that at some point in code the
descision is made to use a file reference but at a different point in
code during client startup, the descisionj is made to get the schema
from a remote location via an url. In any case the reference to the
schema is wrong!!!
          
Josef

Exception with (1 above)
[exec:exec]
Apr 16, 2012 2:22:02 PM org.apache.axis2.deployment.ClusterBuilder
buildCluster
INFO: Clustering has been disabled
Apr 16, 2012 2:22:02 PM org.apache.axis2.deployment.ModuleDeployer
deploy
INFO: Deploying module: addressing-1.6.1 -
file:/E:/Users/C770817/SW-UMGEBUNG/axis2-1.6.1/repository-client/modules
/addressing-1.6.1.mar
javax.xml.ws.WebServiceException: The following WSDL exception occurred:
WSDLException: faultCode=WSDL4JWrapper : : javax.wsdl.WSDLException:
WSDLException: faultCode=WSDL4JWrapper : :
java.io.FileNotFoundException:
http://localhost:8080/axis2/services/CalculatorService.CalculatorService
Port?wsdl
	at
org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(Except
ionFactory.java:173)
	at
org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(Exceptio
nFactory.java:70)
	at
org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.setupWsdl
Definition(ServiceDescriptionImpl.java:1202)
	at
org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.<init>(Se
rviceDescriptionImpl.java:249)
	at
org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.<init>(Se
rviceDescriptionImpl.java:172)
	at
org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.createSer
viceDescription(DescriptionFactoryImpl.java:134)
	at
org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.createSer
viceDescription(DescriptionFactoryImpl.java:79)
	at
org.apache.axis2.jaxws.description.DescriptionFactory.createServiceDescr
iption(DescriptionFactory.java:78)
	at
org.apache.axis2.jaxws.spi.ServiceDelegate.<init>(ServiceDelegate.java:2
18)
	at
org.apache.axis2.jaxws.spi.Provider.createServiceDelegate(Provider.java:
83)
	at
org.apache.axis2.jaxws.spi.Provider.createServiceDelegate(Provider.java:
79)
	at javax.xml.ws.Service.<init>(Service.java:77)
	at
org.apache.axis2.jaxws.calculator.client.CalculatorService.<init>(Calcul
atorService.java:53)
	at
org.apache.axis2.jaxws.calculator.client.AddSEIClient.main(AddSEIClient.
java:54)
Caused by: javax.wsdl.WSDLException: WSDLException:
faultCode=WSDL4JWrapper : : javax.wsdl.WSDLException: WSDLException:
faultCode=WSDL4JWrapper : : java.io.FileNotFoundException:
http://localhost:8080/axis2/services/CalculatorService.CalculatorService
Port?wsdl
	at
org.apache.axis2.jaxws.util.WSDL4JWrapper.commonPartsURLConstructor(WSDL
4JWrapper.java:234)
	at
org.apache.axis2.jaxws.util.WSDL4JWrapper.<init>(WSDL4JWrapper.java:156)
	at
org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.setupWsdl
Definition(ServiceDescriptionImpl.java:1182)
	... 11 more
Caused by: javax.wsdl.WSDLException: WSDLException:
faultCode=WSDL4JWrapper : : java.io.FileNotFoundException:
http://localhost:8080/axis2/services/CalculatorService.CalculatorService
Port?wsdl
	at
org.apache.axis2.jaxws.util.WSDL4JWrapper.commonPartsURLConstructor(WSDL
4JWrapper.java:203)
	... 13 more
Caused by: java.io.FileNotFoundException:
http://localhost:8080/axis2/services/CalculatorService.CalculatorService
Port?wsdl
	at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnec
tion.java:1610)
	at
org.apache.axis2.jaxws.util.WSDL4JWrapper$14.run(WSDL4JWrapper.java:974)
	at
org.apache.axis2.java.security.AccessController.doPrivileged(AccessContr
oller.java:132)
	at
org.apache.axis2.jaxws.util.WSDL4JWrapper.getInputStream(WSDL4JWrapper.j
ava:971)
	at
org.apache.axis2.jaxws.util.WSDL4JWrapper.commonPartsURLConstructor(WSDL
4JWrapper.java:189)
	... 13 more
Time: 764 ms.
------------------------------------------------------------------------
BUILD SUCCESS
------------------------------------------------------------------------

Exception with (2 above)
[exec:exec]
Apr 16, 2012 2:23:21 PM org.apache.axis2.deployment.ClusterBuilder
buildCluster
INFO: Clustering has been disabled
Apr 16, 2012 2:23:21 PM org.apache.axis2.deployment.ModuleDeployer
deploy
INFO: Deploying module: addressing-1.6.1 -
file:/E:/Users/C770817/SW-UMGEBUNG/axis2-1.6.1/repository-client/modules
/addressing-1.6.1.mar
Apr 16, 2012 2:23:22 PM
org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl
buildAxisServiceFromWSDL
WARNING: The WSDL file could not be used due to an exception.  The WSDL
will be ignored and annotations will be used.  Implementation class:
org.apache.axis2.jaxws.calculator.client.Calculator; WSDL Location:
http://localhost:8080/axis2/services/CalculatorService?wsdl; Exception
Message: java.lang.RuntimeException:
org.apache.ws.commons.schema.XmlSchemaException:
E:\Users\C770817\SW-UMGEBUNG\axis2-1.6.1\samples\jaxws-calculator\Calcul
atorService?xsd=http:\www.w3.org\2006\03\addressing\ws-addr.xsd (The
filename, directory name, or volume label syntax is incorrect)
javax.xml.ws.WebServiceException: Unable to create AxisService for
CalculatorService
	at
org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(Except
ionFactory.java:173)
	at
org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(Exceptio
nFactory.java:70)
	at
org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(Exceptio
nFactory.java:118)
	at
org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.setupAxi
sService(EndpointDescriptionImpl.java:786)
	at
org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.<init>(E
ndpointDescriptionImpl.java:276)
	at
org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.<init>(E
ndpointDescriptionImpl.java:224)
	at
org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.updateEnd
pointDescription(ServiceDescriptionImpl.java:534)
	at
org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.updateEnd
point(DescriptionFactoryImpl.java:364)
	at
org.apache.axis2.jaxws.description.DescriptionFactory.updateEndpoint(Des
criptionFactory.java:180)
	at
org.apache.axis2.jaxws.spi.ServiceDelegate.getPort(ServiceDelegate.java:
597)
	at
org.apache.axis2.jaxws.spi.ServiceDelegate.getPort(ServiceDelegate.java:
513)
	at javax.xml.ws.Service.getPort(Service.java:119)
	at
org.apache.axis2.jaxws.calculator.client.CalculatorService.getCalculator
ServicePort(CalculatorService.java:61)
	at
org.apache.axis2.jaxws.calculator.client.AddSEIClient.main(AddSEIClient.
java:55)
Time: 1061 ms.
------------------------------------------------------------------------
BUILD SUCCESS
------------------------------------------------------------------------