on 07-27-2006 12:33 PM
Hi all,
I faced a problem with providing a web service that accepts data as discribed in a schema file (xsd).
I first analysed the schema and created the data classes according to it, as closest, as I could.
How can I realize such a ComplexType as class (MyCars.java):
<xs:schema xmlns:cars="Cars" targetNamespace="Cars">
<xs:element name="MyCars">
<xs:complexType>
<xs:sequence>
<xs:choice maxOccurs="unbounded">
<xs:element ref="cars:Ford"/>
<xs:element ref="cars:Mercedes"/>
</xs:choice>
<xs:element ref="cars:CarPort" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:schema xmlns:cars="Cars" targetNamespace="Cars">
Data that will be provided to the WebService might look like:
<MyCars xmlns="Cars">
<Ford ... />
<Mercedes ... />
<Ford ... />
<Ford ... />
<Mercedes ... />
<CarPort>5th Avenue</CarPort>
</MyCars>
Please help me and thanks in advance,
Paul
Paul,
There is a tool in SAP XML Toolkit to generate java classes out of a xml schema.
Take a look at this link:
<a href="http://help.sap.com/saphelp_webas630/helpdata/en/41/e568dc6b6742baa879763e8ea4a490/content.htm">http://help.sap.com/saphelp_webas630/helpdata/en/41/e568dc6b6742baa879763e8ea4a490/content.htm</a>
Regards
Sebastian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sebastian,
Thank you for your advice, I'm already closer!
OK, I followed the instructions provided by the link, and I was able to generate the classes.
(After I noticed, that there are NOT all Packages listed that are needed to generate the classes, "SAP_WEBSERVICES_EXT_LIBS_HOME/lib/util.jar" was missing)
Now, I tried to create a Virtual Interface, because I need to provide a web service with this classes, but NetWeaver won't do it. When I choose "New Virtual Interface" from the bean context menu, silently nothing happens.
After closing and opening again, the last step created an empty VI definition.
When I try to deploy, I get errors like in
Are there any information about com.sap.engine.services.webservices.server.deploy.ws.WSDeployGenerator around? Even Google doesn't find anything.
The error is:
Caused by: com.sap.engine.interfaces.webservices.server.deploy.WSDeploymentException: Webservices common deployment exception! The reason is: Unable to generate schemas for complex types from provided virtual interfaces. Additional info: not available
at com.sap.engine.services.webservices.server.deploy.ws.WSDeployGenerator.getSchemas(WSDeployGenerator.java:217)
at com.sap.engine.services.webservices.server.deploy.ws.WSDeployGenerator.generateSingleWSDeployFilesStandard(WSDeployGenerator.java:488)
Thank you in advance for any advise,
Paul
Hi Sebastian,
thank you for your quick reply!
Sorry I had some dates out of office.
I run SAP NW 04 SneakPreview.
Kernel / RTE is W32/INTEL Kernel 7.5.0 Build 007-123-057-359
What's the trick to recognize what's actually happing when the recieved XML structure gets parsed? Is there a way to debug the class instanciations and value assignments?
I tried to follow the instructions from <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/b6d1585f-0c01-0010-7da6-d3ac0b1026a8">SAP NetWeaver J2EE Preview: Remote Debugging of JSP Files</a> but I can't enable debugging on "server0". As this is an off-topic problem I'll post it as a new one on "NetWeaver Platform".
Any hint is appriciated!
Regards,
Paul
Message was edited by: Paul Scheremet
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.