Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
vasu mannem
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
not sure where to define end point in rad7.5 like in sun-jaxws.xml in glasfish IDE
 
Ranch Hand
Posts: 558
2
Hibernate Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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?
 
vasu mannem
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 558
2
Hibernate Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post the WSDL here
 
vasu mannem
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<?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>
 
Arch enemy? I mean, I don't like you, but I don't think you qualify as "arch enemy". Here, try this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic