Oracle B2B: inbound ebXML testing using telnet
Published on: Author: Richard Velden Category: OracleOracle B2B can be used for handling various messaging protocols. One of these is ebXML. Find out how to quickly send raw ebXML messages into Oracle B2B.
The issue: We were having issues with one of our partners concerning a new interface using ebXML. They were sending ebXML messages which could not be parsed by Oracle B2B properly. The problem however was not in the message payload itself, or in the ebXML envelope. Something on the HTTP protocol level seemed to be incorrect.
Based on the error message we had several ideas on what the problem might be (see figure 1 and 2). Part of the issue was how to interpret a particular part of the ebXML standard [1]. Testing each idea, by asking the partner to modify the ebXML message is very cumbersome. Thus we needed a quick way of checking the ebXML parser of Oracle B2B itself. That way we could easily tell the partner what to change without too much of trial and error.
at oracle.tip.b2b.engine.Engine.identifyDocument(Engine.java:5784) at oracle.tip.b2b.engine.Engine.processIncomingMessageImpl(Engine.java:2561) at oracle.tip.b2b.engine.Engine.processIncomingMessage(Engine.java:1951) at oracle.tip.b2b.engine.Engine.incomingContinueProcess(Engine.java:4673) at oracle.tip.b2b.engine.Engine.handleMessageEvent(Engine.java:4184) at oracle.tip.b2b.engine.Engine.processEvents(Engine.java:3634) at oracle.tip.b2b.engine.ThreadWorkExecutor.processEvent(ThreadWorkExecutor.java:740) at oracle.tip.b2b.engine.ThreadWorkExecutor.run(ThreadWorkExecutor.java:241) at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:120) at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:184) at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30) at oracle.tip.b2b.engine.Engine.identifyDocument(Engine.java:5784) at oracle.tip.b2b.engine.Engine.processIncomingMessageImpl(Engine.java:2561) at oracle.tip.b2b.engine.Engine.processIncomingMessage(Engine.java:1951) at oracle.tip.b2b.engine.Engine.incomingContinueProcess(Engine.java:4673) at oracle.tip.b2b.engine.Engine.handleMessageEvent(Engine.java:4184) at oracle.tip.b2b.engine.Engine.processEvents(Engine.java:3634) at oracle.tip.b2b.engine.ThreadWorkExecutor.processEvent(ThreadWorkExecutor.java:740) at oracle.tip.b2b.engine.ThreadWorkExecutor.run(ThreadWorkExecutor.java:241) at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:120) at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:184) at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30)
HTTP header
From our initial investigation in Oracle B2B source code we made out that we were wrongfully receiving a HTTP header: "MIME-Version: 1.0". As defined by the ebXML standard this should not be part of the ebXML message.
“Other headers with semantics defined by MIME specifications, such as Content-Transfer-Encoding, SHALL NOT appear as HTTP headers. Specifically, the "MIME-Version: 1.0" header MUST NOT appear as an HTTP header. However, HTTP-specific MIME-like headers defined by HTTP 1.1 MAY be used with the semantic defined in the HTTP specification.” [1]
This implies not to send the MIME-Version header.
Manually sending ebXML payloads to Oracle B2B
We needed to verify that this MIME-Version HTTP header was causing this issue, and whether there were no other issues somewhere else. For this we needed a way to send raw ebXML messages to Oracle B2B.
For this we have chosen to send raw messages to the Oracle B2B TransportServlet [2]: http://hostname:port/b2b/transportServlet
Using SOAPUI / Postman / HTTPRequester
These tools offer loads of functionality to do GETs and POSTs, using standard protocols such as REST and SOAP. Sending multipart messages such as ebXML, proved somewhat more difficult. Eventually we did manage to get ebXML working with HTTPRequester. One trick was to modify the Content Type field in such a way to add the boundary and start parameters (see figure 4 and 5).
Using telnet
Sending a raw ebXML message can also be performed using telnet. We already knew how the ebXML envelope and payload had to look like. This was easily extracted from the wire message payload of one of the failed attempts.
Using telnet we simulated both the message with and without the MIME-Version HTTP header. This proved useful in verifying the header was causing the problem. More importantly, it also verified that without this header the message parsed successfully in Oracle B2B. Below you will find an example on how to send an ebXML message using telnet.
First login onto the B2B server, or access the server remotely:
POST /b2b/transportServlet HTTP/1.1 Host: b2b.server.customer.com ChannelName: TransportServlet MSG_RECEIVED_TIME: Thu Nov 15 14:15:31 CEST 2016 SOAPAction: "ebXML" Content-Type: multipart/related; boundary="----=_Part_15_1995807078.1472136442053"; type="text/xml"; start="<0>"; start-info="text/xml" User-Agent: haboob/5.10.1.0.7 build-6490 X-Forwarded-For=10.0.0.1 Content-Length: 2032 ------=_Part_15_1995807078.1472136442053 Content-Type: text/xml;charset=UTF-8 Content-ID: <0> <?xml version="1.0" encoding="UTF-8" ?> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:eb="http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd" xsi:schemaLocation="http://schemas.xmlsoap.org/soap/envelope/ http://www.oasis-open.org/committees/ebxml-msg/schema/envelope.xsd http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd"><env:Header><eb:MessageHeader env:mustUnderstand="1" eb:version="2.0"><eb:From><eb:PartyId eb:type="urn:hello:world">FromPartyName</eb:PartyId><eb:Role>fromPartyRole</eb:Role></eb:From><eb:To><eb:PartyId eb:type="urn:hello:world">ToPartyRole</eb:PartyId><eb:Role>toPartyRole</eb:Role></eb:To><eb:CPAId>CPA_ID </eb:CPAId> <eb:ConversationId>0A262D8E156C5E624A200000799C5D9C</eb:ConversationId> <eb:Service eb:type="urn:helloWorld:services">ServiceName:0:1</eb:Service> <eb:Action>actionName</eb:Action><eb:MessageData> <eb:MessageId>2d333832373434353135393135323031</eb:MessageId> <eb:Timestamp>2016-10-10T12:25:09.869Z</eb:Timestamp> <eb:RefToMessageId>0A262D8E156BBFFAE72000001704DC0A</eb:RefToMessageId> ------=_Part_15_1995807078.1472136442053 Content-Type: text/html;charset=UTF-8 Content-Disposition: attachment; filename=null; Content-Transfer-Encoding: binary Content-ID: <1> <html> <body> Hello World! </body> </html> ------=_Part_15_1995807078.1472136442053—
Please mind the following::
- The Content-Length needs to match the actual content length of the entire multipart message.
- The ebXML envelope should match an actual agreement as configured in Oracle B2B. So mind to fill in proper values for: FromPartyName, FromPartyRole, toPartyName, toPartyRole, CPA_ID, ServiceName, ServiceType and ActionName.
- The ebXML envelope should have a valid Reference to each MIME part Content-ID.
- The ebXML envelope should use unique messageIDs for each separate request.
References
[1] ebXML Messaging standard
[2] Oracle B2B – Synchronous Request Reply