|
From: <cy...@us...> - 2003-07-31 06:57:51
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler
In directory sc8-pr-cvs1:/tmp/cvs-serv11783
Modified Files:
MessageServer.java Request.java
Log Message:
Adapt to the code change of PayloadContainer.
Index: MessageServer.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler/MessageServer.java,v
retrieving revision 1.140
retrieving revision 1.141
diff -C2 -d -r1.140 -r1.141
*** MessageServer.java 16 Jul 2003 08:56:11 -0000 1.140
--- MessageServer.java 31 Jul 2003 06:57:48 -0000 1.141
***************
*** 3703,3731 ****
contentType, encoding);
final DataHandler dh = new DataHandler(ads);
! final AttachmentPart attachment = soapMessage.
! createAttachmentPart(dh);
for (Iterator i=attachmentHeaders.getAllHeaders() ;
i.hasNext() ; ) {
final MimeHeader header = (MimeHeader) i.next();
final String name = header.getName();
! if (!name.equals(Constants.CONTENT_TYPE)) {
attachment.setMimeHeader(name, header.getValue());
}
}
! // soapMessage.addAttachmentPart(attachment);
! if (EbxmlMessage.needPatch) {
! String contentId = attachment.getContentId();
! if (!contentId.startsWith("<") ||
! !contentId.endsWith(">")) {
! contentId = "<" + contentId + ">";
! }
! payloads.add(new PayloadContainer(attachment,
! contentId, null));
! }
! else {
! payloads.add(new PayloadContainer(attachment,
! attachment.getContentId(), null));
! }
!
offset += (length + line.length);
--- 3703,3723 ----
contentType, encoding);
final DataHandler dh = new DataHandler(ads);
! String contentId = null;
! ahs = attachmentHeaders.getHeader(Constants.CONTENT_ID);
! if (ahs != null) {
! contentId = ahs[0];
! }
! PayloadContainer attachment = new PayloadContainer
! (dh, contentId, null);
for (Iterator i=attachmentHeaders.getAllHeaders() ;
i.hasNext() ; ) {
final MimeHeader header = (MimeHeader) i.next();
final String name = header.getName();
! if (!name.equals(Constants.CONTENT_TYPE) &&
! !name.equals(Constants.CONTENT_ID)) {
attachment.setMimeHeader(name, header.getValue());
}
}
! payloads.add(attachment);
offset += (length + line.length);
***************
*** 3759,3762 ****
--- 3751,3755 ----
}
catch (Exception e) {
+ e.printStackTrace();
String err = ErrorMessages.getMessage(
ErrorMessages.ERR_HERMES_UNKNOWN_ERROR, e);
Index: Request.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler/Request.java,v
retrieving revision 1.73
retrieving revision 1.74
diff -C2 -d -r1.73 -r1.74
*** Request.java 9 Jun 2003 07:57:00 -0000 1.73
--- Request.java 31 Jul 2003 06:57:48 -0000 1.74
***************
*** 1314,1319 ****
*
* @param ebxmlMessage Message to be sent.
! * @param signed true if the message should be signed;
! * false otherwise.
* @throws RequestException
*/
--- 1314,1319 ----
*
* @param ebxmlMessage Message to be sent.
! * @param signed true if the acknowledgment response
! * should be signed; false otherwise.
* @throws RequestException
*/
***************
*** 1676,1692 ****
PayloadContainer pc = (PayloadContainer) i.next();
if (maxPayloadSize >= 0) {
! try {
! if (pc.getDataHandler().getDataSource() instanceof
! AttachmentDataSource) {
! AttachmentDataSource source = (AttachmentDataSource)
! pc.getDataHandler().getDataSource();
! if (source.getLength() > maxPayloadSize) {
! throw new RequestException(
! "Message containing larger payloads than "
! + "allowed.");
! }
}
}
- catch (SOAPException e) {}
}
count++;
--- 1676,1688 ----
PayloadContainer pc = (PayloadContainer) i.next();
if (maxPayloadSize >= 0) {
! if (pc.getDataHandler().getDataSource() instanceof
! AttachmentDataSource) {
! AttachmentDataSource source = (AttachmentDataSource)
! pc.getDataHandler().getDataSource();
! if (source.getLength() > maxPayloadSize) {
! throw new RequestException("Message containing " +
! "larger payloads than allowed.");
}
}
}
count++;
|