I'm new to Ibm Integration Bus, and I've been struggling to convert Data from http nodes to SOAP nodes. My message Flow
The problem is when I use SOAP input it works but when I change it with Http input and convert the data from JSON to XML, an error keeps showing up.
code of compute node:
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;
my WSDL ( it works just fine with SOAPInput and 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>
The error:
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)
The important bits of the error message are:
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.
In other words: The reply of endpoint http://localhost:8000/wsdl
is not valid SOAP reply; maybe it is plain text. You should analyse this endpoint and figure out why it is not replying a proper SOAP reply.