29 |
|
|
30 |
import java.net.HttpURLConnection; |
import java.net.HttpURLConnection; |
31 |
import java.net.MalformedURLException; |
import java.net.MalformedURLException; |
|
import java.net.URISyntaxException; |
|
|
import java.net.URI; |
|
32 |
|
|
33 |
import java.util.List; |
import java.util.List; |
34 |
|
|
|
import static javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI; |
|
|
|
|
35 |
import static nongnu.cashews.commons.Configuration.CASHEWS_VERSION; |
import static nongnu.cashews.commons.Configuration.CASHEWS_VERSION; |
36 |
|
|
37 |
import nongnu.cashews.language.grounding.MessagePart; |
import nongnu.cashews.language.grounding.MessagePart; |
38 |
import nongnu.cashews.language.grounding.SoapMessage; |
import nongnu.cashews.language.grounding.SoapMessage; |
39 |
import nongnu.cashews.language.grounding.SoapOperation; |
import nongnu.cashews.language.grounding.SoapOperation; |
40 |
|
|
|
import static nongnu.cashews.services.Processes.TEST_COMPOSITE_SEQUENCE; |
|
|
|
|
41 |
import nongnu.cashews.xml.Serializer; |
import nongnu.cashews.xml.Serializer; |
42 |
import nongnu.cashews.xml.schema.TypeMapper; |
import nongnu.cashews.xml.schema.TypeMapper; |
43 |
|
|
85 |
connection.connect(); |
connection.connect(); |
86 |
/* |
/* |
87 |
System.out.println(connection.getContent()); |
System.out.println(connection.getContent()); |
88 |
|
*/ |
89 |
InputStream istream = connection.getInputStream(); |
InputStream istream = connection.getInputStream(); |
90 |
BufferedReader reader = new BufferedReader(new InputStreamReader(istream)); |
BufferedReader reader = new BufferedReader(new InputStreamReader(istream)); |
91 |
String line = reader.readLine(); |
String line = reader.readLine(); |
94 |
System.out.println(line); |
System.out.println(line); |
95 |
line = reader.readLine(); |
line = reader.readLine(); |
96 |
} |
} |
97 |
|
/* |
98 |
return null; |
return null; |
99 |
*/ |
*/ |
100 |
if (connection.getResponseCode() == 200) |
if (connection.getResponseCode() == 200) |
144 |
return Serializer.finalizeXmlDocument(document, env, null); |
return Serializer.finalizeXmlDocument(document, env, null); |
145 |
} |
} |
146 |
|
|
|
/** |
|
|
* Test harness which performs a workflow request with a test |
|
|
* composite process. |
|
|
* |
|
|
* @param args the command-line arguments. |
|
|
* @throws IOException if an I/O error occurs. |
|
|
* @throws URISyntaxException if one of the operation URIs is invalid. |
|
|
* @throws MalformedURLException if the endpoint URL is invalid. |
|
|
* @throws InstantiationException if a needed class can't be instantiated. |
|
|
* @throws IllegalAccessException if a needed class can't be accessed. |
|
|
* @throws ClassNotFoundException if a needed class can't be found. |
|
|
*/ |
|
|
public static void main(String[] args) |
|
|
throws URISyntaxException, MalformedURLException, IOException, |
|
|
InstantiationException, IllegalAccessException, |
|
|
ClassNotFoundException |
|
|
{ |
|
|
SoapClient client = new SoapClient(); |
|
|
SoapOperation operation = new SoapOperation |
|
|
("http://repton.no-ip.com:8080/workflowService"); |
|
|
SoapMessage input = new SoapMessage(null, "workflowRequest"); |
|
|
MessagePart part1 = new MessagePart("endpoint"); |
|
|
part1.setName(null, "endpoint"); |
|
|
part1.setType(W3C_XML_SCHEMA_NS_URI, "anyURI", "xsd"); |
|
|
MessagePart part2 = new MessagePart("process"); |
|
|
part2.setName(null, "process"); |
|
|
input.addPart(part1); |
|
|
input.addPart(part2); |
|
|
operation.setInputMessage(input); |
|
|
client.call(operation, new URI("testWorkflow3"), TEST_COMPOSITE_SEQUENCE); |
|
|
} |
|
|
|
|
147 |
} |
} |