File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes XML-Based, Document Style JAX-WS Web Service  Example giving error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "XML-Based, Document Style JAX-WS Web Service  Example giving error" Watch "XML-Based, Document Style JAX-WS Web Service  Example giving error" New topic
Author

XML-Based, Document Style JAX-WS Web Service Example giving error

vasu mannem
Ranch Hand

Joined: Dec 11, 2003
Posts: 38
Hi

I am trying the example ( XML-Based, Document Style JAX-WS Webservice Calculator ) from Ivan A Krizsan study notes on RAD 7.5

getting the following error while running the client...

What operation do you want to perform (Addition = add, Subtraction = sub, Division = div, Multiplication = mult)?
add
Give the first integer number:
56
Give the second integer number:
65
javax.xml.ws.WebServiceException: An attempt was made to construct the ServiceDelegate object with an service name that is not valid: . at org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:173)
at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:70)
at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:118)
at org.apache.axis2.jaxws.spi.ServiceDelegate.<init>(ServiceDelegate.java:201)
at org.apache.axis2.jaxws.spi.Provider.createServiceDelegate(Provider.java:59)
at javax.xml.ws.Service.<init>(Service.java:67)
at javax.xml.ws.Service.create(Service.java:702)
at com.vasu.client.XMLCalculatorClient.createServiceDispatcher(XMLCalculatorClient.java:120)
at com.vasu.client.XMLCalculatorClient.<init>(XMLCalculatorClient.java:77)
at com.vasu.client.XMLCalculatorClient.main(XMLCalculatorClient.java:53)





looks like it if faling at the below line


QName theDummyQName = new QName("", "");
Service theXmlCalcService = Service.create(theDummyQName);


Qname should require the proper namespaceURI , localname



I think i missed the endpoint declaration in deployment descriptor and not sure in which file it should define.. like galssfish defined it in sun-jaxws.xml


VasuM.
SCJP, SCBCD,ITIL
vasu mannem
Ranch Hand

Joined: Dec 11, 2003
Posts: 38
looks like it if faling at the below line


QName theDummyQName = new QName("", "");
Service theXmlCalcService = Service.create(theDummyQName);


Qname should require the proper namespaceURI , localname
vasu mannem
Ranch Hand

Joined: Dec 11, 2003
Posts: 38
not sure where to define end point in rad7.5 like in sun-jaxws.xml in glasfish IDE
Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 530
    
    2

vasu mannem wrote:looks like it if faling at the below line


QName theDummyQName = new QName("", "");
Service theXmlCalcService = Service.create(theDummyQName);


Qname should require the proper namespaceURI , localname


Vasu, since you posted this question in SCDJWS forum, I assume that you are preparing for the certification. If yes, usage of axis is not recommended (not because it is bad, but just not recommended). Please use Metro stack from sun.

Secondly, what is your exact code of defining the service QName. Did you use "" for localname and namespace. Have you tried using the actual namespace and local name for it?


Regards
KumarRaja

vasu mannem
Ranch Hand

Joined: Dec 11, 2003
Posts: 38
Thanks Kumar Raja and you are right that I am preparing for the certification

I am using RAD7.5 because not have permissionsto install GlassFish in my office system.




I have tried using the qname as..

QName theDummyQName = new QName(XML_SCHEMA_NAMESPACE, "dummy");

XML_SCHEMA_NAMESPACE = http://www.example.com/xmlcalculator

this time it is giving the error...

What operation do you want to perform (Addition = add, Subtraction = sub, Division = div, Multiplication = mult)?
add
Give the first integer number:
100
Give the second integer number:
200
Jan 26, 2011 3:26:15 PM null null
INFO: ssl.disable.url.hostname.verification.CWPKI0027I
Jan 26, 2011 3:26:16 PM null null
INFO: Client code attempting to load security configuration
Jan 26, 2011 3:26:16 PM null null
INFO: Client code attempting to load security configuration
Jan 26, 2011 3:26:17 PM null null
AUDIT: chain.started
javax.xml.ws.WebServiceException: java.net.ConnectException: HTTP ( 404 ) Not Found address : http://localhost:9081/JAX-WSXMLCalculator/xmlcalc/
at org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:175)
at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:70)
at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:128)
at org.apache.axis2.jaxws.core.controller.impl.AxisInvocationController.execute(AxisInvocationController.java:572)
at org.apache.axis2.jaxws.core.controller.impl.AxisInvocationController.doInvoke(AxisInvocationController.java:123)
at org.apache.axis2.jaxws.core.controller.impl.InvocationControllerImpl.invoke(InvocationControllerImpl.java:93)
at org.apache.axis2.jaxws.client.dispatch.BaseDispatch.invoke(BaseDispatch.java:192)
at com.vasu.client.XMLCalculatorClient.<init>(XMLCalculatorClient.java:87)
at com.vasu.client.XMLCalculatorClient.main(XMLCalculatorClient.java:51)
Caused by: java.net.ConnectException: HTTP ( 404 ) Not Found address : http://localhost:9081/JAX-WSXMLCalculator/xmlcalc/ at com.ibm.ws.websvcs.transport.http.SOAPOverHTTPSender.processStatusCode(SOAPOverHTTPSender.java:3497)
at com.ibm.ws.websvcs.transport.http.SOAPOverHTTPSender.send(SOAPOverHTTPSender.java:502)
at com.ibm.ws.websvcs.transport.http.HTTPTransportSender.invoke(HTTPTransportSender.java:311)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:452)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:401)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
at org.apache.axis2.jaxws.core.controller.impl.AxisInvocationController.execute(AxisInvocationController.java:567)
... 5 more



I guess.. i have not defined the endpoint and not sure in which dd needs to define..
Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 530
    
    2

Can you post the WSDL here
vasu mannem
Ranch Hand

Joined: Dec 11, 2003
Posts: 38
<?xml version="1.0" encoding="UTF-8"?>
<!--
JSR-109 Specification, section 5.3.2.2:
"A WSDL file is required to be packaged with a Provider implementation."
However, an empty WSDL file like this one is apparently enough.
-->
<wsdl:definitions
targetNamespace="urn:dummy"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:bogus="urn:dummy">
</wsdl:definitions>
 
Consider Paul's rocket mass heater.
 
subject: XML-Based, Document Style JAX-WS Web Service Example giving error