Back Forum Reply New

xsd issue while generating WSDL

Hi,

I am new to Spring-WS.
First I ran the sample Echo example on my tomcat. It is running successfully.

Now I have creating my own webservices: I started as follows:

1. Created response xml and created corresponding xsd using some tool.
2. Created EndPointClass,  service interface and its class.
3. Then I put entries in web.xml and spring-ws-servlet.xml.

but now when I am hitting the ucl to generate the WSDL I am getting the following error:
org..beans.factory.BeanCreationExce  ption: Error creating bean with name 'customer' defined in ServletContext resource [/WEB-INF/spring-ws-servlet.xml]: Cannot resolve reference to bean 'schema' while setting bean property 'schema'; nested exception is org..beans.factory.BeanCreationExce  ption: Error creating bean with name 'schema' defined in ServletContext resource [/WEB-INF/spring-ws-servlet.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: xsd 'class path resource [WEB-INF/customer.xsd]' does not exit
org..beans.factory.support.BeanDefi  nitionValueResolver.resolveReference(BeanDefinitio  nValueResolver.java:275)
org..beans.factory.support.BeanDefi  nitionValueResolver.resolveValueIfNecessary(BeanDe  finitionValueResolver.java:104)
org..beans.factory.support.Abstract  AutowireCapableBeanFactory.applyPropertyValues(Abs  tractAutowireCapableBeanFactory.java:1245)
org..beans.factory.support.Abstract  AutowireCapableBeanFactory.populateBean(AbstractAu  towireCapableBeanFactory.java:1010)
org..beans.factory.support.Abstract  AutowireCapableBeanFactory.doCreateBean(AbstractAu  towireCapableBeanFactory.java:472)
org..beans.factory.support.Abstract  AutowireCapableBeanFactory$1.run(AbstractAutowireC  apableBeanFactory.java:409)
java.security.AccessController.doPrivileged(Native Method)

Here is my spring-ws-servlet.xmlCode:   lt;bean id=quot;customerquot; class=quot;org..ws.wsdl.wsdl11.DefaultWsdl11Definitionquot;gt;       lt;descriptiongt;This bean definition represents a WSDL definition that is generated at runtime. It can be retrieved bygoing to /ciaservices/customer.wsdl (i.e. the bean name corresponds to the filename).       lt;/descriptiongt;       lt;property name=quot;schemaquot; ref=quot;schemaquot;/gt;       lt;property name=quot;portTypeNamequot; value=quot;Customerquot;/gt;       lt;property name=quot;locationUriquot; value=quot;ciaservices/customerquot;/gt;   lt;/beangt;
   lt;bean id=quot;schemaquot; class=quot;org..xml.xsd.SimpleXsdSchemaquot;gt;       lt;descriptiongt;This bean definition contains the XSD schema.       lt;/descriptiongt;       lt;property name=quot;xsdquot; value=quot;/WEB-INF/customer.xsdquot;/gt;   lt;/beangt;
   lt;bean id=quot;customerServicequot; class=quot;com.cia.ws.customer.services.CustomerProfileServiceImplquot;gt;       lt;descriptiongt;This bean is our quot;businessquot; service.       lt;/descriptiongt;   lt;/beangt;

lt;bean class=quot;org..ws.server.endpoint.mapping.PayloadRootQNameEndpointMappingquot;gt;   lt;property name=quot;mappingsquot;gt;       lt;propsgt;lt;prop key=quot;{customer/customersegments}CustomerProfileRequestquot;gt;customerEndpointlt;/propgt;       lt;/propsgt;   lt;/propertygt;   lt;property name=quot;interceptorsquot;gt;       lt;bean class=quot;org..ws.server.endpoint.interceptor.PayloadLoggingInterceptorquot;/gt;   lt;/propertygt;
lt;/beangt;
  lt;bean id=quot;validatingInterceptorquot;         class=quot;org..ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptorquot;gt;       lt;descriptiongt;This interceptor validates both incoming and outgoing message contents according to the 'customer.xsd' XMLSchema file.       lt;/descriptiongt;       lt;property name=quot;xsdSchemaquot; ref=quot;schemaquot;/gt;       lt;property name=quot;validateRequestquot; value=quot;falsequot;/gt;       lt;property name=quot;validateResponsequot; value=quot;truequot;/gt;   lt;/beangt;
Thanks

And here is my XSD.Code:
lt;?xml version=quot;1.0quot; encoding=quot;utf-16quot;?gt;
lt;xsd:schema attributeFormDefault=quot;qualifiedquot; elementFormDefault=quot;qualifiedquot; version=quot;1.0quot; xmlns:xsd=quot;2001/XMLSchemaquot;       targetNamespace=quot;customer/customersegmentsquot;       xmlns:tns=quot;customer/customersegmentsquot;gt;
lt;xsd:element name=quot;CustomerProfileRequestquot; type=quot;CustomerProfileRequestTypequot; /gt; lt;xsd:complexType name=quot;CustomerProfileRequestTypequot;gt;   lt;xsd:sequencegt;     lt;xsd:element name=quot;CustomerSegmentsquot; type=quot;CustomerSegmentsTypequot; /gt;   lt;/xsd:sequencegt; lt;/xsd:complexTypegt; lt;xsd:complexType name=quot;CustomerSegmentsTypequot;gt;   lt;xsd:sequencegt;     lt;xsd:element name=quot;customer-segmentquot; type=quot;xsd:stringquot; /gt;   lt;/xsd:sequencegt; lt;/xsd:complexTypegt;
lt;/xsd:schemagt;
I am not clear what I am doing wrong? I there si something wrong with my XSD?

what all are the files which Spring-WS uses for generating the WSDL?

I have resolved the issue.

Actually the problem was some jars files were missing in the build path and in the WEB-INF/lib folder.
But this is strange if jars are missing in the Build path then it should give compilation error and if it needs that jars at runtime then I already had these in the Tomcat/lib folder. Dont know what was wrong but I simply put some spring jars into WEB-INF/lib folder and it works.

.Copyright 2000 Example.com. All rights reserved.       lt;/xsd:documentationgt;   lt;/xsd:annotationgt;      lt;xsd:element name=quot;purchaseOrderquot; type=quot;tnsurchaseOrderTypequot;/gt;      lt;xsd:element name=quot;commentquot; type=quot;xsd:stringquot;/gt;      lt;xsd:complexType name=quoturchaseOrderTypequot;gt;       lt;xsd:sequencegt;lt;xsd:element name=quot;shipToquot; type=quot;tns:USAddressquot;/gt;lt;xsd:element name=quot;billToquot; type=quot;tns:USAddressquot;/gt;lt;xsd:element ref=quot;tns:commentquot; minOccurs=quot;0quot;/gt;lt;xsd:element name=quot;itemsquot;  type=quot;tns:Itemsquot;/gt;       lt;/xsd:sequencegt;       lt;xsd:attribute name=quot;orderDatequot; type=quot;xsd:datequot;/gt;   lt;/xsd:complexTypegt;      lt;xsd:complexType name=quot;USAddressquot;gt;       lt;xsd:sequencegt;lt;xsd:element name=quot;namequot;   type=quot;xsd:stringquot;/gt;lt;xsd:element name=quot;streetquot; type=quot;xsd:stringquot;/gt;lt;xsd:element name=quot;cityquot;   type=quot;xsd:stringquot;/gt;lt;xsd:element name=quot;statequot;  type=quot;xsd:stringquot;/gt;lt;xsd:element name=quot;zipquot;    type=quot;xsd:decimalquot;/gt;       lt;/xsd:sequencegt;       lt;xsd:attribute name=quot;countryquot; type=quot;xsd:NMTOKENquot;           fixed=quot;USquot;/gt;   lt;/xsd:complexTypegt;      lt;xsd:complexType name=quot;Itemsquot;gt;       lt;xsd:sequencegt;lt;xsd:element name=quot;itemquot; minOccurs=quot;0quot; maxOccurs=quot;unboundedquot;gt;    lt;xsd:complexTypegt;        lt;xsd:sequencegt;            lt;xsd:element name=quot;productNamequot; type=quot;xsd:stringquot;/gt;            lt;xsd:element name=quot;quantityquot;gt;                lt;xsd:simpleTypegt;                    lt;xsd:restriction base=quot;xsdositiveIntegerquot;gt;                        lt;xsd:maxExclusive value=quot;100quot;/gt;                    lt;/xsd:restrictiongt;                lt;/xsd:simpleTypegt;            lt;/xsd:elementgt;            lt;xsd:element name=quot;USPricequot;  type=quot;xsd:decimalquot;/gt;            lt;xsd:element ref=quot;tns:commentquot;   minOccurs=quot;0quot;/gt;            lt;xsd:element name=quot;shipDatequot; type=quot;xsd:datequot; minOccurs=quot;0quot;/gt;        lt;/xsd:sequencegt;        lt;xsd:attribute name=quot;partNumquot; type=quot;tns:SKUquot; use=quot;requiredquot;/gt;    lt;/xsd:complexTypegt;lt;/xsd:elementgt;       lt;/xsd:sequencegt;   lt;/xsd:complexTypegt;      lt;!-- Stock Keeping Unit, a code for identifying products --gt;   lt;xsd:simpleType name=quot;SKUquot;gt;       lt;xsd:restriction base=quot;xsd:stringquot;gt;lt;xsdattern value=quot;\d{3}-[A-Z]{2}quot;/gt;       lt;/xsd:restrictiongt;   lt;/xsd:simpleTypegt;   
lt;/xsd:schemagt;can you please sort it out ,why it is so,thanks in advance

Hi,

It seems that InliningXsdSchemaTypesProvider is not in the claspath.
I found this class inside spring-ws-1.5.6-all.jar.
So please check that should be in the lib directory(if you are using tomcat) or in the classpath.

thanks for your reply ,now the problem is that the wsdl is genrating  now but the welcome page is not coming still the build is sucessfully formed
¥
Back Forum Reply New