web-dev-qa-db-fra.com

Unmarshalling Error: élément inattendu (uri: url, local: "objectname"). Les éléments attendus sont <{} objectname>

J'utilise jaxb2-marshaller pour générer des classes afin de communiquer avec un service Web. Les classes Java sont générées à l'aide de certains fichiers wsdl.

Tout va bien maintenant, mais lorsque j'essaie d'utiliser certaines des classes générées, j'ai cette erreur sans tache, même si j'utilise les classes ObjectFactory générées.

Une partie de la pile:

org.springframework.ws.soap.client.SoapFaultClientException: Unmarshalling Error: unexpected element (uri:"http://xxxxxxxxx", local:"customer"). Expected elements are <{}customer> 
    at org.springframework.ws.soap.client.core.SoapFaultMessageResolver.resolveFault(SoapFaultMessageResolver.Java:38)
    at org.springframework.ws.client.core.WebServiceTemplate.handleFault(WebServiceTemplate.Java:826)
    at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.Java:621)
    at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.Java:555)
    at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.Java:390)
    at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.Java:383)
    at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.Java:373)
    at einvoice.service.CustomerService.createCustomer(CustomerService.Java:40)
    at einvoice.controller.facturatie.FacturatieOverzichtController.handleRenderRequest(FacturatieOverzichtController.Java:36)
    at Sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

Et ma classe:

@Service
public class CustomerService {

    @Autowired
    private WebServiceTemplate customerDaoTemplate;

    private ObjectFactory customerObjectFactory;

    public CustomerService() {
        customerObjectFactory = new ObjectFactory();    
    }

    public boolean createCustomer(Customer c)
    {
        System.out.println("CREATING CUSTOMER");
        einvoice.proxy.customerdaoservice.Customer customer = customerObjectFactory.createCustomer();
        customer.setConnectionURL("test");
        customer.setUid("testuid");
        customer.setName("KorneelTest");

        Create create = customerObjectFactory.createCreate();
        create.setCustomer(customer);

        try
        {
            customerDaoTemplate.marshalSendAndReceive(customerObjectFactory.createCreate(create));
            return true;
        }
        catch(Exception ex)
        {
            ex.printStackTrace();
            return false;
        }
    }

C'est la méthode createCustomer () qui affiche cette erreur.

The generated ObjectFactory class:

//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 
// See <a href="http://Java.Sun.com/xml/jaxb">http://Java.Sun.com/xml/jaxb</a> 
// Any modifications to this file will be lost upon recompilation of the source schema. 
// Generated on: 2014.09.12 at 12:04:04 PM CEST 
//


package einvoice.proxy.customerdaoservice;

import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlElementDecl;
import javax.xml.bind.annotation.XmlRegistry;
import javax.xml.namespace.QName;


/**
 * This object contains factory methods for each 
 * Java content interface and Java element interface 
 * generated in the be.icredit.einvoice.proxy.customerdaoservice package. 
 * <p>An ObjectFactory allows you to programatically 
 * construct new instances of the Java representation 
 * for XML content. The Java representation of XML 
 * content can consist of schema derived interfaces 
 * and classes representing the binding of schema 
 * type definitions, element declarations and model 
 * groups.  Factory methods for each of these are 
 * provided in this class.
 * 
 */
@XmlRegistry
public class ObjectFactory {

    private final static QName _AbstractFilter_QNAME = new QName("http://xxxxxxx/", "abstractFilter");
    private final static QName _Customer_QNAME = new QName("http://xxxxxxx/", "customer");
    private final static QName _FindSingleResponse_QNAME = new QName("http://xxxxxxx/", "findSingleResponse");
    private final static QName _Create_QNAME = new QName("http://xxxxxxx/", "create");
    private final static QName _Find_QNAME = new QName("http://xxxxxxx/", "find");
    private final static QName _CreateResponse_QNAME = new QName("xxxxxxx/", "createResponse");
    private final static QName _FindResponse_QNAME = new QName("http://xxxxxxx/", "findResponse");
    private final static QName _UpdateResponse_QNAME = new QName("http://xxxxxxx/", "updateResponse");
    private final static QName _FindSingle_QNAME = new QName("http://xxxxxxx/", "findSingle");
    private final static QName _CustomerFilter_QNAME = new QName("http://xxxxxxx/", "customerFilter");
    private final static QName _Update_QNAME = new QName("http://xxxxxxx/", "update");
    private final static QName _AbstractEntity_QNAME = new QName("http://xxxxxxx/", "abstractEntity");

    /**
     * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: be.icredit.einvoice.proxy.customerdaoservice
     * 
     */
    public ObjectFactory() {
    }

    /**
     * Create an instance of {@link Update }
     * 
     */
    public Update createUpdate() {
        return new Update();
    }

    /**
     * Create an instance of {@link CustomerFilter }
     * 
     */
    public CustomerFilter createCustomerFilter() {
        return new CustomerFilter();
    }

    /**
     * Create an instance of {@link UpdateResponse }
     * 
     */
    public UpdateResponse createUpdateResponse() {
        return new UpdateResponse();
    }

    /**
     * Create an instance of {@link FindSingle }
     * 
     */
    public FindSingle createFindSingle() {
        return new FindSingle();
    }

    /**
     * Create an instance of {@link FindResponse }
     * 
     */
    public FindResponse createFindResponse() {
        return new FindResponse();
    }

    /**
     * Create an instance of {@link CreateResponse }
     * 
     */
    public CreateResponse createCreateResponse() {
        return new CreateResponse();
    }

    /**
     * Create an instance of {@link FindSingleResponse }
     * 
     */
    public FindSingleResponse createFindSingleResponse() {
        return new FindSingleResponse();
    }

    /**
     * Create an instance of {@link Customer }
     * 
     */
    public Customer createCustomer() {
        return new Customer();
    }

    /**
     * Create an instance of {@link Create }
     * 
     */
    public Create createCreate() {
        return new Create();
    }

    /**
     * Create an instance of {@link Find }
     * 
     */
    public Find createFind() {
        return new Find();
    }

    /**
     * Create an instance of {@link Pager }
     * 
     */
    public Pager createPager() {
        return new Pager();
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link AbstractFilter }{@code >}}
     * 
     */
    @XmlElementDecl(namespace = "http://xxxxxxx/", name = "abstractFilter")
    public JAXBElement<AbstractFilter> createAbstractFilter(AbstractFilter value) {
        return new JAXBElement<AbstractFilter>(_AbstractFilter_QNAME, AbstractFilter.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Customer }{@code >}}
     * 
     */
    @XmlElementDecl(namespace = "http://xxxxxxx/", name = "customer")
    public JAXBElement<Customer> createCustomer(Customer value) {
        return new JAXBElement<Customer>(_Customer_QNAME, Customer.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link FindSingleResponse }{@code >}}
     * 
     */
    @XmlElementDecl(namespace = "http://xxxxxxx/", name = "findSingleResponse")
    public JAXBElement<FindSingleResponse> createFindSingleResponse(FindSingleResponse value) {
        return new JAXBElement<FindSingleResponse>(_FindSingleResponse_QNAME, FindSingleResponse.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Create }{@code >}}
     * 
     */
    @XmlElementDecl(namespace = "http://xxxxxxx/", name = "create")
    public JAXBElement<Create> createCreate(Create value) {
        return new JAXBElement<Create>(_Create_QNAME, Create.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Find }{@code >}}
     * 
     */
    @XmlElementDecl(namespace = "http://xxxxxxx/", name = "find")
    public JAXBElement<Find> createFind(Find value) {
        return new JAXBElement<Find>(_Find_QNAME, Find.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link CreateResponse }{@code >}}
     * 
     */
    @XmlElementDecl(namespace = "http://xxxxxxx/", name = "createResponse")
    public JAXBElement<CreateResponse> createCreateResponse(CreateResponse value) {
        return new JAXBElement<CreateResponse>(_CreateResponse_QNAME, CreateResponse.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link FindResponse }{@code >}}
     * 
     */
    @XmlElementDecl(namespace = "http://xxxxxxx/", name = "findResponse")
    public JAXBElement<FindResponse> createFindResponse(FindResponse value) {
        return new JAXBElement<FindResponse>(_FindResponse_QNAME, FindResponse.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link UpdateResponse }{@code >}}
     * 
     */
    @XmlElementDecl(namespace = "http://xxxxxxx/", name = "updateResponse")
    public JAXBElement<UpdateResponse> createUpdateResponse(UpdateResponse value) {
        return new JAXBElement<UpdateResponse>(_UpdateResponse_QNAME, UpdateResponse.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link FindSingle }{@code >}}
     * 
     */
    @XmlElementDecl(namespace = "http://xxxxxxx/", name = "findSingle")
    public JAXBElement<FindSingle> createFindSingle(FindSingle value) {
        return new JAXBElement<FindSingle>(_FindSingle_QNAME, FindSingle.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link CustomerFilter }{@code >}}
     * 
     */
    @XmlElementDecl(namespace = "http://xxxxxxx/", name = "customerFilter")
    public JAXBElement<CustomerFilter> createCustomerFilter(CustomerFilter value) {
        return new JAXBElement<CustomerFilter>(_CustomerFilter_QNAME, CustomerFilter.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Update }{@code >}}
     * 
     */
    @XmlElementDecl(namespace = "http://xxxxxxx/", name = "update")
    public JAXBElement<Update> createUpdate(Update value) {
        return new JAXBElement<Update>(_Update_QNAME, Update.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link AbstractEntity }{@code >}}
     * 
     */
    @XmlElementDecl(namespace = "http://xxxxxxx/", name = "abstractEntity")
    public JAXBElement<AbstractEntity> createAbstractEntity(AbstractEntity value) {
        return new JAXBElement<AbstractEntity>(_AbstractEntity_QNAME, AbstractEntity.class, null, value);
    }

}

La classe package-info.Java:

//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 
// See <a href="http://Java.Sun.com/xml/jaxb">http://Java.Sun.com/xml/jaxb</a> 
// Any modifications to this file will be lost upon recompilation of the source schema. 
// Generated on: 2014.09.12 at 03:44:51 PM CEST 
//

@javax.xml.bind.annotation.XmlSchema(namespace = "http://xxxxxxx/")
package einvoice.proxy.customerdaoservice;
6
Kornelito Benito
  • Soit votre schéma d'origine n'a pas le bon espace de noms cible.
  • Ou vous manquez en quelque sorte le package-info.Java

Veuillez poster votre ObjectFactory et package-info.Java (doit être généré à côté de la ObjectFactory).

En fait, vous n'avez pas besoin de créer vos instances via ObjectFactory, les constructions normales new fonctionnent correctement. :) ObjectFactory ne fait pas de magie. Il est principalement utilisé par JAXB lors de la décompression.

ps. Veuillez étiqueter les questions liées à maven-jaxb2-plugin- avec l’étiquette maven-jaxb2-plugin - cela attirera mon attention plus rapidement.

6
lexicore

Veuillez utiliser l'annotation suivante 

@XmlRootElement(name="Customer")

à la racine de la classe, comme indiqué ci-dessous. JAXb ne créant pas automatiquement d'annotation @XmlRootElement, vous devez placer cette annotation manuellement en haut de la classe.

 The generated ObjectFactory class:
This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 
// See <a href="http://Java.Sun.com/xml/jaxb">http://Java.Sun.com/xml/jaxb</a> 
// Any modifications to this file will be lost upon recompilation of the source schema. 
// Generated on: 2014.09.12 at 12:04:04 PM CEST 
//


package einvoice.proxy.customerdaoservice;

import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlElementDecl;
import javax.xml.bind.annotation.XmlRegistry;
import javax.xml.namespace.QName;


/**
 * This object contains factory methods for each 
 * Java content interface and Java element interface 
 * generated in the be.icredit.einvoice.proxy.customerdaoservice package. 
 * <p>An ObjectFactory allows you to programatically 
 * construct new instances of the Java representation 
 * for XML content. The Java representation of XML 
 * content can consist of schema derived interfaces 
 * and classes representing the binding of schema 
 * type definitions, element declarations and model 
 * groups.  Factory methods for each of these are 
 * provided in this class.
 * 
 */
@XmlRootElement(name="Customer")
@XmlRegistry
public class ObjectFactory {

    private final static QName _AbstractFilter_QNAME = new QName("http://xxxxxxx/", "abstractFilter");
    private final static QName _Customer_QNAME = new QName("http://xxxxxxx/", "customer");
    private final static QName _FindSingleResponse_QNAME = new QName("http://xxxxxxx/", "findSingleResponse");
    private final static QName _Create_QNAME = new QName("http://xxxxxxx/", "create");
    private final static QName _Find_QNAME = new QName("http://xxxxxxx/", "find");
    private final static QName _CreateResponse_QNAME = new QName("xxxxxxx/", "createResponse");
    private final static QName _FindResponse_QNAME = new QName("http://xxxxxxx/", "findResponse");
    private final static QName _UpdateResponse_QNAME = new QName("http://xxxxxxx/", "updateResponse");
    private final static QName _FindSingle_QNAME = new QName("http://xxxxxxx/", "findSingle");
    private final static QName _CustomerFilter_QNAME = new QName("http://xxxxxxx/", "customerFilter");
    private final static QName _Update_QNAME = new QName("http://xxxxxxx/", "update");
    private final static QName _AbstractEntity_QNAME = new QName("http://xxxxxxx/", "abstractEntity");

/**
 * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: be.icredit.einvoice.proxy.customerdaoservice
 * 
 */
public ObjectFactory() {
}

/**
 * Create an instance of {@link Update }
 * 
 */
public Update createUpdate() {
    return new Update();
}

/**
 * Create an instance of {@link CustomerFilter }
 * 
 */
public CustomerFilter createCustomerFilter() {
    return new CustomerFilter();
}

/**
 * Create an instance of {@link UpdateResponse }
 * 
 */
public UpdateResponse createUpdateResponse() {
    return new UpdateResponse();
}

/**
 * Create an instance of {@link FindSingle }
 * 
 */
public FindSingle createFindSingle() {
    return new FindSingle();
}

/**
 * Create an instance of {@link FindResponse }
 * 
 */
public FindResponse createFindResponse() {
    return new FindResponse();
}

/**
 * Create an instance of {@link CreateResponse }
 * 
 */
public CreateResponse createCreateResponse() {
    return new CreateResponse();
}

/**
 * Create an instance of {@link FindSingleResponse }
 * 
 */
public FindSingleResponse createFindSingleResponse() {
    return new FindSingleResponse();
}

/**
 * Create an instance of {@link Customer }
 * 
 */
public Customer createCustomer() {
    return new Customer();
}

/**
 * Create an instance of {@link Create }
 * 
 */
public Create createCreate() {
    return new Create();
}

/**
 * Create an instance of {@link Find }
 * 
 */
public Find createFind() {
    return new Find();
}

/**
 * Create an instance of {@link Pager }
 * 
 */
public Pager createPager() {
    return new Pager();
}

/**
 * Create an instance of {@link JAXBElement }{@code <}{@link AbstractFilter }{@code >}}
 * 
 */
@XmlElementDecl(namespace = "http://xxxxxxx/", name = "abstractFilter")
public JAXBElement<AbstractFilter> createAbstractFilter(AbstractFilter value) {
    return new JAXBElement<AbstractFilter>(_AbstractFilter_QNAME, AbstractFilter.class, null, value);
}

/**
 * Create an instance of {@link JAXBElement }{@code <}{@link Customer }{@code >}}
 * 
 */
@XmlElementDecl(namespace = "http://xxxxxxx/", name = "customer")
public JAXBElement<Customer> createCustomer(Customer value) {
    return new JAXBElement<Customer>(_Customer_QNAME, Customer.class, null, value);
}

/**
 * Create an instance of {@link JAXBElement }{@code <}{@link FindSingleResponse }{@code >}}
 * 
 */
@XmlElementDecl(namespace = "http://xxxxxxx/", name = "findSingleResponse")
public JAXBElement<FindSingleResponse> createFindSingleResponse(FindSingleResponse value) {
    return new JAXBElement<FindSingleResponse>(_FindSingleResponse_QNAME, FindSingleResponse.class, null, value);
}

/**
 * Create an instance of {@link JAXBElement }{@code <}{@link Create }{@code >}}
 * 
 */
@XmlElementDecl(namespace = "http://xxxxxxx/", name = "create")
public JAXBElement<Create> createCreate(Create value) {
    return new JAXBElement<Create>(_Create_QNAME, Create.class, null, value);
}

/**
 * Create an instance of {@link JAXBElement }{@code <}{@link Find }{@code >}}
 * 
 */
@XmlElementDecl(namespace = "http://xxxxxxx/", name = "find")
public JAXBElement<Find> createFind(Find value) {
    return new JAXBElement<Find>(_Find_QNAME, Find.class, null, value);
}

/**
 * Create an instance of {@link JAXBElement }{@code <}{@link CreateResponse }{@code >}}
 * 
 */
@XmlElementDecl(namespace = "http://xxxxxxx/", name = "createResponse")
public JAXBElement<CreateResponse> createCreateResponse(CreateResponse value) {
    return new JAXBElement<CreateResponse>(_CreateResponse_QNAME, CreateResponse.class, null, value);
}

/**
 * Create an instance of {@link JAXBElement }{@code <}{@link FindResponse }{@code >}}
 * 
 */
@XmlElementDecl(namespace = "http://xxxxxxx/", name = "findResponse")
public JAXBElement<FindResponse> createFindResponse(FindResponse value) {
    return new JAXBElement<FindResponse>(_FindResponse_QNAME, FindResponse.class, null, value);
}

/**
 * Create an instance of {@link JAXBElement }{@code <}{@link UpdateResponse }{@code >}}
 * 
 */
@XmlElementDecl(namespace = "http://xxxxxxx/", name = "updateResponse")
public JAXBElement<UpdateResponse> createUpdateResponse(UpdateResponse value) {
    return new JAXBElement<UpdateResponse>(_UpdateResponse_QNAME, UpdateResponse.class, null, value);
}

/**
 * Create an instance of {@link JAXBElement }{@code <}{@link FindSingle }{@code >}}
 * 
 */
@XmlElementDecl(namespace = "http://xxxxxxx/", name = "findSingle")
public JAXBElement<FindSingle> createFindSingle(FindSingle value) {
    return new JAXBElement<FindSingle>(_FindSingle_QNAME, FindSingle.class, null, value);
}

/**
 * Create an instance of {@link JAXBElement }{@code <}{@link CustomerFilter }{@code >}}
 * 
 */
@XmlElementDecl(namespace = "http://xxxxxxx/", name = "customerFilter")
public JAXBElement<CustomerFilter> createCustomerFilter(CustomerFilter value) {
    return new JAXBElement<CustomerFilter>(_CustomerFilter_QNAME, CustomerFilter.class, null, value);
}

/**
 * Create an instance of {@link JAXBElement }{@code <}{@link Update }{@code >}}
 * 
 */
@XmlElementDecl(namespace = "http://xxxxxxx/", name = "update")
public JAXBElement<Update> createUpdate(Update value) {
    return new JAXBElement<Update>(_Update_QNAME, Update.class, null, value);
}

/**
 * Create an instance of {@link JAXBElement }{@code <}{@link AbstractEntity }{@code >}}
 * 
 */
@XmlElementDecl(namespace = "http://xxxxxxx/", name = "abstractEntity")
public JAXBElement<AbstractEntity> createAbstractEntity(AbstractEntity value) {
    return new JAXBElement<AbstractEntity>(_AbstractEntity_QNAME, AbstractEntity.class, null, value);
}

}

1
Jithin Kunjachan

Si vous avez plus d'un module dans votre projet, vérifiez s'il existe des noms de classe ou de répertoire en double.

J'avais la même erreur et j'ai pu la résoudre en changeant les noms de paquet dans mon projet.

J'ai eu deux modules dans mon projet avec des structures de répertoires identiques module/src/main/Java/com/example/directory/path

Nous avions deux points de terminaison différents et 2 WSDL différents, mais les deux appartenaient au même client. Lorsque nous avons généré automatiquement les classes POJO à partir des WSDL, il a créé la structure de fichier pour nous. J'ai remarqué que l'espace de nom généré dans le XML utilisait le même espace de nom pour XML généré dans les deux modules, alors qu'ils étaient supposés être différents (d'où le stacktrace).

Tout ce que j'ai fait pour résoudre le problème a été de changer les noms de répertoire pour qu'ils soient plus spécifiques pour chaque module.

1
J Mullen

Je pense avoir trouvé le problème. 

J'utilisais la version 0.9.0 du plugin maven-jaxb2. Cette version m'a donné cette étrange exception! Je suis revenu à la version 0.8.3 de maven-jaxbe2-plugin, cette version génère une erreur 404:

08:56:45,212 ERROR [DispatcherPortlet:572] Could not complete request
org.springframework.ws.client.WebServiceTransportException: Not Found [404]
    at org.springframework.ws.client.core.WebServiceTemplate.handleError(WebServiceTemplate.Java:695)
    at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.Java:606)
    at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.Java:555)
    at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.Java:390)
    at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.Java:383)
    at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.Java:373)
    at be.icredit.einvoice.service.CustomerService.createCustomer(CustomerService.Java:43)
    at be.icredit.einvoice.controller.facturatie.FacturatieOverzichtController.handleRenderRequest(FacturatieOverzichtController.Java:36)
0
Kornelito Benito

Cette trace est générée car les noms des messages de requête et de réponse ne sont pas identiques dans les classes WSDL et de Java:

Message de réponse:

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "acceptMessageResponse", propOrder = {
    "acceptMessageReturn"
})
public class AcceptMessageResponse {

    @XmlElement(required = true)
    protected String acceptMessageReturn;

    public String getAcceptMessageReturn() {
        return acceptMessageReturn;
    }
    public void setAcceptMessageReturn(String value) {
        this.acceptMessageReturn = value;
    }
}

Accepter le message:

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "acceptMessage", propOrder = {
    "in0"
})
public class AcceptMessage {

    @XmlElement(required = true)
    protected String in0;

    public String getIn0() {
        return in0;
    }
    public void setIn0(String value) {
        this.in0 = value;
    }
}

Dans cet exemple, le WSDL doit définir: 1.

<?xml version='1.0' encoding='UTF-8'?>
<wsdl:definitions name="PORX_IN02016001SACYL"
    targetNamespace="http://components.mule.server.mirth.webreach.com"
    xmlns:ns1="http://cxf.Apache.org/bindings/xformat" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:tns="http://components.mule.server.mirth.webreach.com"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <wsdl:types>
        <xs:schema elementFormDefault="qualified"
            targetNamespace="http://components.mule.server.mirth.webreach.com"
            version="1.0" xmlns:tns="http://components.mule.server.mirth.webreach.com"
            xmlns:xs="http://www.w3.org/2001/XMLSchema">
            <xs:element name="acceptMessage">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element form="unqualified" name="in0" type="xs:string" />
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="acceptMessageResponse" nillable="true"
                type="xs:anyType" />
            <xs:complexType name="acceptMessageResponse">
                <xs:sequence />
            </xs:complexType>
        </xs:schema>
    </wsdl:types>
    <wsdl:message name="acceptMessage">
        <wsdl:part element="tns:acceptMessage" name="parameters">
        </wsdl:part>
    </wsdl:message>
    <wsdl:message name="acceptMessageResponse">
        <wsdl:part element="tns:acceptMessageResponse" name="parameters">
        </wsdl:part>
    </wsdl:message>
    <wsdl:portType name="PORX_IN02016001SACYL">
        <wsdl:operation name="acceptMessage">
            <wsdl:input message="tns:acceptMessage" name="acceptMessage">
            </wsdl:input>
            <wsdl:output message="tns:acceptMessageResponse" name="acceptMessageResponse">
            </wsdl:output>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="PORX_IN02016001SACYLSoapBinding" type="tns:PORX_IN02016001SACYL">
        <soap:binding style="document"
            transport="http://schemas.xmlsoap.org/soap/http" />
        <wsdl:operation name="acceptMessage">
            <soap:operation soapAction="" style="document" />
            <wsdl:input name="acceptMessage">
                <soap:body use="literal" />
            </wsdl:input>
            <wsdl:output name="acceptMessageResponse">
                <soap:body use="literal" />
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="PORX_IN02016001SACYL">
        <wsdl:port binding="tns:PORX_IN02016001SACYLSoapBinding"
            name="PORX_IN02016001SACYL">
            <soap:address
                location="http://localhost:8080/vere/services/PORX_IN02016001SACYL" />
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>
0
user3738027