You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by wh...@apache.org on 2005/06/17 16:14:39 UTC
cvs commit: ws-axis/c/tests/auto_build/testcases/output DynamicAttachmentRequest.out
whitlock 2005/06/17 07:14:39
Modified: c/src/soap SoapAttachment.cpp
c/tests/auto_build/testcases/dynamic/DynamicAttachment
DynamicAttachment.cpp
c/tests/auto_build/testcases/output
DynamicAttachmentRequest.out
Log:
Fix referenced attachments and add more to the DynamicAttachment unit test
Revision Changes Path
1.13 +1 -1 ws-axis/c/src/soap/SoapAttachment.cpp
Index: SoapAttachment.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/soap/SoapAttachment.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- SoapAttachment.cpp 16 Jun 2005 14:19:15 -0000 1.12
+++ SoapAttachment.cpp 17 Jun 2005 14:14:38 -0000 1.13
@@ -141,7 +141,7 @@
data += " href=\"cid:";
data += m_AttachmentHeaders->getHeader(AXIS_CONTENT_ID);
data += "\" />";
- pSZ.serialize(data.c_str());
+ pSZ.serialize(data.c_str(), NULL);
}
AXIS_CPP_NAMESPACE_END
1.2 +52 -0 ws-axis/c/tests/auto_build/testcases/dynamic/DynamicAttachment/DynamicAttachment.cpp
Index: DynamicAttachment.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/tests/auto_build/testcases/dynamic/DynamicAttachment/DynamicAttachment.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DynamicAttachment.cpp 16 Jun 2005 15:59:44 -0000 1.1
+++ DynamicAttachment.cpp 17 Jun 2005 14:14:39 -0000 1.2
@@ -34,6 +34,58 @@
call.setTransportProperty(SOAPACTION_HEADER , "Trash");
call.setOperation("put", "http://localhost/axis/DynamicAttachment");
+ ISoapAttachment *att = NULL;
+ char *text = "This is the attachment body for the DynamicAttachment test";
+
+ ///////////////////////////////////////////////////////////////////
+ // Referenced attachment with a generated content id
+ ///////////////////////////////////////////////////////////////////
+
+ att = call.createSoapAttachment();
+ att->addHeader(AXIS_CONTENT_TYPE,"text/plain");
+ att->addHeader(AXIS_CONTENT_TRANSFER_ENCODING,"base64");
+
+ xsd__base64Binary b64b1;
+ b64b1.__ptr = (xsd__unsignedByte*)text;
+ b64b1.__size = strlen(text)+1;
+ att->addBody(&b64b1);
+
+ call.addAttachmentParameter(att, "arg_attachment_1");
+
+ ///////////////////////////////////////////////////////////////////
+ // Referenced attachment with a user defined content id
+ ///////////////////////////////////////////////////////////////////
+
+ att = call.createSoapAttachment();
+ att->addHeader(AXIS_CONTENT_TYPE,"text/plain");
+ att->addHeader(AXIS_CONTENT_ID,"12");
+ att->addHeader(AXIS_CONTENT_TRANSFER_ENCODING,"base64");
+
+ xsd__base64Binary b64b2;
+ b64b2.__ptr = (xsd__unsignedByte*)text;
+ b64b2.__size = strlen(text)+1;
+ att->addBody(&b64b2);
+
+ call.addAttachmentParameter(att, "arg_attachment_2");
+
+ ///////////////////////////////////////////////////////////////////
+ // Unreferenced attachment to make sure referenced and unreferenced
+ // attachments mix OK
+ ///////////////////////////////////////////////////////////////////
+
+ att = call.createSoapAttachment();
+ att->addHeader(AXIS_CONTENT_TYPE,"text/plain");
+ att->addHeader(AXIS_CONTENT_TRANSFER_ENCODING,"base64");
+
+ xsd__base64Binary b64b3;
+ b64b3.__ptr = (xsd__unsignedByte*)text;
+ b64b3.__size = strlen(text)+1;
+ att->addBody(&b64b3);
+
+ call.addAttachment(att);
+
+ ///////////////////////////////////////////////////////////////////
+
cout << "Invoking..." << endl;
if (AXIS_SUCCESS != call.invoke())
{
1.2 +32 -3 ws-axis/c/tests/auto_build/testcases/output/DynamicAttachmentRequest.out
Index: DynamicAttachmentRequest.out
===================================================================
RCS file: /home/cvs/ws-axis/c/tests/auto_build/testcases/output/DynamicAttachmentRequest.out,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DynamicAttachmentRequest.out 16 Jun 2005 15:59:44 -0000 1.1
+++ DynamicAttachmentRequest.out 17 Jun 2005 14:14:39 -0000 1.2
@@ -1,14 +1,43 @@
POST /DynamicAttachment/services/DynamicAttachment HTTP/1.1
Host: localhost:13260
-Content-Type: text/xml; charset=UTF-8
SOAPAction: "Trash"
-Content-Length: 346
+Content-Type: multipart/related; type="text/xml"; boundary="------=MIME_BOUNDARY"; start="<4>"
+Content-Length: 1096
+
+
+--------=MIME_BOUNDARY
+Content-Type: text/xml; charset=UTF-8
+Content-Transfer-Encoding: binary
+Content-Id: <4>
<?xml version='1.0' encoding='utf-8' ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<ns1:put xmlns:ns1="http://localhost/axis/DynamicAttachment">
-</ns1:put>
+<arg_attachment_1 href="cid:1" /><arg_attachment_2 href="cid:12" /></ns1:put>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
+
+--------=MIME_BOUNDARY
+Content-Id: <1>
+Content-Type: text/plain
+Content-Transfer-Encoding: base64
+
+VGhpcyBpcyB0aGUgYXR0YWNobWVudCBib2R5IGZvciB0aGUgRHluYW1pY0F0dGFjaG1lbnQgdGVzdAA=
+
+--------=MIME_BOUNDARY
+Content-Id: <12>
+Content-Type: text/plain
+Content-Transfer-Encoding: base64
+
+VGhpcyBpcyB0aGUgYXR0YWNobWVudCBib2R5IGZvciB0aGUgRHluYW1pY0F0dGFjaG1lbnQgdGVzdAA=
+
+--------=MIME_BOUNDARY
+Content-Id: <3>
+Content-Type: text/plain
+Content-Transfer-Encoding: base64
+
+VGhpcyBpcyB0aGUgYXR0YWNobWVudCBib2R5IGZvciB0aGUgRHluYW1pY0F0dGFjaG1lbnQgdGVzdAA=
+
+--------=MIME_BOUNDARY--