4 Replies Latest reply on Nov 12, 2006 12:14 PM by nafees sharif

    Possible JBoss SwA Bug

    Tim Lam Newbie

      I am trying to build a document literal web service in JBoss 4.0.5 and can't get around this exception:

      org.jboss.ws.WSException: Cannot obtain java/xml type mapping for: {http://www.w3.org/2001/XMLSchema}base64Binary

      Here's what my wsdl looks like:

      <SOAP:binding style="document" transport="http://schemas.xmlsoap.org/soap/http">

      <SOAP:operation style="document" soapAction="Ping">
      < input>
      <SOAP:body use="literal"/>
      <mime:content part="data" type="gzip"/>
      </ input>
      < output>
      <SOAP:body use="literal"/>
      </ output>


      In my mapping.xml file that wscompile generated, this mapping was generated for the data mime:content:


      My ultimate goal is to allow a web service request containing parameters passed via a normal web service request and allow an attachment of a base64 encoded binary file. Is this a bug in JBoss 4.0.5 or did I do something wrong?

      Thanks in advanced,

        • 1. Re: Possible JBoss SwA Bug
          ray lai Newbie

          We run the JBossWS swa sample codes, and encounter this problem.
          If you uncomment out the build.xml the wstool task example, we find this error.

          Could any one help to see if this is a bug in JBossWS?
          We also find that there are a few JBossWS sample subprojects sharing the same problem.

           1. In JBossWS 1.0.3 samples, cd to samples\swa.
           2. Uncomment the following in the build.xml.
           <!-- samples/swa - ->
           <wstools dest="${build.test.dir}/wstools/resources/samples/swa/WEB-INF"
           3. ant generate-sources
           There should be an error:
          C:\projects\jbossws-1.0.3.GA\samples\swa>ant generate-sources
          Buildfile: build.xml
          [available] DEPRECATED - <available> used to override an existing property.
          [available] Build file should not reuse the same property name for different v
           [echo] jboss.home = c:/jboss-4.0.4.ga
           [echo] tomcat.home = c:/projects/jbossws-1.0.3.ga/lib/tomcat
           [echo] java.home = C:\Java\jdk1.5.0_06\jre
           [echo] node0 = MTVL04AL3H1430
           [wstools] log4j:WARN No appenders could be found for logger (org.jboss.ws.tool
           [wstools] log4j:WARN Please initialize the log4j system properly.
           [wstools] java.io.IOException: Cannot parse config: Failed to parse source: cvc-complex-type.4: Attribute 'name' must appear on element 'operation'. @ *unknow
           [wstools] at org.jboss.ws.tools.config.ToolsSchemaConfigReader.readConfig(
           [wstools] at org.jboss.ws.tools.WSTools.readToolsConfiguration(WSTools.jav
           [wstools] at org.jboss.ws.tools.WSTools.generate(WSTools.java:79)
           [wstools] at org.jboss.ws.tools.ant.wstools.execute(wstools.java:103)
           [wstools] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja
           [wstools] at org.apache.tools.ant.Task.perform(Task.java:364)
           [wstools] at org.apache.tools.ant.Target.execute(Target.java:341)
           [wstools] at org.apache.tools.ant.Target.performTasks(Target.java:369)
           [wstools] at org.apache.tools.ant.Project.executeSortedTargets(Project.jav
           [wstools] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
           [wstools] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(De
           [wstools] at org.apache.tools.ant.Project.executeTargets(Project.java:1068
           [wstools] at org.apache.tools.ant.Main.runBuild(Main.java:668)
           [wstools] at org.apache.tools.ant.Main.startAnt(Main.java:187)
           [wstools] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
           [wstools] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
           [wstools] Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse so
          urce: cvc-complex-type.4: Attribute 'name' must appear on element 'operation'. @
           [wstools] at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBo
           [wstools] at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerI
           [wstools] at org.jboss.ws.tools.config.ToolsSchemaConfigReader.readConfig(
           [wstools] ... 15 more
           [wstools] Caused by: org.xml.sax.SAXException: cvc-complex-type.4: Attribute '
          name' must appear on element 'operation'. @ *unknown*[12,18]
           [wstools] at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$MetaDataErro
           [wstools] at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Sour
           [wstools] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown S
           [wstools] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown S
           [wstools] at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter
          .reportError(Unknown Source)
           [wstools] at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaErro
          r(Unknown Source)
           [wstools] at org.apache.xerces.impl.xs.XMLSchemaValidator.addDefaultAttrib
          utes(Unknown Source)
           [wstools] at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartEleme
          nt(Unknown Source)
           [wstools] at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unk
          nown Source)
           [wstools] at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElem
          ent(Unknown Source)
           [wstools] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$Fragmen
          tContentDispatcher.dispatch(Unknown Source)
           [wstools] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDoc
          ument(Unknown Source)
           [wstools] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown So
           [wstools] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown So
           [wstools] at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
           [wstools] at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Sou
           [wstools] at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBo
           [wstools] ... 17 more
          BUILD FAILED


          • 2. Re: Possible JBoss SwA Bug
            Tim Lam Newbie

            Please don't hijack my thread. Your problem is not related to the exception that I am getting and should be in it's own topic.

            • 3. Re: Possible JBoss SwA Bug
              nafees sharif Newbie

              Hi Tim!

              I am also facing a similar problem when deploying a document/literal webservice with attachment (starting from WSDL). In my case the attachment happens to be text/plain, so my message declaration is as follows:

              <message name = "attachRequest">
               <part name = "parametersAttach" element = "ns2:paraList2"/>
               <part name = "attachmentContents" type = "xsd:string"/>

              which generates a similar exception as yours:

              19:41:55,192 WARN [JavaWsdlMapping] Cannot find jaxrpc-mapping for type: {http://www.w3.org/2001/XMLSchema}string
              19:41:55,192 ERROR [MainDeployer] Could not create deployment: file:/D:/jboss-4.0.4.GA/server/default/deploy/alhamd.war
              org.jboss.ws.WSException: Cannot obtain java/xml type mapping for: {http://www.w3.org/2001/XMLSchema}string

              Does this warning, before deployment commences, suggest something?


              • 4. Re: Possible JBoss SwA Bug
                nafees sharif Newbie

                Hi all!

                In document/literal web services, wscompile (from JWSDP1.6) generally gives error when WSDL has something like

                <part name = "attachmentContents" type = "xsd:string"/>

                ... but wstools stays silent and generates SEI/mappingFile successfully when using a similar construct (shown below) for specifying type for an element defined in <mime:content part="attachmentContents" type="text/plain"/>

                <message name = "attachRequest">
                 <part name = "parametersAttach" element = "ns2:paraList2"/>
                 <part name = "attachmentContents" type = "xsd:string"/>

                Are we doing anything wrong here?

                Any pointer would be appreciated.