Oracle B2B: inbound ebXML testing using telnet

Published on: Category: Oracle

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

Figure 1: Error message from B2B console
Figure 2: Error message from B2B logfiles
  1. <Error -: B2B-50083: Document protocol identification error.
  2. at oracle.tip.b2b.engine.Engine.identifyDocument(Engine.java:5784)
  3. at oracle.tip.b2b.engine.Engine.processIncomingMessageImpl(Engine.java:2561)
  4. at oracle.tip.b2b.engine.Engine.processIncomingMessage(Engine.java:1951)
  5. at oracle.tip.b2b.engine.Engine.incomingContinueProcess(Engine.java:4673)
  6. at oracle.tip.b2b.engine.Engine.handleMessageEvent(Engine.java:4184)
  7. at oracle.tip.b2b.engine.Engine.processEvents(Engine.java:3634)
  8. at oracle.tip.b2b.engine.ThreadWorkExecutor.processEvent(ThreadWorkExecutor.java:740)
  9. at oracle.tip.b2b.engine.ThreadWorkExecutor.run(ThreadWorkExecutor.java:241)
  10. at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:120)
  11. at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:184)
  12. at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30)
  13.  
  14. Error -: B2B-50083: Document protocol identification error.
  15. at oracle.tip.b2b.engine.Engine.identifyDocument(Engine.java:5784)
  16. at oracle.tip.b2b.engine.Engine.processIncomingMessageImpl(Engine.java:2561)
  17. at oracle.tip.b2b.engine.Engine.processIncomingMessage(Engine.java:1951)
  18. at oracle.tip.b2b.engine.Engine.incomingContinueProcess(Engine.java:4673)
  19. at oracle.tip.b2b.engine.Engine.handleMessageEvent(Engine.java:4184)
  20. at oracle.tip.b2b.engine.Engine.processEvents(Engine.java:3634)
  21. at oracle.tip.b2b.engine.ThreadWorkExecutor.processEvent(ThreadWorkExecutor.java:740)
  22. at oracle.tip.b2b.engine.ThreadWorkExecutor.run(ThreadWorkExecutor.java:241)
  23. at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:120)
  24. at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:184)
  25. 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.

Figure 3: Transport headers containing the presumed erroneous Mime-Version=1.0

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

Figure 4: Using HTTPRequester for sending ebXML messages. Modified the Content Type
Figure 5: Using HTTPRequester for sending ebXML messages. Added ebXML specific HTTP headers

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: 

telnet localhost 7777
  1. POST /b2b/transportServlet HTTP/1.1
  2. Host: b2b.server.customer.com
  3. ChannelName: TransportServlet
  4. Cache-Control: no-cache
  5. MSG_RECEIVED_TIME: Thu Nov 15 14:15:31 CEST 2016
  6. SOAPAction: "ebXML"
  7. Content-Type: multipart/related; boundary="----=_Part_15_1995807078.1472136442053"; type="text/xml"; start="<0>"; start-info="text/xml"
  8. User-Agent: haboob/5.10.1.0.7 build-6490 X-Forwarded-For=10.0.0.1
  9. Content-Length: 2032
  10. Connection: Keep-Alive
  11.  
  12. ------=_Part_15_1995807078.1472136442053
  13. Content-Type: text/xml;charset=UTF-8
  14. Content-ID: <0>
  15.  
  16. <?xml version="1.0" encoding="UTF-8" ?>
  17. <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>
  18. <eb:ConversationId>0A262D8E156C5E624A200000799C5D9C</eb:ConversationId>
  19. <eb:Service eb:type="urn:helloWorld:services">ServiceName:0:1</eb:Service>
  20. <eb:Action>actionName</eb:Action><eb:MessageData>
  21. <eb:MessageId>2d333832373434353135393135323031</eb:MessageId>
  22. <eb:Timestamp>2016-10-10T12:25:09.869Z</eb:Timestamp>
  23. <eb:RefToMessageId>0A262D8E156BBFFAE72000001704DC0A</eb:RefToMessageId>
  24. </eb:MessageData></eb:MessageHeader></env:Header><env:Body><eb:Manifest eb:id="m0A26229814FDB44042D000006D2D04B2" eb:version="2.0"><eb:Reference eb:id="payloadref-0A26229814FDB440437000006D2D04B3" xlink:href="cid:1" xlink:type="simple"/></eb:Manifest></env:Body></env:Envelope>
  25.  
  26. ------=_Part_15_1995807078.1472136442053
  27. Content-Type: text/html;charset=UTF-8
  28. Content-Disposition: attachment; filename=null;
  29. Content-Transfer-Encoding: binary
  30. Content-ID: <1>
  31.  
  32. <html>
  33. <head><title>HTML Test</title></head>
  34. <body>
  35. Hello World!
  36. </body>
  37. </html>
  38. ------=_Part_15_1995807078.1472136442053—
  39.  

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

Richard Velden
About the author Richard Velden

Oracle Fusion Middleware Developer at Qualogy. Specializes in integration and cloud development using Oracle technologies such as: SOA Suite, Service Bus, Integration and Process Cloud.

More posts by Richard Velden
Comments
Reply