dims 2002/06/22 12:09:25
Modified: java/src/org/apache/axis/message Detail.java
MessageElement.java
java/src/org/apache/axis Message.java
java/src/org/apache/axis/soap MessageFactoryImpl.java
SOAPFactoryImpl.java
Log:
Fleshing SAAJ Factories.
Revision Changes Path
1.2 +4 -0 xml-axis/java/src/org/apache/axis/message/Detail.java
Index: Detail.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/Detail.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Detail.java 29 May 2002 17:00:00 -0000 1.1
+++ Detail.java 22 Jun 2002 19:09:24 -0000 1.2
@@ -76,6 +76,10 @@
super(namespace, localName, prefix, attrs, context);
}
+ public Detail() {
+ super(new AxisFault());
+ }
+
public Detail(AxisFault fault) {
super(fault);
}
1.103 +12 -5 xml-axis/java/src/org/apache/axis/message/MessageElement.java
Index: MessageElement.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/MessageElement.java,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -r1.102 -r1.103
--- MessageElement.java 16 Jun 2002 22:19:50 -0000 1.102
+++ MessageElement.java 22 Jun 2002 19:09:24 -0000 1.103
@@ -141,32 +141,39 @@
{
}
- MessageElement(String namespace, String localPart)
+ public MessageElement(String namespace, String localPart)
{
namespaceURI = namespace;
name = localPart;
}
- MessageElement(Name eltName)
+ public MessageElement(String localPart, String prefix, String namespace)
+ {
+ this.namespaceURI = namespace;
+ this.name = localPart;
+ this.prefix = prefix;
+ }
+
+ public MessageElement(Name eltName)
{
this(eltName.getURI(), eltName.getLocalName());
prefix = eltName.getPrefix();
}
- MessageElement(String namespace, String localPart, Object value)
+ public MessageElement(String namespace, String localPart, Object value)
{
this(namespace, localPart);
objectValue = value;
}
- MessageElement(Element elem)
+ public MessageElement(Element elem)
{
elementRep = elem;
namespaceURI = elem.getNamespaceURI();
name = elem.getLocalName();
}
- MessageElement(Text text)
+ public MessageElement(Text text)
{
textRep = text;
namespaceURI = text.getNamespaceURI();
1.71 +27 -4 xml-axis/java/src/org/apache/axis/Message.java
Index: Message.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/Message.java,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -r1.70 -r1.71
--- Message.java 20 Jun 2002 16:48:17 -0000 1.70
+++ Message.java 22 Jun 2002 19:09:25 -0000 1.71
@@ -123,6 +123,8 @@
*/
private Attachments mAttachments = null;
+ private MimeHeaders headers;
+
/**
* Returns name of the class prividing Attachment Implementation
* @returns class Name
@@ -164,7 +166,25 @@
* containing just the SOAP body (no SOAP-ENV).
*/
public Message(Object initialContents, boolean bodyInStream) {
- this(initialContents, bodyInStream, (String) null, (String) null);
+ setup(initialContents, bodyInStream, (String) null, (String) null, null);
+ }
+
+ /**
+ * Construct a Message, using the provided initialContents as the
+ * contents of the Message's SOAPPart.
+ * <p>
+ * Eventually, genericize this to
+ * return the RootPart instead, which will have some kind of
+ * EnvelopeFactory to enable support for things other than SOAP.
+ * But that all will come later, with lots of additional refactoring.
+ *
+ * @param initialContents may be String, byte[], InputStream, SOAPEnvelope,
+ * or AxisFault.
+ * @param bodyInStream is true if initialContents is an InputStream
+ * containing just the SOAP body (no SOAP-ENV).
+ */
+ public Message(Object initialContents, MimeHeaders headers) {
+ setup(initialContents, true, (String) null, (String) null, headers);
}
/**
@@ -187,7 +207,7 @@
boolean bodyInStream,
String contentType,
String contentLocation) {
- setup(initialContents, bodyInStream, contentType, contentLocation);
+ setup(initialContents, bodyInStream, contentType, contentLocation, null);
}
/**
@@ -195,7 +215,7 @@
* defaulting bodyInStream to false.
*/
public Message(Object initialContents) {
- setup(initialContents, false, null, null);
+ setup(initialContents, false, null, null, null);
}
private static Class attachImpl = null;
@@ -248,7 +268,8 @@
* Do the work of construction.
*/
private void setup(Object initialContents, boolean bodyInStream,
- String contentType, String contentLocation) {
+ String contentType, String contentLocation,
+ MimeHeaders mimeHeaders) {
// Try to construct an AttachmentsImpl object for attachment
// functionality.
@@ -291,6 +312,8 @@
// The stream was not determined by a more complex type so default to
if(mAttachments!=null) mAttachments.setRootPart(mSOAPPart);
+
+ headers = (mimeHeaders == null) ? new MimeHeaders() : mimeHeaders;
}
/**
1.3 +2 -1 xml-axis/java/src/org/apache/axis/soap/MessageFactoryImpl.java
Index: MessageFactoryImpl.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/soap/MessageFactoryImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- MessageFactoryImpl.java 30 May 2002 16:40:42 -0000 1.2
+++ MessageFactoryImpl.java 22 Jun 2002 19:09:25 -0000 1.3
@@ -111,7 +111,8 @@
public SOAPMessage createMessage(
MimeHeaders mimeheaders, InputStream inputstream)
throws IOException, SOAPException {
- //TODO:Flesh this out.
+ Message message = new Message(inputstream,mimeheaders);
+ message.setMessageType(Message.REQUEST);
return null;
}
}
1.2 +12 -14 xml-axis/java/src/org/apache/axis/soap/SOAPFactoryImpl.java
Index: SOAPFactoryImpl.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/soap/SOAPFactoryImpl.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SOAPFactoryImpl.java 11 Jun 2002 17:36:07 -0000 1.1
+++ SOAPFactoryImpl.java 22 Jun 2002 19:09:25 -0000 1.2
@@ -54,6 +54,10 @@
*/
package org.apache.axis.soap;
+import org.apache.axis.message.Detail;
+import org.apache.axis.message.MessageElement;
+import org.apache.axis.message.PrefixedQName;
+
import javax.xml.soap.Name;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPException;
@@ -75,8 +79,7 @@
* creating the <CODE>SOAPElement</CODE> object
*/
public SOAPElement createElement(Name name) throws SOAPException {
- //TODO: Flesh this out.
- return null;
+ return new MessageElement(name);
}
/**
@@ -90,8 +93,7 @@
* creating the <CODE>SOAPElement</CODE> object
*/
public SOAPElement createElement(String localName) throws SOAPException {
- //TODO: Flesh this out.
- return null;
+ return new MessageElement("",localName);
}
/**
@@ -111,25 +113,21 @@
*/
public SOAPElement createElement(
String localName, String prefix, String uri) throws SOAPException {
- //TODO: Flesh this out.
- return null;
+ return new MessageElement(localName, prefix, uri);
}
public javax.xml.soap.Detail createDetail()
throws SOAPException {
- //TODO: Flesh this out.
- return null;
+ return new Detail();
}
- public Name createName(String s, String s1, String s2)
+ public Name createName(String localName, String prefix, String uri)
throws SOAPException {
- //TODO: Flesh this out.
- return null;
+ return new PrefixedQName(uri,localName,prefix);
}
- public Name createName(String s)
+ public Name createName(String localName)
throws SOAPException {
- //TODO: Flesh this out.
- return null;
+ return new PrefixedQName("",localName,"");
}
}