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/23 14:18:24 UTC

cvs commit: ws-axis/c/tests/auto_build/testcases/output Attachment1Request.out

whitlock    2005/06/23 05:18:24

  Modified:    c/src/soap SoapAttachment.cpp SoapAttachmentHeaders.cpp
               c/tests/auto_build/testcases/client/cpp
                        Attachment1Client.cpp
               c/tests/auto_build/testcases/tests Attachment1.xml
  Added:       c/tests/auto_build/testcases/output Attachment1Request.out
  Log:
  Attachments: implement default values for mime headers and make addHeader replace existing header instead of adding another with the same name.
  
  Revision  Changes    Path
  1.17      +4 -0      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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- SoapAttachment.cpp	22 Jun 2005 15:45:38 -0000	1.16
  +++ SoapAttachment.cpp	23 Jun 2005 12:18:24 -0000	1.17
  @@ -49,6 +49,10 @@
   	m_pContentIdSet = pContentIdSet;
   	if (NULL!=m_pContentIdSet)
   		m_AttachmentHeaders->addHeader(AXIS_CONTENT_ID, pContentIdSet->generateId());
  +
  +	// Set up some sensible default values for mandatory headers.
  +	m_AttachmentHeaders->addHeader(AXIS_CONTENT_TYPE,"text/plain");
  +	m_AttachmentHeaders->addHeader(AXIS_CONTENT_TRANSFER_ENCODING,"base64");
   }
   
   SoapAttachment::~SoapAttachment()
  
  
  
  1.3       +5 -8      ws-axis/c/src/soap/SoapAttachmentHeaders.cpp
  
  Index: SoapAttachmentHeaders.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/SoapAttachmentHeaders.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SoapAttachmentHeaders.cpp	15 Jun 2005 21:25:00 -0000	1.2
  +++ SoapAttachmentHeaders.cpp	23 Jun 2005 12:18:24 -0000	1.3
  @@ -49,16 +49,13 @@
   void SoapAttachmentHeaders::addHeader(AxisString name, AxisString value)
   {
   	bool found = false;
  -	if (name == AXIS_CONTENT_ID)
  +	for (unsigned int i = 0; i < m_AttachHeaders.size (); i++)
   	{
  -		for (unsigned int i = 0; i < m_AttachHeaders.size (); i++)
  +		if (m_AttachHeaders[i].first == name)
   		{
  -			if (m_AttachHeaders[i].first == name)
  -			{
  -				m_AttachHeaders[i] = make_pair(name, value);
  -				found = true;
  -				break;
  -			}
  +			m_AttachHeaders[i] = make_pair(name, value);
  +			found = true;
  +			break;
   		}
   	}
   
  
  
  
  1.3       +5 -2      ws-axis/c/tests/auto_build/testcases/client/cpp/Attachment1Client.cpp
  
  Index: Attachment1Client.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/tests/auto_build/testcases/client/cpp/Attachment1Client.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Attachment1Client.cpp	22 Jun 2005 15:45:38 -0000	1.2
  +++ Attachment1Client.cpp	23 Jun 2005 12:18:24 -0000	1.3
  @@ -37,8 +37,11 @@
   			for (int i=0; i<NUM_ATTS; i++)
   			{
   				att[i] = ws.createSoapAttachment();
  -				att[i]->addHeader(AXIS_CONTENT_TYPE,"text/plain");
  -				att[i]->addHeader(AXIS_CONTENT_TRANSFER_ENCODING,"base64");
  +
  +				if (1==i)
  +					att[i]->addHeader(AXIS_CONTENT_TYPE,"image/jpeg");
  +				else if (2==i)
  +					att[i]->addHeader("Content-Disposition","checked");
   				
   				b64b[i].__ptr = (xsd__unsignedByte*)text;
   				b64b[i].__size = strlen(text)+1;
  
  
  
  1.2       +3 -0      ws-axis/c/tests/auto_build/testcases/tests/Attachment1.xml
  
  Index: Attachment1.xml
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/tests/auto_build/testcases/tests/Attachment1.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Attachment1.xml	21 Jun 2005 14:14:14 -0000	1.1
  +++ Attachment1.xml	23 Jun 2005 12:18:24 -0000	1.2
  @@ -8,6 +8,9 @@
           <output>
               Attachment1.expected
           </output>
  +        <request>
  +		Attachment1Request.out
  +	  </request>	
           <serverResponse>
   		Attachment1_ServerResponse.expected
           </serverResponse>
  
  
  
  1.1                  ws-axis/c/tests/auto_build/testcases/output/Attachment1Request.out
  
  Index: Attachment1Request.out
  ===================================================================
  POST /axis/Attachment1 HTTP/1.1
  Host: localhost:13260
  SOAPAction: ""
  Content-Type: multipart/related; type="text/xml"; boundary="------=MIME_BOUNDARY"; start="<8>"
  Content-Length: 1964
  
  
  --------=MIME_BOUNDARY
  Content-Type: text/xml; charset=UTF-8
  Content-Transfer-Encoding: binary
  Content-Id: <8>
  
  <?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://attachment1">
  <ns1:arg1 href="cid:1"
     xsi:type="ns2:Image"
     xmlns:ns2="http://xml.apache.org/xml-soap"/>
  <ns1:arg2 href="cid:2"
     xsi:type="ns2:PlainText"
     xmlns:ns2="http://xml.apache.org/xml-soap"/>
  <ns1:arg3 href="cid:3"
     xsi:type="ns2:Source"
     xmlns:ns2="http://xml.apache.org/xml-soap"/>
  <ns1:arg4 href="cid:4"
     xsi:type="ns2:octet-stream"
     xmlns:ns2="http://xml.apache.org/xml-soap"/>
  <ns1:arg5 href="cid:5"
     xsi:type="ns2:DataHandler"
     xmlns:ns2="http://xml.apache.org/xml-soap"/>
  <ns1:arg7 href="cid:6"
     xsi:type="ns2:DataHandler"
     xmlns:ns2="http://xml.apache.org/xml-soap"/>
  <ns1:arg8 xsi:nil="true"
     xsi:type="ns2:DataHandler"
     xmlns:ns2="http://xml.apache.org/xml-soap"/>
  </ns1:put>
  </SOAP-ENV:Body>
  </SOAP-ENV:Envelope>
  
  
  --------=MIME_BOUNDARY
  Content-Id: <1>
  Content-Type: text/plain
  Content-Transfer-Encoding: base64
  
  U29tZSBhdHRhY2htZW50IHRleHQA
  
  --------=MIME_BOUNDARY
  Content-Id: <2>
  Content-Type: image/jpeg
  Content-Transfer-Encoding: base64
  
  U29tZSBhdHRhY2htZW50IHRleHQA
  
  --------=MIME_BOUNDARY
  Content-Id: <3>
  Content-Type: text/plain
  Content-Transfer-Encoding: base64
  Content-Disposition: checked
  
  U29tZSBhdHRhY2htZW50IHRleHQA
  
  --------=MIME_BOUNDARY
  Content-Id: <4>
  Content-Type: text/plain
  Content-Transfer-Encoding: base64
  
  U29tZSBhdHRhY2htZW50IHRleHQA
  
  --------=MIME_BOUNDARY
  Content-Id: <5>
  Content-Type: text/plain
  Content-Transfer-Encoding: base64
  
  U29tZSBhdHRhY2htZW50IHRleHQA
  
  --------=MIME_BOUNDARY
  Content-Id: <6>
  Content-Type: text/plain
  Content-Transfer-Encoding: base64
  
  U29tZSBhdHRhY2htZW50IHRleHQA
  
  --------=MIME_BOUNDARY--