You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by an...@wellsfargo.com on 2006/08/01 19:38:23 UTC
Unable to create a soap message using xmlbeans [2.1.0]
Hi,
I am trying to create a simple SOAP message using the XML beans 2.1.0
library.
The code I am using is:
===========================================
public static void createSoapEnvelope() throws SOAPException {
MessageFactory messageFactory = MessageFactory.newInstance();
SOAPMessage message = messageFactory.createMessage();
SOAPPart prt = message.getSOAPPart();
SOAPEnvelope envelope = prt.getEnvelope();
SOAPBody body = envelope.getBody();
SOAPHeader header = envelope.getHeader();
System.out.println("====message: " + envelope.toString());
}
The problem I am having is that I am receiving the following exception:
===========================================
org.apache.xmlbeans.impl.soap.SOAPException: Unable to create message
factory for SOAP: null
at
org.apache.xmlbeans.impl.soap.MessageFactory.newInstance(MessageFactory.
java:119)
at com.NtlmHelper.createSoapEnvelope(NtlmHelper.java:63)
at com.NtlmHelper.invokeService(NtlmHelper.java:51)
at com.TestService.main(TestService.java:19)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
Exception in thread "main"
Process finished with exit code 1
Here are the jars in my classpath:
===========================================
commons-codec-1.3.jar
commons-httpclient-3.1-alpha1.jar
commons-logging-1.0.4.jar
ezimg.jar
jms.jar
jsr173_1.0_api.jar
request.xml
resolver.jar
wlclient.jar
wljmsclient.jar
xbean.jar
xbean_xpath.jar
xmlpublic.jar
Any ideas?
Thanks!
Andy
This message may contain confidential and/or privileged information. If
you are not the addressee or authorized to receive this for the
addressee, you must not use, copy, disclose, or take any action based on
this message or any information herein. If you have received this
message in error, please advise the sender immediately by reply e-mail
and delete this message. Thank you for your cooperation.
RE: Unable to create a soap message using xmlbeans [2.1.0]
Posted by Jacob Danner <ja...@bea.com>.
at quick glance, it looks like you might want to add the SAAJ jars to
your classpath
________________________________
From: andrew.j.hahn@wellsfargo.com [mailto:andrew.j.hahn@wellsfargo.com]
Sent: Tuesday, August 01, 2006 10:38 AM
To: user@xmlbeans.apache.org
Subject: Unable to create a soap message using xmlbeans [2.1.0]
Hi,
I am trying to create a simple SOAP message using the XML beans 2.1.0
library.
The code I am using is:
===========================================
public static void createSoapEnvelope() throws SOAPException {
MessageFactory messageFactory = MessageFactory.newInstance();
SOAPMessage message = messageFactory.createMessage();
SOAPPart prt = message.getSOAPPart();
SOAPEnvelope envelope = prt.getEnvelope();
SOAPBody body = envelope.getBody();
SOAPHeader header = envelope.getHeader();
System.out.println("====message: " + envelope.toString());
}
The problem I am having is that I am receiving the following exception:
===========================================
org.apache.xmlbeans.impl.soap.SOAPException: Unable to create message
factory for SOAP: null
at
org.apache.xmlbeans.impl.soap.MessageFactory.newInstance(MessageFactory.
java:119)
at com.NtlmHelper.createSoapEnvelope(NtlmHelper.java:63)
at com.NtlmHelper.invokeService(NtlmHelper.java:51)
at com.TestService.main(TestService.java:19)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
Exception in thread "main"
Process finished with exit code 1
Here are the jars in my classpath:
===========================================
commons-codec-1.3.jar
commons-httpclient-3.1-alpha1.jar
commons-logging-1.0.4.jar
ezimg.jar
jms.jar
jsr173_1.0_api.jar
request.xml
resolver.jar
wlclient.jar
wljmsclient.jar
xbean.jar
xbean_xpath.jar
xmlpublic.jar
Any ideas?
Thanks!
Andy
This message may contain confidential and/or privileged information. If
you are not the addressee or authorized to receive this for the
addressee, you must not use, copy, disclose, or take any action based on
this message or any information herein. If you have received this
message in error, please advise the sender immediately by reply e-mail
and delete this message. Thank you for your cooperation.
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.