当前位置: 首页 > 知识库问答 >
问题:

IBM集成总线:SOAP请求收到HTTP错误状态代码“500”

臧正平
2023-03-14

我是Ibm集成总线的新手,一直在努力将数据从http节点转换为SOAP节点。我的消息

问题是,当我使用SOAP输入时,它可以工作,但当我使用Http输入更改它并将数据从JSON转换为XML时,错误不断出现。

计算节点代码:

     DECLARE reftoOut REFERENCE To OutputRoot.XMLNSC.ns2:MessageExtraitRequest;
     DECLARE reftoIn REFERENCE To InputRoot.JSON.Data;
        
        
        SET reftoOut.ns2:No_du_compte = reftoIn.No_du_compte;
        SET reftoOut.ns2:Date_operation = reftoIn.Date_operation;
        SET reftoOut.ns2:REFERENCE = reftoIn.REFERENCE;
        SET reftoOut.ns2:Libelle = reftoIn.Libelle;
        SET reftoOut.ns2:Date_valeur = reftoIn.Date_valeur;
        SET reftoOut.ns2:DEBIT = reftoIn.DEBIT;
        SET reftoOut.ns2:CREDIT = reftoIn.CREDIT;

我的WSDL(它与SOAPInput和postman配合得很好)

<?xml version="1.1" encoding="UTF-8"?> <!-- <definitions> must be the root of the WSDL document --> <wsdl:definitions targetNamespace="http://tempuri.org/"    xmlns:s="http://www.w3.org/2001/XMLSchema"    xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"    xmlns:tns="http://tempuri.org/"    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"    xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">   <!-- WSDL TYPES: definition of the data types that are used in the web service -->   <wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
      <s:element name="MessageExtraitRequest">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="1" maxOccurs="1" name="No_du_compte" type="s:string"/>
            <s:element minOccurs="1" maxOccurs="1" name="Date_operation" type="s:string"/>
            <s:element minOccurs="1" maxOccurs="1" name="REFERENCE" type="s:int"/>
            <s:element minOccurs="1" maxOccurs="1" name="Libelle" type="s:string"/>
            <s:element minOccurs="1" maxOccurs="1" name="Date_valeur" type="s:string"/>
            <s:element minOccurs="1" maxOccurs="1" name="DEBIT" type="s:int"/>
            <s:element minOccurs="1" maxOccurs="1" name="CREDIT" type="s:int"/>
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="MessageExtraitResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="1" maxOccurs="1" name="fieldCount" type="s:string"/>
            <s:element minOccurs="1" maxOccurs="1" name="affectedRows" type="s:string"/>
            <s:element minOccurs="1" maxOccurs="1" name="insertId" type="s:string"/>
            <s:element minOccurs="1" maxOccurs="1" name="serverStatus" type="s:string"/>
            <s:element minOccurs="1" maxOccurs="1" name="warningCount" type="s:string"/>
            <s:element minOccurs="1" maxOccurs="1" name="message" type="s:string"/>
            <s:element minOccurs="1" maxOccurs="1" name="protocol41" type="s:string"/>
            <s:element minOccurs="1" maxOccurs="1" name="changedRows" type="s:string"/>
          </s:sequence>
        </s:complexType>
      </s:element>
    </s:schema>   </wsdl:types>   <!-- MESSAGES: defines the data being exchanged between the service and client -->   <wsdl:message name="MessageExtraitSoapIn">
    <wsdl:part name="parameters" element="tns:MessageExtraitRequest"/>   </wsdl:message>   <wsdl:message name="MessageExtraitSoapOut">
    <wsdl:part name="parameters" element="tns:MessageExtraitResponse"/>   </wsdl:message>   <!-- PORT TYPES: defines the complete communication operation (one way/round trip) -->   <wsdl:portType name="MessageExtraitSoapPort">
    <!-- The operation name must be the same as the one specified in the service object -->
    <wsdl:operation name="MessageExtrait">
      <wsdl:input message="tns:MessageExtraitSoapIn"/>
      <wsdl:output message="tns:MessageExtraitSoapOut"/>
    </wsdl:operation>   </wsdl:portType>   <!-- BINDING: provides details on how a portType operation will actually be transmitted -->   <wsdl:binding name="MessageExtraitServiceSoapBinding" type="tns:MessageExtraitSoapPort">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="MessageExtrait">
      <soap:operation soapAction="MessageExtrait" style="document"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>   </wsdl:binding>
     <!-- SERVICE:  -->   <wsdl:service name="MessageExtraitService">
    <wsdl:port name="MessageExtraitServiceSoapPort" binding="tns:MessageExtraitServiceSoapBinding">
      <soap:address location="http://localhost:8000/wsdl"/>
    </wsdl:port>   </wsdl:service> </wsdl:definitions>

错误:

    Error sending request to http "http://localhost:7800/server"
            java.io.IOException: {"error": {"code":500,"status":"Internal Server Error","detail":"BIP2230E: Error detected whilst processing a message in node 'WS_MF.
        SOAP Request'. \nBIP3754E: The SOAP Request Node or SOAP Async Request Node WS_MF.
        SOAP Request encountered an error while processing the outbound SOAP request. \nBIP3162S: An HTTP error occurred. 
        The HTTP Request-Line was: ''POST /wsdl HTTP/1.1
            \nBIP3711E: A SOAP request received an HTTP Error Status Code '500', but the response message body was not a SOAP fault. 
        The HTTP  request was made to the destination ''http://localhost:8000/wsdl''. 
        The HTTP status line that was returned was: ''HTTP/1.1 500 Internal Server Error''. \nBIP3701E: A Java exception was thrown whilst calling the Java JNI method ''Axis2Requester_processResponseMessageSync''. 
        The Java exception was ''org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: An invalid XML character (Unicode: 0x45) was found in the prolog of the document.''. 
        The Java stack trace was ''Frame : 0 org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: An invalid XML character (Unicode: 0x45) was found in the prolog of the document.
    | @: org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:293)| 
    @: org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:204)
    | @: org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:154)
    | @: org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:140)
    | @: com.ibm.broker.axis2.SoapUtilities.createSOAPMessage(SoapUtilities.java:2259)
    | @: com.ibm.broker.axis2.SoapUtilities.createSOAPMessage(SoapUtilities.java:1959)
    | @: com.ibm.broker.axis2.Axis2Requester.processResponseMessageSync(Axis2Requester.java:2184)|Frame : 1 javax.xml.stream.XMLStreamException: An invalid XML character (Unicode: 0x45) was found in the prolog of the document.
    | @: com.ibm.xml.xlxp2.api.stax.msg.StAXMessageProvider.throwWrappedXMLStreamException(StAXMessageProvider.java:76)
    | @: com.ibm.xml.xlxp2.api.stax.XMLStreamReaderImpl.produceFatalErrorEvent(XMLStreamReaderImpl.java:2008)
    | @: com.ibm.xml.xlxp2.api.jaxb.JAXBXMLStreamReader.produceFatalErrorEvent(JAXBXMLStreamReader.java:356)| @: com.ibm.xml.xlxp2.scan.DocumentScanner.reportFatalError(DocumentScanner.java:4871)| @: com.ibm.xml.xlxp2.scan.DocumentScanner.reportFatalError(DocumentScanner.java:1212)| @: com.ibm.xml.xlxp2.scan.DocumentScanner.scanProlog(DocumentScanner.java:1777)| @: com.ibm.xml.xlxp2.scan.DocumentScanner.nextEvent(DocumentScanner.java:1323)| @: com.ibm.xml.xlxp2.api.stax.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:581)| @: com.ibm.xml.xlxp2.api.stax.XMLInputFactoryImpl$XMLStreamReaderProxyImpl.next(XMLInputFactoryImpl.java:183)| @: com.ibm.xml.xlxp2.api.wssec.WSSXMLInputFactory$WSSStreamReaderProxy.next(WSSXMLInputFactory.java:55)| @: org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:672)| @: org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214)
| @: org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:204)
| @: org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:154)
| @: org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:140)
| @: com.ibm.broker.axis2.SoapUtilities.createSOAPMessage(SoapUtilities.java:2259)
| @: com.ibm.broker.axis2.SoapUtilities.createSOAPMessage(SoapUtilities.java:1959)
| @: com.ibm.broker.axis2.Axis2Requester.processResponseMessageSync(Axis2Requester.java:2184)''. "}}
                at com.ibm.etools.mft.unittest.core.transport.http.HttpClient.makeHttpCall(HttpClient.java:163)
                at com.ibm.etools.mft.unittest.core.transport.http.HttpClient.makeSOAPRequest(HttpClient.java:99)
                at com.ibm.etools.mft.unittest.core.transport.http.SendHTTPMessageDelegate.sendBytes(SendHTTPMessageDelegate.java:125)
                at com.ibm.etools.mft.unittest.core.commchannel.mb.AbstractSendMessageDelegate.sendPlainText(AbstractSendMessageDelegate.java:255)
                at com.ibm.etools.mft.unittest.core.commchannel.mb.AbstractSendMessageDelegate.sendMessage(AbstractSendMessageDelegate.java:208)
                at com.ibm.etools.mft.unittest.core.transport.http.HTTPHandler.send(HTTPHandler.java:53)
                at com.ibm.etools.mft.unittest.core.commchannel.mb.SendMessageOperation.sendMessage(SendMessageOperation.java:87)
                at com.ibm.etools.mft.unittest.core.commchannel.jobs.SendMessageOperationJob.doRun(SendMessageOperationJob.java:94)
                at com.ibm.etools.mft.unittest.core.commchannel.jobs.SendMessageOperationJob.run(SendMessageOperationJob.java:149)
                at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

共有1个答案

华星驰
2023-03-14

错误消息的重要位包括:

BIP3754E: The SOAP Request Node or SOAP Async Request Node WS_MF
          encountered an error while processing the outbound SOAP request.

BIP3711E: A SOAP request received an HTTP Error Status Code '500',
          but the response message body was not a SOAP fault.

换句话说:endpoint的回复<代码>http://localhost:8000/wsdl不是有效的SOAP回复;可能是纯文本。您应该分析这个endpoint,并找出它为什么没有回复正确的SOAP回复。

 类似资料:
  • 我的服务使用WebApi。它有一个带有GET方法的控制器。当我从客户端调用它并返回未授权的状态代码时,我在HttpResponseMessage中没有得到未授权,而是没有找到。 这是我从客户端调用它的方式: < code >响应的内容: 我在 GetTest() 处放置了一个断点,它在那里停止,所以它到达了控制器方法。 为什么我在客户端中收到“未找到”,而不是“未经授权”?

  • 如何从的结果中获取HTTP状态?

  • Xml字符串没有以Xml格式打印。我正在创建动态soap信封,所以我可能无法为信封创建模型类,我提到了这一点,但他正在使用模态类创建soap信封,我想传递原始字符串xml,有什么方法可以传递原始xml字符串到改型体。

  • 我正试图通过Axios在本地发送一个POST请求,其中包含用户名和密码。 我正在部署一个Flask应用程序http://127.0.0.1:5000/login,它处理/login路由。POST请求失败,出现以下错误 我研究了一点,认为这可能是CORS的问题,但情况似乎并非如此,因为我尝试了一个Axios GET请求,它工作正常(响应记录正确)。这是我的部分代码 查看ChromeDevTools,

  • 此外,小于-1的状态代码被归一化为零。-1通常表示请求被中止,例如使用config.timeout 这同样也适用于新版本的Angular吗?我使用的是Angular 4.0.1。

  • 我希望根据响应对象错误动态返回HTTPStatus代码,如400、400、404等。我被提到这个问题--使用Spring3RESTful以编程方式更改http响应状态,但没有帮助。 我有一个带有方法的控制器类 是一个类,其中有上面使用的两个方法(和)。 我不想签入if条件并相应地返回响应代码,有没有其他更好的方法来做到这一点?