Skip to main content

WSDLParser parse Exception

2 replies [Last post]
k_lite
Offline
Joined: 2005-08-17

i'm using the JAXWS2.0 EA2 to work on web services. successfully deploy and generate the client code, but when i tried to run, get the following error:

run:
[java] java.lang.Exception: wsdl.xmlReader
[java] at com.sun.xml.ws.wsdl.parser.WSDLParser.parse(WSDLParser.java:7
8)
[java] at com.sun.xml.ws.client.ServiceContextBuilder.parseWSDL(Service
ContextBuilder.java:97)
[java] at com.sun.xml.ws.client.ServiceContextBuilder.buildServiceConte
xt(ServiceContextBuilder.java:54)
[java] at com.sun.xml.ws.client.ServiceFactoryImpl.createService(Servic
eFactoryImpl.java:36)
[java] at hello.client.SayHelloClient.main(Unknown Source)
[java] Caused by: XML stream reader exception: javax.xml.stream.XMLStreamEx
ception: ParseError at [row,col]:[25,15]
[java] Message: Open quote is expected for attribute "border".
[java] at com.sun.xml.ws.streaming.StAXReader.next(StAXReader.java:202)

[java] at com.sun.xml.ws.streaming.StAXReader.skipElement(StAXReader.ja
va:297)
[java] at com.sun.xml.ws.streaming.XMLReaderBase.skipElement(XMLReaderB
ase.java:51)
[java] at com.sun.xml.ws.wsdl.parser.WSDLParser.parseWSDL(WSDLParser.ja
va:106)
[java] at com.sun.xml.ws.wsdl.parser.WSDLParser.parse(WSDLParser.java:7
6)
[java] ... 4 more
[java] java.lang.ClassCastException: com.sun.xml.ws.client.WebService
[java] at hello.client.SayHelloClient.main(Unknown Source)

here is the code that i used to run the app:

private static String endpoint = "http://localhost:8080/jaxws-hello/hello";
URL url = new URL(endpoint);
ServiceFactory serviceFactory = ServiceFactory.newInstance();
HelloImplService service = (HelloImplService)serviceFactory.createService(url, HelloImplService.class);
HelloImpl port = service.getHelloImpl();
String result = port.sayHello("testing web service");
System.out.println("The result is" + result);

my wsdl file looks like this, and it's located at /WEB-INF/HelloImplService.wsdl:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

anyone had any idea. help is much needed.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jitu
Offline
Joined: 2003-06-14

(HelloImplService)serviceFactory.createService(url, HelloImplService.class);

Here the URL is WSDL url, not endpoint. WSDL url for your case would be at

"http://localhost:8080/jaxws-hello/hello?wsdl"

Also, try this link from the browser.

Your wsdl doc is here:
/WEB-INF/HelloImplService.wsdl. This is incorrect. It should be packaged under /WEB-INF/wsdl dir. You need to make a corresponding change in sun-jaxws.xml Check any sample.

k_lite
Offline
Joined: 2005-08-17

thanks for your prompt reply. i tried as suggested and the application seems to picking up the wsdl file. but then there was another error:

run:
[java] Invoking sayHello
[java] Aug 19, 2005 6:35:25 PM com.sun.xml.messaging.saaj.soap.MessageImpl
identifyContentType
[java] SEVERE: SAAJ0537: Invalid Content-Type. Could be an error message in
stead of a SOAP message
[java] Aug 19, 2005 6:35:25 PM com.sun.xml.messaging.saaj.soap.MessageImpl

[java] SEVERE: SAAJ0535: Unable to internalize message
[java] Couldn't create SOAP message due to exception: com.sun.xml.messaging
.saaj.SOAPExceptionImpl: Unable to internalize message
[java] at com.sun.xml.ws.util.SOAPUtil.createMessage(SOAPUtil.java:141)

[java] at com.sun.xml.ws.util.SOAPConnectionUtil.getSOAPMessage(SOAPCon
nectionUtil.java:54)
[java] at com.sun.xml.ws.encoding.soap.client.SOAPXMLDecoder.toSOAPMess
age(SOAPXMLDecoder.java:92)
[java] at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.rec
eive(SOAPMessageDispatcher.java:326)
[java] at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.doS
end(SOAPMessageDispatcher.java:186)
[java] at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.sen
d(SOAPMessageDispatcher.java:107)
[java] at com.sun.xml.ws.encoding.soap.internal.DelegateBase.send(Deleg
ateBase.java:65)
[java] at com.sun.xml.ws.client.EndpointIFInvocationHandler.implementSE
IMethod(EndpointIFInvocationHandler.java:147)
[java] at com.sun.xml.ws.client.EndpointIFInvocationHandler.invoke(Endp
ointIFInvocationHandler.java:82)
[java] at $Proxy15.sayHello(Unknown Source)
[java] at hello.client.SayHelloClient.main(Unknown Source)

[java] CAUSE:

[java] com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to internalize
message
[java] at com.sun.xml.messaging.saaj.soap.MessageImpl.(MessageImp
l.java:334)
[java] at com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl.(
Message1_1Impl.java:47)
[java] at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1I
mpl.createMessage(SOAPMessageFactory1_1Impl.java:42)
[java] at com.sun.xml.ws.util.SOAPUtil.createMessage(SOAPUtil.java:139)

[java] at com.sun.xml.ws.util.SOAPConnectionUtil.getSOAPMessage(SOAPCon
nectionUtil.java:54)
[java] at com.sun.xml.ws.encoding.soap.client.SOAPXMLDecoder.toSOAPMess
age(SOAPXMLDecoder.java:92)
[java] at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.rec
eive(SOAPMessageDispatcher.java:326)
[java] at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.doS
end(SOAPMessageDispatcher.java:186)
[java] at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.sen
d(SOAPMessageDispatcher.java:107)
[java] at com.sun.xml.ws.encoding.soap.internal.DelegateBase.send(Deleg
ateBase.java:65)
[java] at com.sun.xml.ws.client.EndpointIFInvocationHandler.implementSE
IMethod(EndpointIFInvocationHandler.java:147)
[java] at com.sun.xml.ws.client.EndpointIFInvocationHandler.invoke(Endp
ointIFInvocationHandler.java:82)
[java] at $Proxy15.sayHello(Unknown Source)
[java] at hello.client.SayHelloClient.main(Unknown Source)
[java] Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Invalid Con
tent-Type:text/html. Is this an error message instead of a SOAP response?
[java] at com.sun.xml.messaging.saaj.soap.MessageImpl.identifyContentTy
pe(MessageImpl.java:451)
[java] at com.sun.xml.messaging.saaj.soap.MessageImpl.(MessageImp
l.java:218)
[java] ... 13 more

[java] CAUSE:

[java] com.sun.xml.messaging.saaj.SOAPExceptionImpl: Invalid Content-Type:t
ext/html. Is this an error message instead of a SOAP response?
[java] at com.sun.xml.messaging.saaj.soap.MessageImpl.identifyContentTy
pe(MessageImpl.java:451)
[java] at com.sun.xml.messaging.saaj.soap.MessageImpl.(MessageImp
l.java:218)
[java] at com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl.(
Message1_1Impl.java:47)
[java] at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1I
mpl.createMessage(SOAPMessageFactory1_1Impl.java:42)
[java] at com.sun.xml.ws.util.SOAPUtil.createMessage(SOAPUtil.java:139)

[java] at com.sun.xml.ws.util.SOAPConnectionUtil.getSOAPMessage(SOAPCon
nectionUtil.java:54)
[java] at com.sun.xml.ws.encoding.soap.client.SOAPXMLDecoder.toSOAPMess
age(SOAPXMLDecoder.java:92)
[java] at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.rec
eive(SOAPMessageDispatcher.java:326)
[java] at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.doS
end(SOAPMessageDispatcher.java:186)
[java] at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.sen
d(SOAPMessageDispatcher.java:107)
[java] at com.sun.xml.ws.encoding.soap.internal.DelegateBase.send(Deleg
ateBase.java:65)
[java] at com.sun.xml.ws.client.EndpointIFInvocationHandler.implementSE
IMethod(EndpointIFInvocationHandler.java:147)
[java] at com.sun.xml.ws.client.EndpointIFInvocationHandler.invoke(Endp
ointIFInvocationHandler.java:82)
[java] at $Proxy15.sayHello(Unknown Source)
[java] at hello.client.SayHelloClient.main(Unknown Source)

[java] CAUSE:

[java] com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to internalize
message
[java] at com.sun.xml.messaging.saaj.soap.MessageImpl.(MessageImp
l.java:334)
[java] at com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl.(
Message1_1Impl.java:47)
[java] at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1I
mpl.createMessage(SOAPMessageFactory1_1Impl.java:42)
[java] at com.sun.xml.ws.util.SOAPUtil.createMessage(SOAPUtil.java:139)

[java] at com.sun.xml.ws.util.SOAPConnectionUtil.getSOAPMessage(SOAPCon
nectionUtil.java:54)
[java] at com.sun.xml.ws.encoding.soap.client.SOAPXMLDecoder.toSOAPMess
age(SOAPXMLDecoder.java:92)
[java] at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.rec
eive(SOAPMessageDispatcher.java:326)
[java] at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.doS
end(SOAPMessageDispatcher.java:186)
[java] at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.sen
d(SOAPMessageDispatcher.java:107)
[java] at com.sun.xml.ws.encoding.soap.internal.DelegateBase.send(Deleg
ateBase.java:65)
[java] at com.sun.xml.ws.client.EndpointIFInvocationHandler.implementSE
IMethod(EndpointIFInvocationHandler.java:147)
[java] at com.sun.xml.ws.client.EndpointIFInvocationHandler.invoke(Endp
ointIFInvocationHandler.java:82)
[java] at $Proxy15.sayHello(Unknown Source)
[java] at hello.client.SayHelloClient.main(Unknown Source)
[java] Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Invalid Con
tent-Type:text/html. Is this an error message instead of a SOAP response?
[java] at com.sun.xml.messaging.saaj.soap.MessageImpl.identifyContentTy
pe(MessageImpl.java:451)
[java] at com.sun.xml.messaging.saaj.soap.MessageImpl.(MessageImp
l.java:218)
[java] ... 13 more

[java] CAUSE:

[java] com.sun.xml.messaging.saaj.SOAPExceptionImpl: Invalid Content-Type:t
ext/html. Is this an error message instead of a SOAP response?
[java] at com.sun.xml.messaging.saaj.soap.MessageImpl.identifyContentTy
pe(MessageImpl.java:451)
[java] at com.sun.xml.messaging.saaj.soap.MessageImpl.(MessageImp
l.java:218)
[java] at com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl.(
Message1_1Impl.java:47)
[java] at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1I
mpl.createMessage(SOAPMessageFactory1_1Impl.java:42)
[java] at com.sun.xml.ws.util.SOAPUtil.createMessage(SOAPUtil.java:139)

[java] at com.sun.xml.ws.util.SOAPConnectionUtil.getSOAPMessage(SOAPCon
nectionUtil.java:54)
[java] at com.sun.xml.ws.encoding.soap.client.SOAPXMLDecoder.toSOAPMess
age(SOAPXMLDecoder.java:92)
[java] at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.rec
eive(SOAPMessageDispatcher.java:326)
[java] at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.doS
end(SOAPMessageDispatcher.java:186)
[java] at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.sen
d(SOAPMessageDispatcher.java:107)
[java] at com.sun.xml.ws.encoding.soap.internal.DelegateBase.send(Deleg
ateBase.java:65)
[java] at com.sun.xml.ws.client.EndpointIFInvocationHandler.implementSE
IMethod(EndpointIFInvocationHandler.java:147)
[java] at com.sun.xml.ws.client.EndpointIFInvocationHandler.invoke(Endp
ointIFInvocationHandler.java:82)
[java] at $Proxy15.sayHello(Unknown Source)
[java] at hello.client.SayHelloClient.main(Unknown Source)

[java] CAUSE:

[java] com.sun.xml.messaging.saaj.SOAPExceptionImpl: Invalid Content-Type:t
ext/html. Is this an error message instead of a SOAP response?
[java] at com.sun.xml.messaging.saaj.soap.MessageImpl.identifyContentTy
pe(MessageImpl.java:451)
[java] at com.sun.xml.messaging.saaj.soap.MessageImpl.(MessageImp
l.java:218)
[java] at com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl.(
Message1_1Impl.java:47)
[java] at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1I
mpl.createMessage(SOAPMessageFactory1_1Impl.java:42)
[java] at com.sun.xml.ws.util.SOAPUtil.createMessage(SOAPUtil.java:139)

[java] at com.sun.xml.ws.util.SOAPConnectionUtil.getSOAPMessage(SOAPCon
nectionUtil.java:54)
[java] at com.sun.xml.ws.encoding.soap.client.SOAPXMLDecoder.toSOAPMess
age(SOAPXMLDecoder.java:92)
[java] at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.rec
eive(SOAPMessageDispatcher.java:326)
[java] at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.doS
end(SOAPMessageDispatcher.java:186)
[java] at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.sen
d(SOAPMessageDispatcher.java:107)
[java] at com.sun.xml.ws.encoding.soap.internal.DelegateBase.send(Deleg
ateBase.java:65)
[java] at com.sun.xml.ws.client.EndpointIFInvocationHandler.implementSE
IMethod(EndpointIFInvocationHandler.java:147)
[java] at com.sun.xml.ws.client.EndpointIFInvocationHandler.invoke(Endp
ointIFInvocationHandler.java:82)
[java] at $Proxy15.sayHello(Unknown Source)
[java] at hello.client.SayHelloClient.main(Unknown Source)
[java] javax.xml.ws.WebServiceException: Couldn't create SOAP message due t
o exception: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to internalize
message
[java] at com.sun.xml.ws.util.SOAPConnectionUtil.getSOAPMessage(SOAPCon
nectionUtil.java:59)
[java] at com.sun.xml.ws.encoding.soap.client.SOAPXMLDecoder.toSOAPMess
age(SOAPXMLDecoder.java:92)
[java] at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.rec
eive(SOAPMessageDispatcher.java:326)
[java] at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.doS
end(SOAPMessageDispatcher.java:186)
[java] at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.sen
d(SOAPMessageDispatcher.java:107)
[java] at com.sun.xml.ws.encoding.soap.internal.DelegateBase.send(Deleg
ateBase.java:65)
[java] at com.sun.xml.ws.client.EndpointIFInvocationHandler.implementSE
IMethod(EndpointIFInvocationHandler.java:147)
[java] at com.sun.xml.ws.client.EndpointIFInvocationHandler.invoke(Endp
ointIFInvocationHandler.java:82)
[java] at $Proxy15.sayHello(Unknown Source)
[java] at hello.client.SayHelloClient.main(Unknown Source)
[java] Caused by: Couldn't create SOAP message due to exception: com.sun.xm
l.messaging.saaj.SOAPExceptionImpl: Unable to internalize message
[java] at com.sun.xml.ws.util.SOAPUtil.createMessage(SOAPUtil.java:141)

[java] at com.sun.xml.ws.util.SOAPConnectionUtil.getSOAPMessage(SOAPCon
nectionUtil.java:54)
[java] ... 9 more

looking through the forum, i did as suggested by including the mail.jar & xercesImpl.jar in classpath, but the problem still remains.

here is the schema1.xsd file and it's located with the wsdl file in /WEB-INF/wsdl dir.











here is the sun-jaxws.xml file:


name="hello"
interface="hello.server.HelloImpl"
implementation="hello.server.HelloImpl"
wsdl="/WEB-INF/wsdl/HelloImplService.wsdl"
service="{http://server.hello/jaxws}HelloImplService"
port="{http://server.hello/jaxws}HelloImpl"
url-pattern="/hello" />

am i missing something? please advise.