错误WMQMsg:预期的MQ消息格式'MQStr'但已收到''

时间:2014-05-21 07:38:45

标签: mule ibm-mq

目前我正在与Mule ESB和WMQ合作。我已经在mule上配置了所有内容:

    <?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:jms="http://www.mulesoft.org/schema/mule/jms" xmlns:wmq="http://www.mulesoft.org/schema/mule/ee/wmq" xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" xmlns:data-mapper="http://www.mulesoft.org/schema/mule/ee/data-mapper" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
    xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.1"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ee/data-mapper http://www.mulesoft.org/schema/mule/ee/data-mapper/current/mule-data-mapper.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd
http://www.mulesoft.org/schema/mule/ee/wmq http://www.mulesoft.org/schema/mule/ee/wmq/current/mule-wmq-ee.xsd
http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/current/mule-jms.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd">
    <custom-transformer name="StringToNameString" class="de.fraport.sources.StringtoAusweis" doc:name="Java"/>
    <data-mapper:config name="json_to_xml" transformationGraphPath="json_to_xml.grf" doc:name="json_to_xml"/>
    <wmq:connector name="WMQ" hostName="localhost" port="1414" queueManager="localmanager" validateConnections="true" doc:name="WMQ"  />

    <flow name="RequestFlow" doc:name="RequestFlow">
        <http:inbound-endpoint exchange-pattern="one-way" host="localhost" port="8081" path="uebermittleAusweisdaten" doc:name="HTTP"/>
        <expression-filter expression="#[message.payload !='/favicon.ico']" doc:name="Expression"/>
        <data-mapper:transform config-ref="json_to_xml" doc:name="JSON To XML"/>
        <mulexml:xslt-transformer maxIdleTransformers="2" maxActiveTransformers="5" xsl-file="D:\Workspace\soaptest\mobako.sender.xsl" doc:name="XSLT"/>
        <wmq:outbound-endpoint queue="LSMH.ZKSEAP.SERVICEBUS" connector-ref="WMQ" doc:name="ZKSEAP IN"/>
    </flow>
    <flow name="ServiceResponse" doc:name="ServiceResponse">
        <wmq:inbound-endpoint queue="ZKSEAP.LSMH.SERVICEBUS" connector-ref="WMQ" doc:name="ZKSEAP OUT"/>
        <file:outbound-endpoint path="D:\Workspace\soaptest"
        outputPattern="#[function:datestamp:dd-MM-yy]_#[function:systime].txt" 
        responseTimeout="10000" doc:name="Output File" /> 
    </flow>
</mule>

这是我的xsl文件:

    <?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version = "2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://www.w3.org/2005/08/addressing">
  <xsl:output method="xml" encoding="ISO-8859-1" indent="no"/>

  <xsl:template match="/">
        <soapenv:Envelope >
            <soapenv:Header>
                <wsa:Action>http://security.fraport.de/zks-eap/uebermittleAusweisdaten</wsa:Action>
                <wsa:MessageID><xsl:value-of select="1"/></wsa:MessageID>
                <wsa:From>
                    <wsa:Address>esbp://services.fraport.de/lsmh/mobako</wsa:Address>
                </wsa:From>
                <wsa:To>esbp://services.fraport.de/lsmh/zks-eap</wsa:To>
                <wsa:ReplyTo>
                    <wsa:Address>esbp://services.fraport.de/lsmh/mobako</wsa:Address>
                </wsa:ReplyTo>
            </soapenv:Header>
            <soapenv:Body>
                <xsl:processing-instruction name="archimoaXsltConnector">callback="true"</xsl:processing-instruction>
                <zkseap:uebermittleAusweisdatenRequest xmlns:zkseap="http://security.fraport.de/zks-eap">
                  <ausweis>
                    <nummer>
                      <xsl:value-of select="ausweis/nummer"/>
                    </nummer>
                  </ausweis>
                </zkseap:uebermittleAusweisdatenRequest>
            </soapenv:Body>
        </soapenv:Envelope>
    </xsl:template>  
</xsl:stylesheet>

但是当我发送请求时,我在服务器上出现了以下错误:

error

为什么我会收到这些错误?我该如何解决?

仅供参考,以下是我发送请求的方式:

  

卷曲-H&#34;内容类型:application / json&#34; -d&#34; {\&#34; name \&#34;:\&#34; 11.2 \&#34;}&#34;本地主机:8081 / uebermittleAusweisdaten

提前致谢

1 个答案:

答案 0 :(得分:0)

要解决此问题,只需添加:

<mulexml:dom-to-xml-transformer outputEncoding="ISO8859-1" doc:name="DOM to XML" encoding="ISO8859-1"/>

在将请求发送到WMQ端点

之前