You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Da...@sinnerschrader.com on 2001/11/08 15:58:04 UTC
How to use a xml-schema within a service
Hi,
i have a service which offers a client to get categories and products of a
catalog.
I created a xml schema file catalog.xsd where I defined how a category, a
product or the catalog list looks like.
I thouht it shold be the definition how these elements look in the SOAP
response.
And thats the point where I have no ideas how to get the xsd within the
services, so that the the
response wolud be in the way like I want.
this is a response from the service which is not correct:
HTTP/1.0 200 OK
Server: Resin/2.0.3
Set-Cookie: JSESSIONID=aaaaOmLgsCZkM-; Path=/
Content-Type: text/xml; charset=utf-8
Content-Length: XXXX
Date: Thu, 08 Nov 2001 14:14:17 GMT
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV
="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi
="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd
="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<ns1:getCategoryResponse xmlns:ns1="urn:pShopCatalogService"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<return xmlns:ns2="urn:xml-soap-pShop-webservices" xsi:type="ns2:pshop">
<noOfProducts xsi:type="xsd:int">1319</noOfProducts>
<name xsi:type="xsd:string">Autos</name>
<subCategories xmlns:ns3="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns3:Array" ns3:arrayType="ns2:pshop[5]">
<item xsi:type="ns2:pshop">
<noOfProducts xsi:type="xsd:int">228</noOfProducts>
<name xsi:type="xsd:string">Grosses</name>
<subCategories xsi:type="ns3:Array" ns3:arrayType="ns2:pshop[]"
xsi:null="true"/>
<description xsi:type="xsd:string" xsi:null="true"/>
<parentId xsi:type="xsd:int">0</parentId>
<id xsi:type="xsd:int">422</id>
</item>
</subCategories>
<description xsi:type="xsd:string">A nice category
description.</description>
<parentId xsi:type="xsd:int">-1</parentId>
<id xsi:type="xsd:int">421</id>
</return>
</ns1:getCategoryResponse>
the problem is that in my schema i defined othr nodes like this
<catalog>
<categor>
...
<sub-categories>
<category>
...
</category>
...
</subcategories>
</category>
...
</catalog>
and in the SOAP response I got <item> whithin the subcategories node
and <return> instead of <category>
I know this is a lot to read an to think about, but I hope there is anybody
who can give me a hint
or describe how I can solve the problem.
many thx
daniel
____________________________________________
SinnerSchrader Deutschland GmbH
Communication & Technology
mailto:d.wolff@sinnerschrader.com
http://www.sinnerschrader.com
fon +49.(0) 40.39 88 55-0
fax +49.(0) 40.39 88 55-55
gasstrasse 8-16 | 22761 hamburg | germany
____________________________________________