on 03-24-2009 12:24 PM
Hi Guys,
I wonder if anyone can possibly shed any light on the following problem.
I am trying to create an instance of apache Axis' MessageFactory
However every time the Adaptor Module (Called ClientAuthentication) is called the following class is created - copied from the Message Display Tool
ClientAuthentication: com.sap.engine.services.webservices.jaxm.soap.MessageFactoryImpl created
I have the following in my imports
import org.apache.axis.soap.MessageFactoryImpl;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPHeader;
import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPPart;
And, at this stage, I have explicitly referenced the axis class when creating the instance:
// MessageFactory mf = MessageFactory.newInstance();
// Creating com.sap.engine.services.webservices.jaxm.soap.SOAPMessageImpl
javax.xml.soap.MessageFactory mf= org.apache.axis.soap.MessageFactoryImpl.newInstance();
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "ClientAuthentication: " + mf.getClass().getName() + " created");
Looking at the class in the exported EJB via a decompiler shows
MessageFactory mf = MessageFactoryImpl.newInstance();
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "ClientAuthentication: " + mf.getClass().getName() + " created");
And the result is a com.sap.engine.services.webservices.jaxm.soap.MessageFactoryImpl is created resulting in the wrong SOAPMessage which crashes when returning it's SOAPPart
Any help would be appreciated,
John
Hi,
It is possible to bypass the call to an implementation of MessageFactory and ensure the axis library is used to create the SOAPEnvelope using
org.apache.axis.message.SOAPEnvelope env = new org.apache.axis.message.SOAPEnvelope();
env.setSAAJEncodingCompliance(true);
org.apache.axis.Message iSoapMessage = new org.apache.axis.Message(env);
iSoapMessage.setMessageType("request");
SOAPMessage sm = iSoapMessage;
Instead of
javax.xml.soap.MessageFactory mf= org.apache.axis.soap.MessageFactoryImpl.newInstance();
SOAPMessage sm = mf.createMessage();
Which wasn't returning the right implementation of MessageFactory and hence SOAPEnvelope.
The addDocument to the SOAPBody is still crashing the same way, but this questionis answered.
All the best,
John
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thanks for your reply.
I'm actually not getting an error when creating the MessageFactory, but it's not creating the implementation of MessageFactory I want. SAP is using the classes from com.sap.engine.services.webservices.jaxm.soap instead of org.apache.axis.soap, even though I've explicitly told it to use the Axis classes.
With the SAP classes problems occur later down the code when I attempt to convert the instance of SOAPPart to a document, or when adding a document to the body returned from SOAPEnvelope.
Kind regards,
John
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear John,
What error you got while using MessageFactory mf = MessageFactory.newInstance()
Regards,
UDR
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.