Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Using xmlBeans

  1. #1

    Default Problems using xmlBeans

    Has anyone got a good example of this. I have a webservice that extended the AbstractDomPayloadEndpoint, this works just lovely, but I want to take away the code for recieving and responding, and replace it with xmlBean mapping. I thought this would be as simple as changing my endpoint to extend the AbstractMarchallingPayloadEndpoint, setting up the xmlBean marshaller and unmarshaller in the spring config, and then wiring them to my endpoint. unfortunately I get the following message:

    java.lang.IllegalStateException: No adapter for endpoint [uk.org.rspca.ws.cms.TaxonomyEndpoint@165b7e]: Does your endpoint implement a supported interface like MessageHandler or PayloadEndpoint?

    little confused at this point, do I need to write an adapter for this approach to work?

    Any help would be apprieciated...
    Last edited by ma_crice; Jun 20th, 2008 at 05:12 AM. Reason: title may have been a little miss-leading
    ~ mARK aNDREWS ~

  2. #2
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    It should be as simple as extending AbstractMarchallingPayloadEndpoint, so I have no idea what is going wrong. Can you post the code of your endpoint class?
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  3. #3

    Default Code Requested

    Hi Arjen,

    Thanx for the reply. I have recently taken part in A Spring Web Service Taining course run by Russ Miles, which was really worth while, but didn't cover this specific topic. Your help is much apprieciated.

    taxonomy-servlet-config:
    Code:
    <?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:tx="http://www.springframework.org/schema/tx"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans
    							http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
    
    	<bean
    		class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping">
    		<property name="defaultEndpoint" ref="taxonomyEndpoint" />
    	</bean>
    
    	<bean id="animalTaxonomy"
    		class="org.springframework.ws.wsdl.wsdl11.DynamicWsdl11Definition">
    		<property name="builder">
    			<bean
    				class="org.springframework.ws.wsdl.wsdl11.builder.XsdBasedSoap11Wsdl4jDefinitionBuilder">
    				<property name="schema"
    					value="/WEB-INF/schemas/taxonomy-service.xsd" />
    				<property name="portTypeName" value="Taxonomy" />
    				<property name="locationUri"
    					value="http://localhost:8080/ContentService/taxonomy" />
    			</bean>
    		</property>
    	</bean>
    	<bean id="taxonomyEndpoint"
    		class="uk.org.rspca.ws.cms.TaxonomyEndpoint">
    		<constructor-arg ref="taxonomy" />
    		<property name="marshaller"><ref bean="xmlbeansMarshaller"/></property>
    		<property name="unmarshaller"><ref bean="xmlbeansMarshaller"/></property>
    	</bean>
    	<bean id="xmlbeansMarshaller"
    		class="org.springframework.oxm.xmlbeans.XmlBeansMarshaller" />
    	<bean		class="org.springframework.ws.server.endpoint.adapter.MarshallingMethodEndpointAdapter">
    		<property name="marshaller" ref="xmlbeansMarshaller" />
    		<property name="unmarshaller" ref="xmlbeansMarshaller" />
    	</bean>
    </beans>

    TaxonomyEndpoint.java
    Code:
    package uk.org.rspca.ws.cms;
    
    import java.util.Iterator;
    
    
    import org.springframework.util.xml.DomUtils;
    import org.springframework.ws.server.endpoint.AbstractDomPayloadEndpoint;
    import org.springframework.ws.server.endpoint.AbstractMarshallingPayloadEndpoint;
    import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    
    import uk.org.rspca.cms.Taxonomy;
    import uk.org.rspca.cms.TaxonomyEngine;
    import uk.org.rspca.schemas.type.taxonomy.AnimalTaxonomyRequestDocument;
    import uk.org.rspca.schemas.type.taxonomy.AnimalTaxonomyResponseDocument;
    import uk.org.rspca.schemas.type.taxonomy.TaxonomyType;
    import uk.org.rspca.schemas.type.taxonomy.AnimalTaxonomyRequestDocument.AnimalTaxonomyRequest;
    import uk.org.rspca.schemas.type.taxonomy.AnimalTaxonomyResponseDocument.AnimalTaxonomyResponse;
    import uk.org.rspca.schemas.type.taxonomy.impl.AnimalTaxonomyRequestDocumentImpl;
    import uk.org.rspca.schemas.type.taxonomy.impl.AnimalTaxonomyResponseDocumentImpl;
    import uk.org.rspca.schemas.type.taxonomy.impl.AnimalTaxonomyResponseDocumentImpl.AnimalTaxonomyResponseImpl;
    
    public class TaxonomyEndpoint extends AbstractMarshallingPayloadEndpoint  {
    
    	private TaxonomyEngine taxonomyEngine;
    
    	private static final String NAMESPACE_URI = "http://www.rspca.org.uk/schemas/type/taxonomy";
    	
    	public TaxonomyEndpoint() {
    		// TODO Auto-generated constructor stub
    	}
    	
    	public TaxonomyEndpoint(TaxonomyEngine tEngine) {
    		this.taxonomyEngine = tEngine;
    	}
    
    	@Override
    	protected Object invokeInternal(Object request) throws Exception {
    		AnimalTaxonomyRequestDocument doc = (AnimalTaxonomyRequestDocument)request;
    		System.out.println(doc.getAnimalTaxonomyRequest().getFilter());
    		// Process Data based on filter
    		// Populate AnimalTaxonomyResponseObject
    		
    		return AnimalTaxonomyResponseDocument.Factory.newInstance();
    	}
    Thanx

    mARK
    Last edited by ma_crice; Jun 20th, 2008 at 08:12 AM. Reason: copied wrong piece of code
    ~ mARK aNDREWS ~

  4. #4
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    I don't see anything wrong with the code you posted. Could you also post the log contents at DEBUG level, including startup messages? That shows me what endpoints are supported and which aren't.
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  5. #5

    Default Log file contents

    Environment:

    OS: Windows XP sp2
    App Server: Tomcat 6

    Included jars:
    Code:
    C:\wrkspc\cms\repository\spring\spring-ws\1.5.2\spring-oxm-1.5.2.jar
    C:\wrkspc\cms\repository\spring\spring-ws\1.5.2\spring-oxm-tiger-1.5.2.jar
    C:\wrkspc\cms\repository\spring\spring-ws\1.5.2\spring-ws-core-1.5.2.jar
    C:\wrkspc\cms\repository\spring\spring-ws\1.5.2\spring-ws-core-tiger-1.5.2.jar
    C:\wrkspc\cms\repository\spring\spring-ws\1.5.2\spring-ws-security-1.5.2.jar
    C:\wrkspc\cms\repository\spring\spring-ws\1.5.2\spring-ws-support-1.5.2.jar
    C:\wrkspc\cms\repository\spring\spring-ws\1.5.2\spring-xml-1.5.2.jar
    C:\wrkspc\cms\repository\log4j\log4j-1.2.13.jar
    C:\wrkspc\cms\repository\xml\JAXB2\activation.jar
    C:\wrkspc\cms\repository\xml\JAXB2\jaxb1-impl.jar
    C:\wrkspc\cms\repository\xml\JAXB2\jaxb-api.jar
    C:\wrkspc\cms\repository\xml\JAXB2\jaxb-impl.jar
    C:\wrkspc\cms\repository\xml\JAXB2\jaxb-xjc.jar
    C:\wrkspc\cms\repository\xml\JAXB2\jsr173_1.0_api.jar
    C:\wrkspc\cms\repository\apache-commons\logging\commons-logging-1.1.1.jar
    C:\wrkspc\cms\repository\wsdl\wsdl4j-1.6.1.jar
    C:\wrkspc\cms\repository\saaj\saaj-api-1.3.jar
    C:\wrkspc\cms\repository\saaj\saaj-impl-1.3.jar
    C:\wrkspc\cms\repository\spring\beans\org.springframework.beans-2.5.4.A.jar
    C:\wrkspc\cms\repository\spring\core\org.springframework.core-2.5.4.A.jar
    C:\wrkspc\cms\repository\spring\web\org.springframework.web-2.5.4.A.jar
    C:\wrkspc\cms\repository\spring\Context\org.springframework.context-2.5.4.A.jar
    C:\wrkspc\cms\repository\spring\servlet\org.springframework.web.servlet-2.5.4.A.jar
    C:\wrkspc\cms\repository\xml\xmlBeans\xbean.jar
    Last but not least.... the log file contents with root log level set to DEBUG is atatched.

    Note: the logging output is the result of a WSDL discovery, and a call to the animalTaxonomy Service.
    Attached Files Attached Files
    ~ mARK aNDREWS ~

  6. #6

    Default Still no joy

    Any update for me Arjen
    ~ mARK aNDREWS ~

  7. #7
    Join Date
    Jun 2008
    Posts
    6

    Default Possible misnamed bean in config XML?

    Should reference 'ref=taxonomy' in your spring config file be 'ref=animalTaxonomy' ?

  8. #8

    Default Thanx for the offer of help...

    What I have is correct. There is a spring config file which sets up service objects that was not included in what I posted.

    Thanx for at least replying though - I still haven't had much luck with this! Have yuo used the xmlBean marshalling?
    ~ mARK aNDREWS ~

  9. #9
    Join Date
    Jun 2008
    Posts
    6

    Default

    Yup - I use XmlBeans - It worked for me pretty much out of the box....

    I don't see any obvious issues with your configuration either

    -Oliver

  10. #10

    Default Can I borrow it?

    I don't supose you have that example handy, and that I could have a look and compare it to mine? Would be really useful...
    ~ mARK aNDREWS ~

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •