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

    Possible JBoss SwA Bug

    malmit

      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>
      <mime:multipartRelated>
      <mime:part>
      <SOAP:body use="literal"/>
      </mime:part>
      <mime:part>
      <mime:content part="data" type="gzip"/>
      </mime:part>
      </mime:multipartRelated>
      </ input>
      < output>
      <SOAP:body use="literal"/>
      </ output>
      </SOAP:operation>

      </SOAP:binding>


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

      <variable-mapping>
      <java-variable-name>data</java-variable-name>
      <xml-element-name>data</xml-element-name>
      </variable-mapping>

      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,
      Tim

        • 1. Re: Possible JBoss SwA Bug
          rayymlai

          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"
          
           config="${resources.dir}/wstools-config.xml"/>
          
           -->
          
           3. ant generate-sources
          
           There should be an error:
          
          C:\projects\jbossws-1.0.3.GA\samples\swa>ant generate-sources
          
          Buildfile: build.xml
          
          
          
          init:
          
          [available] DEPRECATED - <available> used to override an existing property.
          
          [available] Build file should not reuse the same property name for different v
          
          alues.
          
           [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
          
          
          
          
          
          compile:
          
          
          
          generate-sources:
          
           [wstools] log4j:WARN No appenders could be found for logger (org.jboss.ws.tool
          
          s.WSTools).
          
           [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
          
          n*[12,18]
          
           [wstools] at org.jboss.ws.tools.config.ToolsSchemaConfigReader.readConfig(
          
          ToolsSchemaConfigReader.java:141)
          
           [wstools] at org.jboss.ws.tools.WSTools.readToolsConfiguration(WSTools.jav
          
          a:150)
          
           [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
          
          va:275)
          
           [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
          
          a:1216)
          
           [wstools] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
          
          
          
           [wstools] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(De
          
          faultExecutor.java:40)
          
           [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'. @
          
           *unknown*[12,18]
          
           [wstools] at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBo
          
          ssXBParser.java:156)
          
           [wstools] at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerI
          
          mpl.java:169)
          
           [wstools] at org.jboss.ws.tools.config.ToolsSchemaConfigReader.readConfig(
          
          ToolsSchemaConfigReader.java:137)
          
           [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
          
          rHandler.error(SaxJBossXBParser.java:326)
          
           [wstools] at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Sour
          
          ce)
          
           [wstools] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown S
          
          ource)
          
           [wstools] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown S
          
          ource)
          
           [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
          
          urce)
          
           [wstools] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown So
          
          urce)
          
           [wstools] at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
          
           [wstools] at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Sou
          
          rce)
          
           [wstools] at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBo
          
          ssXBParser.java:152)
          
           [wstools] ... 17 more
          
          
          
          BUILD FAILED
          
          
          
          


          thanks

          • 2. Re: Possible JBoss SwA Bug
            malmit

            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
              mnsharif

              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"/>
              </message>


              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?




              regards,
              mnsharif

              • 4. Re: Possible JBoss SwA Bug
                mnsharif

                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"/>
                </message>



                Are we doing anything wrong here?


                Any pointer would be appreciated.
                mnsharif