无法将xml转换为SOAP

时间:2009-01-06 09:55:10

标签: xml soap messaging mule

我在使用Axis从Mule调用Web服务时遇到问题。我创建了一个相当简单的例子,我在Mule读取的文件中有xml,然后将其转换为Document并发送到webservice。 mule配置中的相关代码如下所示:

<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>

然而,对webservice的调用失败,因为上面的配置正在标记之后生成带有<value0>标记的SOAP消息,并在标记之前关闭它。生成的SOAP消息如下所示:

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>

webService在没有<value0>标签的SOAPUI中运行良好,而且我在Mule网站上看到的内容我不知道为什么要插入它。

1 个答案:

答案 0 :(得分:0)

这条肥皂信息有什么问题,对我来说没问题。此外,如果您尝试使用webservices mule,我建议使用cxf。它们在一起玩得非常好,在我看来,cxf在设计时考虑了可扩展性,特别是在弹簧环境中。 mule和cxf都有内置的弹簧。