users@jax-ws.java.net

RE: Re: wsgen issue: not using schema provided

From: Chua, Jerson \(Exchange\) <"Chua,>
Date: Mon, 28 Aug 2006 17:59:01 -0400

Jitu,

Thanks for the quick reply.

Does this mean that using wsgen will always generate a new WSDL and
schema documents?

What do you think should be the development methodology for case where
the inputs are only XSDs and list of methods that the business wants to
expose? Design WSDL by hand and use wsimport? I was hoping that I can
use wsgen and customize the WSDL.

Your input is highly appreciated.

Thanks.

Jerson

-----Original Message-----
From: Jitendra.Kotamraju_at_Sun.COM [mailto:Jitendra.Kotamraju_at_Sun.COM]
Sent: Monday, August 28, 2006 5:05 PM
To: users_at_jax-ws.dev.java.net
Subject: Re: wsgen issue: not using schema provided

In this case, jax-ws runtime is generating new WSDL and schema documents

from java classes. If you have started with the WSDL, this would have
been easy. You just need to specify the WSDL in sun-jaxws.xml and
package the WSDL documents in the war. Can you try packaging the schema
at WEB-INF/wsdl/poks.xsd in the war file, and see if the schema is
picked.

Jitu

Chua, Jerson (Exchange) wrote:

> Here are steps that I did.
>
>
>
> 1. Created my own schema (poks.xsd)
>
>
>
> <xs:schema targetNamespace="urn:mycompany.com:mc.web.poks:1.0"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:tns="urn:mycompany.com:mc.web.poks:1.0"
> elementFormDefault="qualified" attributeFormDefault="unqualified">
>
> <xs:element name="RrNumber">
>
> <xs:simpleType>
>
> <xs:restriction base="xs:token">
>
> <xs:length value="4"/>
>
> </xs:restriction>
>
> </xs:simpleType>
>
> </xs:element>
>
> <xs:element name="RrName">
>
> <xs:simpleType>
>
> <xs:restriction base="xs:string">
>
> <xs:maxLength
value="29"/>
>
> </xs:restriction>
>
> </xs:simpleType>
>
> </xs:element>
>
> <xs:complexType name="RRInfoType">
>
> <xs:sequence>
>
> <xs:element ref="tns:RrNumber"/>
>
> <xs:element ref="tns:RrName"
> minOccurs="0"/>
>
> </xs:sequence>
>
> </xs:complexType>
>
> </xs:schema>
>
>
>
>
>
> 2. Generate JAXB classes with following ant task
>
>
>
> <target name="generate-jaxb-classes">
>
> <echo message="Compiling the schema..." />
>
> <xjc package="com.bear.poks.jaxb" target="${src.dir}">
>
> <schema dir="${schema.dir}" includes="*.xsd"/>
>
> <produces dir="${src.dir}/com/bear/poks/jaxb"
> includes="**/*.java" />
>
> </xjc>
>
> </target>
>
>
>
> 3. Create end point implementation in Netbeans using the generated
> JAXB class as a return type
>
>
>
> package com.bear.poks.webservice;
>
>
>
> import com.bear.poks.jaxb.RRInfoType;
>
> import java.util.ArrayList;
>
> import java.util.List;
>
> import javax.jws.WebService;
>
> import javax.jws.WebMethod;
>
> import javax.jws.WebParam;
>
>
>
> /**
>
> *
>
> * @author jchua
>
> */
>
> @WebService()
>
> public class PoksService {
>
>
>
> /**
>
> * Web service operation
>
> */
>
> @WebMethod
>
> public List<RRInfoType> getRrsForUser(@WebParam(name = "userId")
> String userId, @WebParam(name = "rrNo") String rrNo, @WebParam(name =
> "occd") String occd) throws com.bear.poks.exception.poksException {
>
> List<RRInfoType> list = new ArrayList<RRInfoType>();
>
>
>
> RRInfoType rr1 = new RRInfoType();
>
> rr1.setRrName("Jane Doe");
>
> rr1.setRrNumber("1234");
>
>
>
> RRInfoType rr2 = new RRInfoType();
>
> rr1.setRrName("John Doe");
>
> rr1.setRrNumber("56789");
>
>
>
> return list;
>
> }
>
> }
>
>
>
> 4. Deploy application in Tomcat
>
>
>
>
>
> The problem is that the generated WSDL doesn't use poks.xsd that I
> created. The generated schema (xsd=1) doesn't have the restrictions
> that I've defined in poks.xsd.
>
>
>
> ...
>
> <types>
>
> <xsd:schema>
>
> <xsd:import namespace="urn:mycompany.com:mc.web.poks:1.0"
> schemaLocation="http://localhost:8084/poks_ws/poksService?xsd=1" />
>
> </xsd:schema>
>
> <xsd:schema>
>
> <xsd:import namespace="http://webservice.poks.bear.com/"
> schemaLocation="http://localhost:8084/poks_ws/poksService?xsd=2" />
>
> </xsd:schema>
>
> </types>
>
> ...
>
>
>
> How can I force to wsgen to use the poks.xsd in the WSDL? Please
> advice. Thanks.
>
>-----------------------------------------------------------------------
-
>
>
>
>***********************************************************************
>Bear Stearns is not responsible for any recommendation, solicitation,
>offer or agreement or any information about any transaction, customer
>account or account activity contained in this communication.
>***********************************************************************
>
>
>
>
>-----------------------------------------------------------------------
-
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe_at_jax-ws.dev.java.net
>For additional commands, e-mail: users-help_at_jax-ws.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jax-ws.dev.java.net
For additional commands, e-mail: users-help_at_jax-ws.dev.java.net




***********************************************************************
Bear Stearns is not responsible for any recommendation, solicitation,
offer or agreement or any information about any transaction, customer
account or account activity contained in this communication.
***********************************************************************