cancel
Showing results for 
Search instead for 
Did you mean: 

External Schema Support

Former Member
0 Kudos

Hi. I have a question regarding external schema imports and schema links. I am building a set of schema files for my client following the canonical schema pattern. This effort is taking place outside of NetWeaver for several reasons. The plan is to import the schema files into NetWeaver and use the type definitions defined in the schema files in various interface. All in all it seems pretty standard I would think.

Actually I guess I have 3 questions. I hope I'm not breaking any forum rules by putting too much in one post, but here goes:

1. I have created a Canonical Software component version and added the schema files as external imports into that SCV through the ESR. I read that I should be able to use these schemas in other SCVs by creating a dependencies in the SLD. So far I haven't been successful. I just want to check if that will indeed work or if there is something else I need to do.

2. My CanonicalSchema project which is maintained outside of PI has a nested folder structure based on namespace. I have some common level files in the root directory and then business area specific files in directories branching from the root. I extensively reuse the common level files, by using an xsd import like : <import namespace="http://company.com/common/1.1" schemaLocation="../common1_1.xsd"/>. This works great when I'm dealing with the schema files on a file system, however when I import these files into PI it doesn't work well at all. The first import works fine, but I'm not able to update the imported schemas successfully. It seems like there is an issue with the relative link (I presume PI isn't storing these files into a file system, they are probably clobs in a database or something similar). So it makes sense that it probably won't work, but I'm not sure how to resolve this other than saving all the schema files into one directory, which is not ideal. I'm hoping someone can offer a suggestion here.

3. When I import the external schema files I would ideally like to create a namespace for each set of schema files with that target namespace and import the matching files there. For example, I have namespaces such as common, finance, rd, etc. In each of those namespaces I have at least one schema file. Is it possible to have the files link to each other using xsd imports going this route, or do I have to load all the xsds into one namespace?

Thanks for your help!

Kevin

Accepted Solutions (0)

Answers (2)

Answers (2)

VijayKonam
Active Contributor
0 Kudos

I do not think PI would be able refer to sub structures defined in other files. One thing I would suggest is, when you create your external definitions, create them in a single file where the message type also defined. Creating message type externally rather than datatypes would be lot more better and you can directly use them while defining you interfaces.

We did follow this approach and were successful. Also regarding the first question, you should add your SWC containing the external definitions in the dependent SWC list in SLD rather than the opposite way.

VJ

Former Member
0 Kudos

I found out some things yesterday. If you load all the external schemas into one sap namespace it can resolve the links in between the files. However, it appears that you need to use a URL to ensure the link, rather than a relative link. So where I had ../common.xsd now I have http://company.com/schemas/common.xsd. That seems to work fine, although I view that as "hardcoding" the server name in the file which to me isn't all that great.

I'm still stuck on how to refer to other software components from within another software component. I have my common software component defined, called CanonicalModel. In CanonicalModel I have defined a list of dependencies in the Dependent Software Component Versions table. One of these dependent SCVs is ProjectService. Yet when I try to use messages defined in CanonicalModel from ProjectService in the Enterprise Services Builder it doesn't allow me to see the CanonicalModel Software Component Version. I see a field up top that looks like it should be a selectable item for the SCV, but it's not editable. Is there something else I need to do?

Former Member
0 Kudos

I tried changing the dependency as suggested to have my canonicalModel SCV dependent on the Project SCV and I still cannot refer to the external message from the other SCV. It seems the SCV selection is not editable when I'm defining the messages coming in and out of a service. I'm sure I'm just missing something basic - or it's just not possible. Does anyone know the answer? Does the service need to be in same namespace as the canonicalModel definitions?

Thanks,

Kevin

Former Member
0 Kudos

OK I got it to work by reimporting my SCV from the SLD. I have my ProjectService dependent on my CanonicalModel and now I can see the Canonical Model message types from ProjectService.

Former Member
0 Kudos

Hi. I'm hoping to get some feedback on external schema support. I guess I should start with some basic stuff.

Does anyone use external schemas extensively with PI for defining message types? If so, have you had any issues with the schema import functionality? Is this something that generally is not done except in one-off cases?