[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wsf-c-commits
Subject:    [Wsf-c-commits] svn commit r31393 - in trunk/wsf/cpp/examples: .
From:       nandika () wso2 ! com
Date:       2009-02-24 7:08:52
Message-ID: E1LbrPQ-0002hI-15 () wso2 ! org
[Download RAW message or body]

Author: nandika
Date: Mon Feb 23 23:08:51 2009
New Revision: 31393
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=31393

Log:
sample updated

Modified:
   trunk/wsf/cpp/examples/samples.mk
   trunk/wsf/cpp/examples/services/mtomcpp/mtom.cpp

Modified: trunk/wsf/cpp/examples/samples.mk
URL: http://wso2.org/svn/browse/wso2/trunk/wsf/cpp/examples/samples.mk?rev=31393&r1=31392&r2=31393&view=diff
 ==============================================================================
--- trunk/wsf/cpp/examples/samples.mk	(original)
+++ trunk/wsf/cpp/examples/samples.mk	Mon Feb 23 23:08:51 2009
@@ -153,8 +153,16 @@
 	-@$(_VC_MANIFEST_EMBED_EXE)
 	@copy  /Y $(SERVICES_SAMPLES_HOME_DIR)\echocpp\services.xml \
$(WSFCPP_HOME_DIR)\services\echocpp\services.xml  
+mtom_service:
+	@if not exist int.msvc\services\mtomcpp mkdir int.msvc\services\mtomcpp
+	@if not exist $(WSFCPP_HOME_DIR)\services\mtomcpp mkdir \
$(WSFCPP_HOME_DIR)\services\mtomcpp +	$(CC) $(CFLAGS) $(INCLUDE_PATH) \
$(SERVICES_SAMPLES_HOME_DIR)\mtomcpp\*.cpp /Foint.msvc\services\mtomcpp\ /c +	$(LD) \
$(LDFLAGS) int.msvc\services\mtomcpp\*.obj $(LIBS) /DLL \
/OUT:$(WSFCPP_HOME_DIR)\services\mtomcpp\mtomcpp.dll +	-@$(_VC_MANIFEST_EMBED_EXE)
+	@copy  /Y $(SERVICES_SAMPLES_HOME_DIR)\mtomcpp\services.xml \
$(WSFCPP_HOME_DIR)\services\mtomcpp\services.xml +
+wsfcpp_samples: int_dir echo_samples flickr_exe google_exe math_exe notify_exe \
yahoo_exe mtom_exe echo_service mtom_service  
-wsfcpp_samples: int_dir echo_samples flickr_exe google_exe math_exe notify_exe \
yahoo_exe mtom_exe echo_service  
 clean: 
 	@if exist int.msvc rmdir /s /q int.msvc

Modified: trunk/wsf/cpp/examples/services/mtomcpp/mtom.cpp
URL: http://wso2.org/svn/browse/wso2/trunk/wsf/cpp/examples/services/mtomcpp/mtom.cpp?rev=31393&r1=31392&r2=31393&view=diff
 ==============================================================================
--- trunk/wsf/cpp/examples/services/mtomcpp/mtom.cpp	(original)
+++ trunk/wsf/cpp/examples/services/mtomcpp/mtom.cpp	Mon Feb 23 23:08:51 2009
@@ -28,47 +28,54 @@
 
 OMElement* MTOMService::invoke(OMElement *ele, MessageContext *msgCtx)
 {
-	/* Expected request format is :-
-	* <ns1:mtomSample xmlns:ns1="http://ws.apache.org/axis2/c/samples">
-	<ns1:fileName>test.jpg</ns1:fileName>
-	<ns1:image>
-	<xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" \
                href="cid:1.dd5183d4-d58a-1da1-2578-001125b4c063@apache.org"></xop:Include>
                
-	</ns1:image>
-	</ns1:mtomSample>
+	/* Expected request format is :-
+	* <ns1:mtomSample xmlns:ns1="http://ws.apache.org/axis2/c/samples">
+		<ns1:fileName>test.jpg</ns1:fileName>
+		<ns1:image>
+			<xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" \
href="cid:1.dd5183d4-d58a-1da1-2578-001125b4c063@apache.org"></xop:Include> \
+		</ns1:image> +	</ns1:mtomSample>
 	*/
 	if(ele)
 	{	
-		OMNode *node1, *node2, *node3;
-		OMElement *ele1,*ele2,*ele3;
+		OMElement *fileNameEle,*imageEle;
 		OMText *text = NULL;
+		OMDataHandler *dh = NULL;
 		try
 		{	
-		    node1 =ele->getFirstChild();
-			ele1 = dynamic_cast<OMElement *>(node1);
-		}catch (bad_cast) {}
+			fileNameEle = dynamic_cast<OMElement *>(ele->getFirstChild());
 
-			node2 = ele1->getFirstChild();
-			if(node2->nodeType() == AXIOM_TEXT)
+			if(fileNameEle && fileNameEle->getFirstChild() && \
fileNameEle->getFirstChild()->nodeType() == AXIOM_TEXT)  {
-				text = dynamic_cast<OMText*>(node2);
+				text = dynamic_cast<OMText*>(fileNameEle->getFirstChild());
 				string filename = text->getValue();
 
-				OMNode *binary_node = node2->getNextSibling();
-				if(binary_node)
+				imageEle = dynamic_cast<OMElement*>(fileNameEle->getNextSibling());
+				if(imageEle)
 				{
-					OMDataHandler *dh = NULL;
-					dh = text->getDataHandler();
-					if(dh && !(dh->isCached()))
+					
+					OMText *imageText = dynamic_cast<OMText*>(imageEle->getFirstChild());
+					if(imageText)
 					{
-						dh->setFileName(filename);
-						dh->writeTo();
+						dh = imageText->getDataHandler();
+						if(dh && !(dh->isCached()))
+						{
+							dh->setFileName(filename);
+							dh->writeTo();
+						}
+						dh->getInputStream()
 					}
 				}
 			}
-		
+		}catch (bad_cast) 
+		{
+
+		}
+		OMElement *resultEle = new OMElement("response", new \
OMNamespace("http://ws.apache.org/wsf/cpp/samples","ns1")); +		OMDataHandler \
*reponseDh = new OMDataHandler();  
-					
 	}
+	
 	return NULL;
 }
 

_______________________________________________
Wsf-c-commits mailing list
Wsf-c-commits@wso2.org
https://wso2.org/cgi-bin/mailman/listinfo/wsf-c-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic