Creating Web service using xsd and wsdl

Posted by dnessapkota10 on 02-Apr-2012 05:40

I have sucessfully created web service using XSD and WSDL files. It has been done by first creating XSD and then creating WSDL using XSD. While uploading these files into the ESB container, then the container unable to start correctly,

It throws error in log file as,

[12/04/02 16:21:20] ID=dev_ESBTest (info) [ESBService] Service `Create_and_ExposeWS` initialized: 1 thread(s) listening on Endpoint Create_and_ExposeWS.Entry
[12/04/02 16:21:20] ID=dev_ESBTest (info)

    Sonic Connect
    Version 8.0 Build Number 604
    Copyright (c) 2010 Progress Software Corporation.
    All rights reserved.


Apr 2, 2012 4:21:24 PM org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromWSDL
INFO: Creating Service {http://www.progress.com/services/customerservice/}GetCustomer from WSDL: resources/wsdl/GetCustomer.wsdl
[12/04/02 16:21:24] ID=dev_ESBTest (severe) [ESBService] Error initializing service application Create_and_ExposeWS
[12/04/02 16:21:24] ID=dev_ESBTest (severe) Trace follows...
com.sonicsw.xq.XQServiceException: Error starting service application ( (org.apache.camel.FailedToStartRouteException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.)) ( (org.apache.camel.FailedToStartRouteException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.) (org.apache.camel.FailedToStartRouteException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.))
    at com.sonicsw.xqimpl.service.XQServiceApplication.postInit(XQServiceApplication.java:593)
    at com.sonicsw.xqimpl.service.XQAppManager.init(XQAppManager.java:175)
    at com.sonicsw.xqimpl.service.XQContainer.init(XQContainer.java:456)
    at com.sonicsw.mf.framework.agent.AbstractMBean.<init>(AbstractMBean.java:294)
    at com.sonicsw.mf.framework.agent.ComponentMBean.<init>(ComponentMBean.java:161)
    at com.sonicsw.mf.framework.agent.ContainerImpl.internalLoadComponent(ContainerImpl.java:3634)
    at com.sonicsw.mf.framework.agent.ContainerImpl.loadComponent(ContainerImpl.java:1365)
    at com.sonicsw.mf.framework.agent.ContainerImpl.loadConfiguredComponent(ContainerImpl.java:507)
    at com.sonicsw.mf.framework.agent.ContainerImpl.loadConfiguredComponents(ContainerImpl.java:4394)
    at com.sonicsw.mf.framework.agent.ContainerImpl.loadAllConfiguredComponents(ContainerImpl.java:4230)
    at com.sonicsw.mf.framework.agent.ContainerImpl.bootFramework(ContainerImpl.java:2338)
    at com.sonicsw.mf.framework.agent.ContainerImpl.<init>(ContainerImpl.java:327)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at com.sonicsw.mf.framework.agent.ci.Agent.<init>(Agent.java:225)
    at com.sonicsw.mf.framework.agent.ci.Agent$1.run(Agent.java:96)
    at java.lang.Thread.run(Unknown Source)
Caused by: com.sonicsw.xq.XQServiceException:  (org.apache.camel.FailedToStartRouteException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.) (org.apache.camel.FailedToStartRouteException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.)
    at com.progress.sonic.esb.service.connect.ConnectService.init(ConnectService.java:134)
    at com.sonicsw.xqimpl.service.XQServiceChain.init(XQServiceChain.java:111)
    at com.sonicsw.xqimpl.service.XQServiceApplication.postInit(XQServiceApplication.java:581)
    ... 18 more
Caused by: org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToStartRouteException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
    at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1039)
    at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
    at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:562)
    at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
    at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:274)
    at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:736)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:383)
    at com.progress.sonic.esb.service.connect.spring.SonicFileSystemXmlApplicationContext.<init>(SonicFileSystemXmlApplicationContext.java:28)
    at com.progress.sonic.esb.service.connect.ConnectService.initCamelContext(ConnectService.java:311)
    at com.progress.sonic.esb.service.connect.ConnectService.init(ConnectService.java:132)
    ... 20 more
Caused by: org.apache.camel.FailedToStartRouteException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
    at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:938)
    at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:197)
    at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:101)
    ... 30 more
Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
    at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:93)
    at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:396)
    at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:521)
    at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:271)
    at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:100)
    at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:105)
    at org.apache.camel.component.cxf.CxfConsumer.<init>(CxfConsumer.java:123)
    at org.apache.camel.component.cxf.CxfEndpoint.createConsumer(CxfEndpoint.java:97)
    at org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:60)
    at org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:83)
    at org.apache.camel.impl.RouteService.doStart(RouteService.java:123)
    at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:55)
    at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:906)
    ... 32 more
Caused by: javax.wsdl.WSDLException: WSDLException (at /wsdl:definitions/wsdl:types/xsd:schema): faultCode=PARSER_ERROR: Problem parsing 'wsType.xsd'.: java.io.FileNotFoundException: C:\Program Files\Progress\Sonic\Containers\Domain1.dev_ESBTest\wsType.xsd (The system cannot find the file specified)
    at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
    at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:229)
    at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:179)
    at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:91)
    ... 44 more
Caused by: java.io.FileNotFoundException: C:\Program Files\Progress\Sonic\Containers\Domain1.dev_ESBTest\wsType.xsd (The system cannot find the file specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(Unknown Source)
    at java.io.FileInputStream.<init>(Unknown Source)
    at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
    at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
    at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
    at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
    ... 54 more

[12/04/02 16:21:24] ID=dev_ESBTest (info) Actional instrumentation is disabled for this container
[12/04/02 16:21:24] ID=dev_ESBTest (info) Initializing Mitigation context factory class: com.sonicsw.xqimpl.actional.lg.visitor.StabilizerHelper
[12/04/02 16:21:24] (info) Loaded ID=dev_ESBTest
[12/04/02 16:21:24] ID=dev_ESBTest (warning) [ESBService] Cannot start service Create_and_ExposeWS due to initialization error.
[12/04/02 16:21:24] ID=dev_ESBTest (info) Container's ESB (JMS) Connection: jms_defaultConnection
[12/04/02 16:21:24] ID=dev_ESBTest (info) Container's HTTP Routing Connection: http_defaultConnection
[12/04/02 16:21:24] (info) ...startup complete

What could be the solution and What should I do?

Regards,

Dinesh

All Replies

Posted by wtam on 02-Apr-2012 11:11

Hi Dinesh,

Sonic Connect could not locate the wsType.xsd.   How does the WSDL import the wsType.xsd?  If it is done by a relative path to the WSDL, then you can add the wsType.xsd in your project relative to the WSDL.  Please make sure you do "upload all" to rebuild the CSAR file.

Thanks.

Posted by dnessapkota10 on 02-Apr-2012 22:53

Hi William,

I created both xsd and wsdl files within the WSDL folder inside resources. First xsd has been defined and using this xsd the input and output for the wsdl has been defined. As you mentioned "you can add the wsType.xsd in your project relative to the WSDL". I have no idea about how can I add the xsd relative to the WSDL. Can you please describe it in detail?

Regards,

Dinesh

Posted by wtam on 03-Apr-2012 10:50

Hi Dinesh,

It sound like your xsd is a relative path (to your WSDL) and you already have it in the right place in your project.

What I meant was whether the schemaLocation (schema import in your WSDL) is a reliative file pah or not?

E.g.  If you import looks like this, you can put your wsType.xsd in the same folder as the WSDL in your project.

     
                  namespace="..."/>
     

Anyways, I think you hit a known bug that has been fixed in 8.0.1 (Serivice Patch 1) and you need to upgrade.

The bug ID is SNC00075891 (Problem when WSDL has relative imports).

Thanks.

Posted by dnessapkota10 on 04-Apr-2012 07:02

Hi William,

Here is my Project. Please find the attachment and suggest me what I have to do?

Thank you,

Dinesh

Posted by wtam on 04-Apr-2012 09:18

Dinhesh, your project is fine.  You need to upgrade to Sonic 8.0.1 or newer.  Thanks.

Posted by wtam on 04-Apr-2012 09:20

If upgrade is not an option, you can inline the schema in your WSDL to work around the bug.  Thanks.

Posted by sfritz on 04-Apr-2012 09:21

I am currently out of the office. I'll read your mail when I'm back on the 10th of April 2012. Should you have any matters that need attention prior to my return please contact customer support:

http://web.progress.com/support/contact-support.html

Your eMail will not be forwarded.

Stefan Fritz

Progress Software

Posted by dnessapkota10 on 05-Apr-2012 00:59

Hi William,

I'm beginner to Sonic. How can I inline the schema in your WSDL to work around the bug.

Expect desired steps.

Thanks,

Dinesh

Posted by wtam on 05-Apr-2012 13:11

Inlining schema in WSDL has nothing to do with Sonic.  You just add your xsd content in the WSDL instead of importing it.  I attached an example.  I'd *strongly* recommend you to upgrade to at least service pack 1.  The current release is 8.5.1.  If you can upgrade to 8.5.1, that is much preferred.  Thanks.

Posted by dnessapkota10 on 06-Apr-2012 01:40

Hi William,

As you mentioned I'd inline the xsd in wsdl file. And expose web service, now the container is running fine. But the problem with the "XML" data generation using "WSDL" file. I have attached the project and the error.

What is the solution?

Thank you,

Dinesh

Posted by neha on 09-Apr-2012 02:33

We tried generating XML from the WSDL (using the attached project) and did not see any issue, with both 8.0 and 8.0.1.

Have you come across any exception in the error log, console? Also, we noted that OE is also being used. More details regarding your installation would be helpful.

Regards,

Neha

Posted by dnessapkota10 on 09-Apr-2012 04:06

Hi Neha,

But in my case there is still same problem appeared i.e while going to create xml using wsdl when i am selecting customerResponse then in xml there is no any xml tags exists. Which you can see in my attachement.

And in other, how OE related to sonic? And as you mentioned I can't understand installation details.

Thanks,

Dinesh

Posted by neha on 09-Apr-2012 04:41

We tried this scenario on Win XP (default JVM). So, just needed details like OS, Java. Have you integrated Sonic with OE? Any other products installed.

Have you updated your installation to 8.0.1 or using the 8.0. version still?

Posted by dnessapkota10 on 09-Apr-2012 06:18

Hi Neha,

Thanks for your concern. I have summerize the configuration as follows,

Operating System - Windows7 Ultimate SP 1

Default JVM -          Java 7 standard edition

Sonic version-        Sonic 8.0

OE integration-       yes

Thanking you,

Dinesh 

This thread is closed