users@glassfish.java.net

Problem of webservice call and namespace using glassfish V2 M4. Bug of JAXB ?

From: Hess Yvan <Yvan.Hess_at_imtf.ch>
Date: Tue, 28 Aug 2007 15:02:52 +0200

HI,
 
I am using glassfish sever V2 M4 and I have a problem with webservice
call and JAXB. I created a webservice using RPC soap binding (see
webservice definition bellow). When I call the webservice using the
following SOAP request I got an exception
(java.lang.IllegalArgumentException: prefix xsd is not bound to a
namespace) related to JAXB I think. It seems to be linked to the
xsi:type="xsd:string" attribute of the <msg< element. If I replace the
SOAP request element <msg xsi:type="xsd:string">String</msg> BY<msg
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xsi:type="xsd:string">Hello</msg>, it means I am adding the xsd
namespace to the element, it is working fine. I think it is a bug of
JAXB... Please can somebody help me and confirm that it is realy a
problem of JAXB and as glassfish is using it the problem occurs here.
 
Thanks for your help in advance because it is critical...I don't have
the control of the SOAP call because it is generated from an external
system (Oracle BPEL).
 
Regards. Yvan Hess
 
-------------------------------------
SOAP CALL
-------------------------------------
<SOAP-ENV:Envelope
        xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <SOAP-ENV:Body>
      <m:ping xmlns:m="http://www.imtf.com/hypersuite/ulysse">
         <msg xsi:type="xsd:string">String</msg>
      </m:ping>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
 
-------------------------------------
EXCEPTION THROWN
-------------------------------------
[#|2007-08-28T14:50:27.053+0200|WARNING|sun-appserver9.1|javax.enterpris
e.resource.webservices.jaxws.wstx|_ThreadID=14;_ThreadName=httpSSLWorker
Thread-8080-1;_RequestID=f51dcb2a-ff8b-4612-8f30-7401fa5cfff9;|WSTX-SERV
ICE-5015: Handling exception to complete JTA transaction created by
WS-TX service handler
java.lang.IllegalArgumentException: prefix xsd is not bound to a
namespace
 at
com.sun.xml.bind.DatatypeConverterImpl._parseQName(DatatypeConverterImpl
.java:340)
 at
com.sun.xml.bind.v2.runtime.unmarshaller.XsiTypeLoader.parseXsiType(XsiT
ypeLoader.java:89)
 at
com.sun.xml.bind.v2.runtime.unmarshaller.XsiTypeLoader.startElement(XsiT
ypeLoader.java:67)
 at
com.sun.xml.bind.v2.runtime.unmarshaller.ProxyLoader.startElement(ProxyL
oader.java:55)
 at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElem
ent(UnmarshallingContext.java:449)
 at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startEleme
nt(UnmarshallingContext.java:427)
 at
com.sun.xml.bind.v2.runtime.unmarshaller.InterningXmlVisitor.startElemen
t(InterningXmlVisitor.java:71)
 at
com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleStart
Element(StAXStreamConnector.java:275)
 at
com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAX
StreamConnector.java:209)
 at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(Unm
arshallerImpl.java:358)
 at
com.sun.xml.bind.v2.runtime.BridgeImpl.unmarshal(BridgeImpl.java:120)
 at com.sun.xml.bind.api.Bridge.unmarshal(Bridge.java:233)
 at
com.sun.xml.ws.server.sei.EndpointArgumentsBuilder$RpcLit$PartBuilder.re
adRequest(EndpointArgumentsBuilder.java:632)
 at
com.sun.xml.ws.server.sei.EndpointArgumentsBuilder$RpcLit.readRequest(En
dpointArgumentsBuilder.java:598)
 at
com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHan
dler.java:243)
 at
com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.j
ava:93)
 at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
 at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
 at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
 at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
 at
com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl
.java:106)
 at
com.sun.enterprise.webservice.MonitoringPipe.process(MonitoringPipe.java
:147)
 at
com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.ja
va:115)
 at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
 at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
 at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
 at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
 at
com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl
.java:106)
 at
com.sun.xml.ws.tx.service.TxServerPipe.process(TxServerPipe.java:317)
 at
com.sun.enterprise.webservice.CommonServerSecurityPipe.processRequest(Co
mmonServerSecurityPipe.java:218)
 at
com.sun.enterprise.webservice.CommonServerSecurityPipe.process(CommonSer
verSecurityPipe.java:129)
 at
com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.ja
va:115)
 at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
 at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
 at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
 at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
 at
com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:243)
 at
com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter
.java:444)
 at
com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
 at
com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapt
er.java:135)
 at
com.sun.enterprise.webservice.Ejb3MessageDispatcher.handlePost(Ejb3Messa
geDispatcher.java:113)
 at
com.sun.enterprise.webservice.Ejb3MessageDispatcher.invoke(Ejb3MessageDi
spatcher.java:87)
 at
com.sun.enterprise.webservice.EjbWebServiceServlet.dispatchToEjbEndpoint
(EjbWebServiceServlet.java:200)
 at
com.sun.enterprise.webservice.EjbWebServiceServlet.service(EjbWebService
Servlet.java:129)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
 at
com.sun.enterprise.web.AdHocContextValve.invoke(AdHocContextValve.java:1
14)
 at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java
:632)
 at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java
:577)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:5
71)
 at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:87)
 at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:206)
 at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java
:632)
 at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java
:577)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:5
71)
 at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
 at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:150)
 at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java
:632)
 at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java
:577)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:5
71)
 at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
 at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:270)
 at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdap
ter(DefaultProcessorTask.java:637)
 at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(
DefaultProcessorTask.java:568)
 at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(De
faultProcessorTask.java:813)
 at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcesso
rTask(DefaultReadTask.java:339)
 at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultR
eadTask.java:261)
 at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultR
eadTask.java:212)
 at
com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(Po
rtUnificationPipeline.java:361)
 at
com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
 at
com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWork
erThread.java:106)
|#]
 
 
 
---------------------------------------------
WEBSERVICE DEFINITION
---------------------------------------------
@Stateless( name="Ping", mappedName="ulysse/Ping")
@SOAPBinding(style = SOAPBinding.Style.RPC)
@WebService(name="PingService", serviceName = "ulysse",targetNamespace =
"http://www.imtf.com/hypersuite/ulysse")
public class PingBean implements Ping
{
    @WebMethod
    @WebResult(targetNamespace =
"http://www.imtf.com/hypersuite/ulysse", partName = "return")
    public String ping( @WebParam(name = "msg", partName = "msg")
String msg)
....