Search Results

Search found 252 results on 11 pages for 'jaxb'.

Page 11/11 | < Previous Page | 7 8 9 10 11 

  • Exception while exposing a bean in webservice using spring mvc

    - by Ajay
    Hi, I am using Spring 3.0.5.Release MVC for exposing a webservice and below is my servlet.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> <!-- To enable @RequestMapping process on type level and method level --> <context:component-scan base-package="com.pyramid.qls.progressReporter.service" /> <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping" /> <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"> <property name="messageConverters"> <list> <ref bean="marshallingConverter" /> <ref bean="atomConverter" /> <ref bean="jsonConverter" /> </list> </property> </bean> <bean id="marshallingConverter" class="org.springframework.http.converter.xml.MarshallingHttpMessageConverter"> <constructor-arg ref="jaxbMarshaller" /> <property name="supportedMediaTypes" value="application/xml"/> </bean> <bean id="atomConverter" class="org.springframework.http.converter.feed.AtomFeedHttpMessageConverter"> <property name="supportedMediaTypes" value="application/atom+xml" /> </bean> <bean id="jsonConverter" class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter"> <property name="supportedMediaTypes" value="application/json" /> </bean> <!-- Client --> <bean id="restTemplate" class="org.springframework.web.client.RestTemplate"> <property name="messageConverters"> <list> <ref bean="marshallingConverter" /> <ref bean="atomConverter" /> <ref bean="jsonConverter" /> </list> </property> </bean> <bean id="jaxbMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller"> <property name="classesToBeBound"> <list> <value>com.pyramid.qls.progressReporter.impl.BatchProgressMetricsImpl</value> <value>com.pyramid.qls.progressReporter.datatype.InstrumentStats</value> <value>com.pyramid.qls.progressReporter.datatype.InstrumentInfo</value> <value>com.pyramid.qls.progressReporter.datatype.LoadOnConsumer</value> <value>com.pyramid.qls.progressReporter.datatype.HighLevelTaskStats</value> <value>com.pyramid.qls.progressReporter.datatype.SessionStats</value> <value>com.pyramid.qls.progressReporter.datatype.TaskStats</value> <value>com.pyramid.qls.progressReporter.datatype.ComputeStats</value> <value>com.pyramid.qls.progressReporter.datatype.DetailedInstrumentStats</value> <value>com.pyramid.qls.progressReporter.datatype.ImntHistoricalStats</value> </list> </property> </bean> <bean id="QPRXmlView" class="org.springframework.web.servlet.view.xml.MarshallingView"> <constructor-arg ref="jaxbMarshaller" /> </bean> <bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver"> <property name="mediaTypes"> <map> <entry key="xml" value="application/xml"/> <entry key="html" value="text/html"/> </map> </property> <property name="viewResolvers"> <list> <bean class="org.springframework.web.servlet.view.BeanNameViewResolver"/> <bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver"> <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/> <property name="prefix" value="/WEB-INF/jsp/"/> <property name="suffix" value=".jsp"/> </bean> </list> </property> </bean> <bean id="QPRController" class="com.pyramid.qls.progressReporter.service.QPRController"> <property name="jaxb2Mashaller" ref="jaxbMarshaller" /> </bean> </beans> Following is what i am doing in controller (QPRController) @RequestMapping(value = "/clientMetrics/{clientId}", method = RequestMethod.GET) public ModelAndView getBatchProgressMetrics(@PathVariable String clientId) { List<BatchProgressMetrics> batchProgressMetricsList = null; batchProgressMetricsList = batchProgressReporter.getBatchProgressMetricsForClient(clientId); ModelAndView mav = new ModelAndView("QPRXmlView", BindingResult.MODEL_KEY_PREFIX + "batchProgressMetrics", batchProgressMetricsList); return mav; } And i get the following: SEVERE: Servlet.service() for servlet rest threw exception javax.servlet.ServletException: Unable to locate object to be marshalled in model: {org.springframework.validation.BindingResult.batchProgressMetrics= Note that BatchProgressMetrics is an interface so my MAV is returning list of BatchProgressMetrics objects and i have entry for its impl in classes to be bound in servlet.xml. Can you please help me as to what i am doing wrong. And yes if i send just batchProgressMetricsList.get(0) in MAV it just works fine.

    Read the article

  • Need help with writing from XML to a SQL Server database (detailed)

    - by fogedi
    I'm a bit of a newbie with XML and WebServices and stuff like that. I'm working on a project using GlassFish OpenESB to schedule a process to get some information from a webservice and then store in a database. The criteria is basically that i have to use GlassFish OpenESB or EJB modules where i can expose webservices or something along those lines, AND i have to use SQL Server 2005. So far I've been able to talk to the webservice: and receive something along those lines <?xml version="1.0" encoding="UTF-8" standalone="no"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.xmlsoap.org/soap/envelope/ http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <m:entrypoint_getSettlementsOperationResponse xmlns:m="http://j2ee.netbeans.org/wsdl/BorgunTestBPEL/entrypoint_getSettlements"> <part1> <GetSettlementsByMerchantResponse xmlns="http://Borgun.Services.Gateway/2010/04/Settlement"> <GetSettlementsByMerchantResult xmlns:a="http://schemas.datacontract.org/2004/07/Borgun.Library.Common" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:msgns="http://Borgun.Services.Gateway/2010/04/Settlement" xmlns:ns0="http://j2ee.netbeans.org/wsdl/BorgunTestBPEL/entrypoint_getSettlements"> <a:CreditCardSettlement> <a:amexAmount>XXX</a:amexAmount> <a:amount>XXXX</a:amount> <a:batches> <a:CreditCardBatch> <a:batchdate>xxx</a:batchdate> <a:batchnumber>XXXX</a:batchnumber> <a:currencyCode>xxxx</a:currencyCode> <a:merchantnumber>xxxx</a:merchantnumber> <a:settlementRunNumber>xx4</a:settlementRunNumber> <a:settlementdate>2010-04-06T00:00:00</a:settlementdate> <a:slips>2</a:slips> <a:sum>xxxx</a:sum> </a:CreditCardBatch> <a:CreditCardBatch> <a:batchdate>xxx</a:batchdate> <a:batchnumber>xxxxx</a:batchnumber> <a:currencyCode>xxxx</a:currencyCode> <a:merchantnumber>xxxx</a:merchantnumber> <a:settlementRunNumber>xxxx</a:settlementRunNumber> <a:settlementdate>xxxx</a:settlementdate> <a:slips>x</a:slips> <a:sum>xxx</a:sum> </a:CreditCardBatch> </a:batches> <a:commission>xx</a:commission> <a:currencyCode>xxx</a:currencyCode> <a:deduction>-xxx</a:deduction> <a:deductionItems> <a:CrediCardSettlementDeduction> <a:amount>-xxx</a:amount> <a:code>VIÐSKF</a:code> <a:currencyCode>ISK</a:currencyCode> <a:merchantnumber>xxx</a:merchantnumber> <a:settlementrunnumber>xxx</a:settlementrunnumber> <a:text>Afsláttur v/ekorta</a:text> </a:CrediCardSettlementDeduction> <a:CrediCardSettlementDeduction> <a:amount>-335.00</a:amount> <a:code>ÁLAGKREK</a:code> <a:currencyCode>ISK</a:currencyCode> <a:merchantnumber>xxx</a:merchantnumber> <a:settlementrunnumber>xxx</a:settlementrunnumber> <a:text>xxx</a:text> </a:CrediCardSettlementDeduction> </a:deductionItems> </a:CreditCardSettlement> </GetSettlementsByMerchantResult> </GetSettlementsByMerchantResponse> </part1> </m:entrypoint_getSettlementsOperationResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope> I have access to the SQL Server 2005 server which is remote and i know i can insert into it but given that now i have a one-to-many relationship i want to be able to rollback if something fails. So in short how can I insert from this XML into the DB preferably without manually walking through the XML tree? I'm pretty sure I'm supposed to be able to use Entity and Session Beans or maybe JAXB bindings but I'm simply not being successful. One of the reasons might have something to do with the fact that the soap response contains an array of CreditCardSettlements and each of which contains an array of Batches and DeductionItems It would be best if someone can help me do this via a BPEL in GlassFish OpenESB but any hint at a java solution is much appreciated.

    Read the article

< Previous Page | 7 8 9 10 11