You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hise-commits@incubator.apache.org by rr...@apache.org on 2010/08/31 15:02:56 UTC
svn commit: r991213 - in /incubator/hise/trunk:
hise-services/src/main/java/org/apache/hise/engine/jaxws/TaskOperationsBaseImpl.java
itest/simple-operations-tests.xml
Author: rr
Date: Tue Aug 31 15:02:56 2010
New Revision: 991213
URL: http://svn.apache.org/viewvc?rev=991213&view=rev
Log:
HISE-84: Attachment value is empty (fix thanks to Paweł Byszewski)
Modified:
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/TaskOperationsBaseImpl.java
incubator/hise/trunk/itest/simple-operations-tests.xml
Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/TaskOperationsBaseImpl.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/TaskOperationsBaseImpl.java?rev=991213&r1=991212&r2=991213&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/TaskOperationsBaseImpl.java (original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/TaskOperationsBaseImpl.java Tue Aug 31 15:02:56 2010
@@ -31,6 +31,7 @@ import java.util.Set;
import java.util.StringTokenizer;
import javax.jws.WebService;
+import javax.xml.crypto.dsig.XMLObject;
import javax.xml.namespace.QName;
import javax.xml.ws.WebServiceContext;
@@ -779,7 +780,7 @@ public abstract class TaskOperationsBase
String attachmentName = addAttachment.getAddAttachment().getName();
String accessType = addAttachment.getAddAttachment().getAccessType();
XmlObject attachment = addAttachment.getAddAttachment().getAttachment();
-
+
Task task = Task.load(hiseEngine, new Long(identifier));
TaskChecker.checkHumanRolePermission(HumanOperationName.ADD_ATTACHMENT, getUserString(), task, administrationMode);
@@ -790,8 +791,12 @@ public abstract class TaskOperationsBase
newAttachment.setAttachedAt(new Date());
newAttachment.setTask(taskDto);
newAttachment.setUserName(getUserString());
+ Node n,n1;
if(attachment.getDomNode() instanceof org.w3c.dom.Element){
- newAttachment.setAttachment(DOMUtil.getChildText(attachment.getDomNode()));
+
+
+
+ newAttachment.setAttachment(attachment.toString());
}
else{
newAttachment.setAttachment(new String(""));
@@ -955,7 +960,14 @@ public abstract class TaskOperationsBase
info.setContentType(a.getContentType());
ta.setAttachmentInfo(info);
- ta.addNewValue().set(XmlString.Factory.newValue(a.getAttachment()));
+ XmlObject xs=null;
+ try {
+ xs = XmlObject.Factory.parse(a.getAttachment());
+ } catch (XmlException e) {
+ throw new RuntimeException("Could not parse Attachment to XML");
+ }
+
+ ta.addNewValue().set(xs);
result.add(ta);
}
Modified: incubator/hise/trunk/itest/simple-operations-tests.xml
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/itest/simple-operations-tests.xml?rev=991213&r1=991212&r2=991213&view=diff
==============================================================================
--- incubator/hise/trunk/itest/simple-operations-tests.xml (original)
+++ incubator/hise/trunk/itest/simple-operations-tests.xml Tue Aug 31 15:02:56 2010
@@ -3802,7 +3802,7 @@ declare namespace htd2 = 'http://www.exa
</ClaimApprovalRequest>
</cla:approve>
</soapenv:Body>
-</soapenv:Envelope>]]></con:request><con:assertion type="SOAP Response"/><con:assertion type="SOAP Fault Assertion"/><con:credentials><con:username>user2</con:username><con:password>user2pass</con:password></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508" action="http://www.insurance.example.com/claims/ClaimsHandlingPT/approveRequest" to="" replyTo="${#Project#source}:8082/ClaimsResponseService/" addDefaultTo="true"/><con:wsrmConfig version="1.2"/></con:request></con:config></con:testStep><con:testStep type="properties" name="Properties"><con:settings/><con:config xsi:type="con:PropertiesStep" saveFirst="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:properties><con:property><con:name>tid</con:name><con:value>1612</con:value></con:property></con:properties></con:config></con:testStep><con:testStep type="transfer" name="Property Transfer"><con:settings/><con:config xsi
:type="con:PropertyTransfersStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:transfers setNullOnMissingSource="true" transferTextContent="true" failOnError="true" ignoreEmpty="false" transferToAll="false" useXQuery="true" entitize="false" transferChildNodes="false"><con:name>tid2</con:name><con:sourceType>Response</con:sourceType><con:sourceStep>approve</con:sourceStep><con:sourcePath><a>{*/*/*/text()}</a></con:sourcePath><con:targetType>tid</con:targetType><con:targetStep>Properties</con:targetStep></con:transfers></con:config></con:testStep><con:testStep type="request" name="get Attachments infos"><con:settings/><con:config xsi:type="con:RequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:interface>taskOperationsSOAP</con:interface><con:operation>getAttachmentInfos</con:operation><con:request name="get Attachments infos" wssPasswordType="PasswordDigest"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request
-headers"><xml-fragment/></con:setting></con:settings><con:encoding>UTF-8</con:encoding><con:endpoint>${#Project#destination}/taskOperations/</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.example.org/WS-HT/api/xsd">
+</soapenv:Envelope>]]></con:request><con:assertion type="SOAP Response"/><con:assertion type="SOAP Fault Assertion"/><con:credentials><con:username>user2</con:username><con:password>user2pass</con:password></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508" action="http://www.insurance.example.com/claims/ClaimsHandlingPT/approveRequest" to="" replyTo="${#Project#source}:8082/ClaimsResponseService/" addDefaultTo="true"/><con:wsrmConfig version="1.2"/></con:request></con:config></con:testStep><con:testStep type="properties" name="Properties"><con:settings/><con:config xsi:type="con:PropertiesStep" saveFirst="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:properties><con:property><con:name>tid</con:name><con:value>3401</con:value></con:property></con:properties></con:config></con:testStep><con:testStep type="transfer" name="Property Transfer"><con:settings/><con:config xsi
:type="con:PropertyTransfersStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:transfers setNullOnMissingSource="true" transferTextContent="true" failOnError="true" ignoreEmpty="false" transferToAll="false" useXQuery="true" entitize="false" transferChildNodes="false"><con:name>tid2</con:name><con:sourceType>Response</con:sourceType><con:sourceStep>approve</con:sourceStep><con:sourcePath><a>{*/*/*/text()}</a></con:sourcePath><con:targetType>tid</con:targetType><con:targetStep>Properties</con:targetStep></con:transfers></con:config></con:testStep><con:testStep type="request" name="get Attachments infos"><con:settings/><con:config xsi:type="con:RequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:interface>taskOperationsSOAP</con:interface><con:operation>getAttachmentInfos</con:operation><con:request name="get Attachments infos" wssPasswordType="PasswordDigest"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request
-headers"><xml-fragment/></con:setting></con:settings><con:encoding>UTF-8</con:encoding><con:endpoint>${#Project#destination}/taskOperations/</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.example.org/WS-HT/api/xsd">
<soapenv:Header/>
<soapenv:Body>
<xsd:getAttachmentInfos>
@@ -3852,7 +3852,7 @@ declare namespace ns4='http://www.insura
declare namespace ns3='http://www.example.org/WS-HT';
declare namespace soap='http://schemas.xmlsoap.org/soap/envelope/';
declare namespace ns1='http://www.example.org/WS-HT/api/xsd';
-<v>{//ns2:name/text()};{//ns2:attachedBy/text()}</v></path><content><v>attachment1attachment1;user1user1</v></content><allowWildcards>false</allowWildcards></con:configuration></con:assertion><con:credentials><con:username>user3</con:username><con:password>user3pass</con:password></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508"/><con:wsrmConfig version="1.2"/></con:request></con:config></con:testStep><con:testStep type="request" name="get Attachments infos - Request 2"><con:settings/><con:config xsi:type="con:RequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:interface>taskOperationsSOAP</con:interface><con:operation>getAttachmentInfos</con:operation><con:request name="get Attachments infos - Request 2" wssPasswordType="PasswordDigest"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers"><xml-fragment/></con:setti
ng></con:settings><con:encoding>UTF-8</con:encoding><con:endpoint>${#Project#destination}/taskOperations/</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.example.org/WS-HT/api/xsd">
+<v>{//ns2:name/text()};{//ns2:attachedBy/text()};{//a/text()}</v></path><content><v>attachment1attachment1;user1user1;testtest</v></content><allowWildcards>false</allowWildcards></con:configuration></con:assertion><con:credentials><con:username>user3</con:username><con:password>user3pass</con:password></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508"/><con:wsrmConfig version="1.2"/></con:request></con:config></con:testStep><con:testStep type="request" name="get Attachments infos - Request 2"><con:settings/><con:config xsi:type="con:RequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:interface>taskOperationsSOAP</con:interface><con:operation>getAttachmentInfos</con:operation><con:request name="get Attachments infos - Request 2" wssPasswordType="PasswordDigest"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers"><xml
-fragment/></con:setting></con:settings><con:encoding>UTF-8</con:encoding><con:endpoint>${#Project#destination}/taskOperations/</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.example.org/WS-HT/api/xsd">
<soapenv:Header/>
<soapenv:Body>
<xsd:getAttachmentInfos>
@@ -3872,7 +3872,12 @@ declare namespace ns1='http://www.exampl
<xsd:attachmentName>attachment1</xsd:attachmentName>
</xsd:getAttachments>
</soapenv:Body>
-</soapenv:Envelope>]]></con:request><con:assertion type="SOAP Response"/><con:assertion type="SOAP Fault Assertion"/><con:credentials><con:username>user3</con:username><con:password>user3pass</con:password><con:domain/></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508"/><con:wsrmConfig version="1.2"/></con:request></con:config></con:testStep><con:testStep type="request" name="get Attachments infos - Request 3"><con:settings/><con:config xsi:type="con:RequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:interface>taskOperationsSOAP</con:interface><con:operation>getAttachmentInfos</con:operation><con:request name="get Attachments infos - Request 3" wssPasswordType="PasswordDigest"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers"><xml-fragment/></con:setting></con:settings><con:encoding>UTF-8</con:encoding><con:endpoint>${#Proje
ct#destination}/taskOperations/</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.example.org/WS-HT/api/xsd">
+</soapenv:Envelope>]]></con:request><con:assertion type="SOAP Response"/><con:assertion type="SOAP Fault Assertion"/><con:assertion type="XQuery Match"><con:configuration><path>declare namespace ns2='http://www.example.org/WS-HT/api';
+declare namespace ns4='http://www.insurance.example.com/claims';
+declare namespace ns3='http://www.example.org/WS-HT';
+declare namespace soap='http://schemas.xmlsoap.org/soap/envelope/';
+declare namespace ns1='http://www.example.org/WS-HT/api/xsd';
+<v>{//ns2:name/text()};{//ns2:attachedBy/text()};{//a/text()}</v></path><content><v>attachment1attachment1;user1user1;testtest</v></content><allowWildcards>false</allowWildcards></con:configuration></con:assertion><con:credentials><con:username>user3</con:username><con:password>user3pass</con:password><con:domain/></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508"/><con:wsrmConfig version="1.2"/></con:request></con:config></con:testStep><con:testStep type="request" name="get Attachments infos - Request 3"><con:settings/><con:config xsi:type="con:RequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:interface>taskOperationsSOAP</con:interface><con:operation>getAttachmentInfos</con:operation><con:request name="get Attachments infos - Request 3" wssPasswordType="PasswordDigest"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-hea
ders"><xml-fragment/></con:setting></con:settings><con:encoding>UTF-8</con:encoding><con:endpoint>${#Project#destination}/taskOperations/</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.example.org/WS-HT/api/xsd">
<soapenv:Header/>
<soapenv:Body>
<xsd:getAttachmentInfos>