users@jaxb.java.net

Re: xjc - compiling schema that references other namespace without schema

From: Dmitri Colebatch <dim_at_colebatch.com>
Date: Thu, 28 Sep 2006 05:29:13 +1000

On 9/27/06, Deepak Vohra <dvohra09_at_yahoo.com> wrote:
> Is the type="sap:BAPIRET2" defined in another schema?

There is no standalone schema in which it exists, however it exists in
the WSDL for just about every BAPI in our SAP system and so my process
to date has been to pull down the WSDL, extract the schema from that,
and compile that.

There is no schema location to which I could refer.

cheers
dim

>
> Deepak
>
> Dmitri Colebatch <dim_at_colebatch.com> wrote:
> Hi all,
>
> I thought this was possible, but I'm beginning to wonder if I'm
> thinking of something else.
>
> I have a schema that refers to some types that SAP uses.
> Unfortunately there's no nice way (that I know of) to get these types
> out of SAP in a general form. The relevant parts of my schema are:
>
> xmlns:sap="urn:sap-com:document:sap:rfc:functions"
> xmlns:s0="http://webservices.toyota.com.au/schema/s3/2004/12/14/common.xsd"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
> xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
> jaxb:extensionBindingPrefixes="xjc"
> jaxb:version="2.0"
> elementFormDefault="qualified"
> attributeFormDefault="unqualified">
>
> ....
>
>
>
>
> maxOccurs="unbounded"/>
>
>
>
>
>
>
> I have previously compiled the BAPIRET2 type, and have put that on the
> classpath. I'm running xjc using:
>
> xjc -classpath e:\dev\tmp\common-helper\jaxb-classes -d
> jaxb
> e:\dev\tmp\tJunction\schema\s3\2004\12\14\common.xsd
>
> and I get this error:
>
> parsing a schema...
> [ERROR] src-resolve: Cannot resolve the name 'sap:BAPIRET2' to a(n)
> 'type definition' component.
> line 101 of
> file:/E:/dev/tmp/tJunction/schema/s3/2004/12/14/common.xsd
>
> Failed to parse a schema.
>
> This makes a fair bit of sense, but I thought I could avoid this by
> putting and existing class that already represented that type on the
> classpath. Obviously (unless I'm missing something) this isn't the
> case.
>
> So - is this possible (and if so how)? Given that I can't find the
> above strings in the jaxb source I'm assuming these are coming
> directly from the parser.
>
> Alternatively, does anyone have any advice on how to handle the
> situation where you want to refer to types that don't exist in
> statically available schemas. The way I get these types out of SAP
> atm is to get the WSDL (available for each BAPI) and pull the schema
> out of that before running xjc over it. I have to do these one at a
> time because they contain duplicate copies of the same types (as you'd
> expect).
>
> What I'd like my build process to be is I firstly create a jar that
> contains all the compiled SAP schemas, and then I give that to xjc
> when compiling. My current approach (which has been causing trouble)
> is to have a hand built schema "sap.xsd" that references to types we
> need from SAP. Of course the problem with this is that it gets out of
> date a little too easily.
>
> Any help would gratefully be appreciated.
>
> cheers
> dim
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>
>
>
> ________________________________
> Get your own web address for just $1.99/1st yr. We'll help. Yahoo! Small
> Business.
>
>