You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by Jim Hazen <ji...@myplay.com> on 2001/05/16 21:39:41 UTC

Re: XMI problems...please help (updated).

I've found that if I download the XMIFramework from IBM (XMIFramework.jar) and include this in
front of xmisoap.jar, that client code does construct a SOAP envelope.  However when this
reaches the server, the server punts with a SAX error because of the XMI encoding.

As you'll notice in the message there are extra xml declarations '<?xml version="1.0"
encoding="UTF-8"?>' in the message.  XMI seems to put them there and SAX doesn't like it.
Anyone know why this would happen.  If SOAP is expecting this behavior, then it should be
handled correctly.

Any suggestions?

-Jim

The error is below and the message is included:

org.xml.sax.SAXParseException: The XML declaration may only appear at the very beginning of the
document.
        at java.lang.Throwable.fillInStackTrace(Native Method)
        at java.lang.Throwable.fillInStackTrace(Compiled Code)
        at java.lang.Throwable.<init>(Compiled Code)
        at java.lang.Exception.<init>(Compiled Code)
        at org.xml.sax.SAXException.<init>(SAXException.java:45)
        at org.xml.sax.SAXParseException.<init>(SAXParseException.java:56)
        at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1056)
        at
org.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError(XMLDocumentScanner.java:626)

        at org.apache.xerces.framework.XMLDocumentScanner.abortMarkup(Compiled Code)
        at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(Compiled
Code)
        at org.apache.xerces.framework.XMLDocumentScanner.parseSome(Compiled Code)
        at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:948)
         ....

Message:

<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope ns0:Protocol="1.0"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns0="urn:Message"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<ns1:instantiateOffer xmlns:ns1="urn:testServices"
SOAP-ENV:encodingStyle="http://www.ibm.com/namespaces/xmi">
<?xml version="1.0" encoding="UTF-8"?>
<XMI xmi.version="1.1" timestamp="timestamp temporarily ommitted">
  <XMI.header>
    <XMI.documentation>
      <XMI.exporter>Java Object Bridge (JOB)</XMI.exporter>
      <XMI.exporterVersion>0.9</XMI.exporterVersion>
    </XMI.documentation>
  </XMI.header>
  <XMI.content>
    <java.lang.Integer xmi.id="_1" value="10"/>
  </XMI.content>
</XMI>
<?xml version="1.0" encoding="UTF-8"?>
<XMI xmi.version="1.1" timestamp="timestamp temporarily ommitted">
  <XMI.header>
    <XMI.documentation>
      <XMI.exporter>Java Object Bridge (JOB)</XMI.exporter>
      <XMI.exporterVersion>0.9</XMI.exporterVersion>
    </XMI.documentation>
  </XMI.header>
  <XMI.content>
    <java.lang.Integer xmi.id="_1" value="10"/>
  </XMI.content>
</XMI>
<java.lang.String value='test' />
<?xml version="1.0" encoding="UTF-8"?>
<XMI xmi.version="1.1" timestamp="timestamp temporarily ommitted">
  <XMI.header>
    <XMI.documentation>
      <XMI.exporter>Java Object Bridge (JOB)</XMI.exporter>
      <XMI.exporterVersion>0.9</XMI.exporterVersion>
    </XMI.documentation>
  </XMI.header>
  <XMI.content>
    <java.lang.Integer xmi.id="_1" value="10"/>
  </XMI.content>
</XMI>
<?xml version="1.0" encoding="UTF-8"?>
<XMI xmi.version="1.1" timestamp="timestamp temporarily ommitted">
  <XMI.header>
    <XMI.documentation>
      <XMI.exporter>Java Object Bridge (JOB)</XMI.exporter>
      <XMI.exporterVersion>0.9</XMI.exporterVersion>
    </XMI.documentation>
  </XMI.header>
  <XMI.content>
    <java.lang.Integer xmi.id="_1" value="10"/>
  </XMI.content>
</XMI>
<?xml version="1.0" encoding="UTF-8"?>
<XMI xmi.version="1.1" timestamp="timestamp temporarily ommitted">
  <XMI.header>
    <XMI.documentation>
      <XMI.exporter>Java Object Bridge (JOB)</XMI.exporter>
      <XMI.exporterVersion>0.9</XMI.exporterVersion>
    </XMI.documentation>
  </XMI.header>
  <XMI.content>
    <java.lang.Integer xmi.id="_1" value="10"/>
  </XMI.content>
</XMI>
</ns1:instantiateOffer>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

> It seems that the xmisoap.jar that is downloadable from the SOAP web site is
> rather old.  When I try and create a call using XMI encoding I get the following
> error:
>
> java.lang.NoClassDefFoundError: com/ibm/xml/parser/MIME2Java
>         at com.ibm.xmi.framework.XMIFile.write(XMIFile.java:822)
>         at com.ibm.xmi.job.Job.writeObjectsImpl(Job.java:82)
>         at com.ibm.xmi.job.Job.writeObjects(Job.java:44)
>         at
> org.apache.soap.util.xml.XMISerializer.marshall(XMISerializer.java:114)
>         at
> org.apache.soap.util.xml.XMLJavaMappingRegistry.marshall(XMLJavaMappingRegistry.java:213)
>
>         at
> org.apache.soap.encoding.xmi.XMIParameterSerializer.marshall(XMIParameterSerializer.java:89)
>
>         at org.apache.soap.rpc.RPCMessage.serializeParams(RPCMessage.java:334)
>         at org.apache.soap.rpc.RPCMessage.marshall(RPCMessage.java:307)
>         at org.apache.soap.Body.marshall(Body.java:145)
>         at org.apache.soap.Envelope.marshall(Envelope.java:195)
>         at
> org.apache.soap.transport.http.SOAPHTTPConnection.send(SOAPHTTPConnection.java:186)
>
>         ...
>
> This seems to be a problem with xmisoap.jar.  The XMIFile class tries to call
> MIME2Java in the com/ibm/xml/parser package.  This file exists, but it's not in
> this package.  The file can be found in Xerces 1.2.3 under the path:
>
> org/apache/xerces/readers/MIME2Java.class
>
> I would really like to use XMI with the current SOAP 2.1 release.  As far as I
> can tell, XMI support in SOAP 2.1 is broken.
>
> Any help would be much appreciated.
>
> Thanks,
> Jim
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: XMI problems...please help (updated).

Posted by "William A. Nagy" <na...@watson.ibm.com>.
>I've found that if I download the XMIFramework from IBM (XMIFramework.jar) and include this in
>front of xmisoap.jar, that client code does construct a SOAP envelope.  However when this
>reaches the server, the server punts with a SAX error because of the XMI encoding.
>
>As you'll notice in the message there are extra xml declarations '<?xml version="1.0"
>encoding="UTF-8"?>' in the message.  XMI seems to put them there and SAX doesn't like it.
>Anyone know why this would happen.  If SOAP is expecting this behavior, then it should be
>handled correctly.
>
>Any suggestions?

I'm working on getting a new snapshot of the xmisoap.jar created (with
the newest code from the IBM XMIFramework.jar,) and will make sure
that the SOAP source code gets updated if needed.  Since I don't have
control over the code in the XMIFramework.jar, however, I can't make any
promises as to how quickly this will happen.

-Bill


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: XMI problems...please help (updated).

Posted by "William A. Nagy" <na...@watson.ibm.com>.
>I've found that if I download the XMIFramework from IBM (XMIFramework.jar) and include this in
>front of xmisoap.jar, that client code does construct a SOAP envelope.  However when this
>reaches the server, the server punts with a SAX error because of the XMI encoding.
>
>As you'll notice in the message there are extra xml declarations '<?xml version="1.0"
>encoding="UTF-8"?>' in the message.  XMI seems to put them there and SAX doesn't like it.
>Anyone know why this would happen.  If SOAP is expecting this behavior, then it should be
>handled correctly.
>
>Any suggestions?

I'm working on getting a new snapshot of the xmisoap.jar created (with
the newest code from the IBM XMIFramework.jar,) and will make sure
that the SOAP source code gets updated if needed.  Since I don't have
control over the code in the XMIFramework.jar, however, I can't make any
promises as to how quickly this will happen.

-Bill


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org