J'ai un problème pour appeler un service Web de Mule en utilisant Axis. J'ai créé un exemple assez simple où j'ai du xml dans un fichier lu par Mule, il est ensuite transformé en document et envoyé au webservice. Le code correspondant dans la configuration mule ressemble à ceci:Je ne parviens pas à transformer xml en SOAP
<inbound>
<file:inbound-endpoint path="./files/initial" transformer-refs="FileToString xmlToDom" connector-ref="fileConnector" />
</inbound>
<outbound>
<pass-through-router>
<axis:outbound-endpoint address="http://localhost:8081/holidayService?method=echoXXXX" synchronous="true" style="DOCUMENT" use="LITERAL" />
</pass-through-router>
</outbound>
Cependant, l'appel à la webservice échoue la configuration ci-dessus génère un message SOAP avec une balise <value0>
juste après la balise et le ferme juste avant la balise. Le message SOAP généré ressemble à ceci:
POST /holidayService?method=echoXXXX HTTP/1.1
Content-Type: text/xml
X-MULE_ENDPOINT: http://localhost:8081/holidayService?method=echoXXXX
SOAPAction: http://localhost:8081/holidayService?method=echoXXXX
directory: D:\bea\weblogic92\samples\domains\wl_server\files\processed
filename: HolidayRequest.xml
method: echoXXXX
originalFilename: HolidayRequest.xml
style: document
use: literal
User-Agent: Jakarta Commons-HttpClient/3.1
Host: 127.0.0.1:8081
Content-Length: 1183
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<mule:header soapenv:actor="http://www.muleumo.org/providers/soap/1.0" soapenv:mustUnderstand="0" xmlns:mule="http://www.muleumo.org/providers/soap/1.0">
<mule:MULE_CORRELATION_ID>D:\bea\weblogic92\samples\domains\wl_server\files\processed\HolidayRequest.xml</mule:MULE_CORRELATION_ID>
<mule:MULE_CORRELATION_GROUP_SIZE>-1</mule:MULE_CORRELATION_GROUP_SIZE>
<mule:MULE_CORRELATION_SEQUENCE>-1</mule:MULE_CORRELATION_SEQUENCE>
</mule:header>
</soapenv:Header>
<soapenv:Body>
<value0 xsi:type="ns1:DocumentImpl" xmlns="" xmlns:ns1="http://dom.internal.xerces.apache.org.sun.com">
<sch:HolidayRequest xmlns:sch="http://mycompany.com/hr/schemas">
<sch:Holiday>
<sch:StartDate>2009-08-13</sch:StartDate>
<sch:EndDate>1988-12-12</sch:EndDate>
</sch:Holiday>
<sch:Employee>
<sch:Number>3434</sch:Number>
<sch:FirstName>John</sch:FirstName>
<sch:LastName>Smith</sch:LastName>
</sch:Employee>
</sch:HolidayRequest>
</value0>
</soapenv:Body>
</soapenv:Envelope>
Le webservice fonctionne très bien dans SoapUI sans l'étiquette <value0>
et de ce que j'ai lu sur le site Mule Je ne sais pas pourquoi il est inséré.