Correctly pass query strings through component wiring redirects and improve format of XML and JSON response documents.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1074924 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0ee21c5d96
commit
7c018c6fb6
22 changed files with 500 additions and 221 deletions
|
|
@ -36,52 +36,56 @@ ostream* writer(const string& s, ostream* os) {
|
|||
return os;
|
||||
}
|
||||
|
||||
string itemEntry("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||
"<entry xmlns=\"http://www.w3.org/2005/Atom\">"
|
||||
"<title type=\"text\">item</title>"
|
||||
"<id>cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b</id>"
|
||||
"<content type=\"application/xml\">"
|
||||
"<item>"
|
||||
"<name>Apple</name><price>$2.99</price>"
|
||||
"</item>"
|
||||
"</content>"
|
||||
"<link href=\"cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b\"/>"
|
||||
const string itemEntry(
|
||||
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||
"<entry xmlns=\"http://www.w3.org/2005/Atom\">\n"
|
||||
" <title type=\"text\">item</title>\n"
|
||||
" <id>cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b</id>\n"
|
||||
" <content type=\"application/xml\">\n"
|
||||
" <item>\n"
|
||||
" <name>Apple</name>\n"
|
||||
" <price>$2.99</price>\n"
|
||||
" </item>\n"
|
||||
" </content>\n"
|
||||
" <link href=\"cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b\"/>\n"
|
||||
"</entry>\n");
|
||||
|
||||
string itemTextEntry("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||
"<entry xmlns=\"http://www.w3.org/2005/Atom\">"
|
||||
"<title type=\"text\">item</title>"
|
||||
"<id>cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b</id>"
|
||||
"<content type=\"text\">Apple</content>"
|
||||
"<link href=\"cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b\"/>"
|
||||
const string itemTextEntry("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||
"<entry xmlns=\"http://www.w3.org/2005/Atom\">\n"
|
||||
" <title type=\"text\">item</title>\n"
|
||||
" <id>cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b</id>\n"
|
||||
" <content type=\"text\">Apple</content>\n"
|
||||
" <link href=\"cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b\"/>\n"
|
||||
"</entry>\n");
|
||||
|
||||
string itemNoContentEntry("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||
"<entry xmlns=\"http://www.w3.org/2005/Atom\">"
|
||||
"<title type=\"text\">item</title>"
|
||||
"<id>cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b</id>"
|
||||
"<link href=\"cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b\"/>"
|
||||
const string itemNoContentEntry("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||
"<entry xmlns=\"http://www.w3.org/2005/Atom\">\n"
|
||||
" <title type=\"text\">item</title>\n"
|
||||
" <id>cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b</id>\n"
|
||||
" <link href=\"cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b\"/>\n"
|
||||
"</entry>\n");
|
||||
|
||||
string incompleteEntry("<entry xmlns=\"http://www.w3.org/2005/Atom\">"
|
||||
"<title>item</title><content type=\"text/xml\">"
|
||||
"<Item xmlns=\"http://services/\">"
|
||||
"<name xmlns=\"\">Orange</name>"
|
||||
"<price xmlns=\"\">3.55</price>"
|
||||
"</Item>"
|
||||
"</content>"
|
||||
"</entry>");
|
||||
const string incompleteEntry("<entry xmlns=\"http://www.w3.org/2005/Atom\">\n"
|
||||
" <title>item</title>\n"
|
||||
" <content type=\"text/xml\">\n"
|
||||
" <Item xmlns=\"http://services/\">\n"
|
||||
" <name xmlns=\"\">Orange</name>\n"
|
||||
" <price xmlns=\"\">3.55</price>\n"
|
||||
" </Item>\n"
|
||||
" </content>\n"
|
||||
"</entry>\n");
|
||||
|
||||
string completedEntry("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||
"<entry xmlns=\"http://www.w3.org/2005/Atom\">"
|
||||
"<title type=\"text\">item</title>"
|
||||
"<id></id>"
|
||||
"<content type=\"application/xml\">"
|
||||
"<Item xmlns=\"http://services/\">"
|
||||
"<name xmlns=\"\">Orange</name>"
|
||||
"<price xmlns=\"\">3.55</price>"
|
||||
"</Item>"
|
||||
"</content><link href=\"\"/>"
|
||||
const string completedEntry("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||
"<entry xmlns=\"http://www.w3.org/2005/Atom\">\n"
|
||||
" <title type=\"text\">item</title>\n"
|
||||
" <id></id>\n"
|
||||
" <content type=\"application/xml\">\n"
|
||||
" <Item xmlns=\"http://services/\">\n"
|
||||
" <name xmlns=\"\">Orange</name>\n"
|
||||
" <price xmlns=\"\">3.55</price>\n"
|
||||
" </Item>\n"
|
||||
" </content>\n"
|
||||
" <link href=\"\"/>\n"
|
||||
"</entry>\n");
|
||||
|
||||
bool testEntry() {
|
||||
|
|
@ -133,36 +137,38 @@ bool testEntry() {
|
|||
return true;
|
||||
}
|
||||
|
||||
string emptyFeed("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||
"<feed xmlns=\"http://www.w3.org/2005/Atom\">"
|
||||
"<title type=\"text\">Feed</title>"
|
||||
"<id>1234</id>"
|
||||
const string emptyFeed("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||
"<feed xmlns=\"http://www.w3.org/2005/Atom\">\n"
|
||||
" <title type=\"text\">Feed</title>\n"
|
||||
" <id>1234</id>\n"
|
||||
"</feed>\n");
|
||||
|
||||
string itemFeed("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||
"<feed xmlns=\"http://www.w3.org/2005/Atom\">"
|
||||
"<title type=\"text\">Feed</title>"
|
||||
"<id>1234</id>"
|
||||
"<entry xmlns=\"http://www.w3.org/2005/Atom\">"
|
||||
"<title type=\"text\">item</title>"
|
||||
"<id>cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b</id>"
|
||||
"<content type=\"application/xml\">"
|
||||
"<item>"
|
||||
"<name>Apple</name><price>$2.99</price>"
|
||||
"</item>"
|
||||
"</content>"
|
||||
"<link href=\"cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b\"/>"
|
||||
"</entry>"
|
||||
"<entry xmlns=\"http://www.w3.org/2005/Atom\">"
|
||||
"<title type=\"text\">item</title>"
|
||||
"<id>cart-53d67a61-aa5e-4e5e-8401-39edeba8b83c</id>"
|
||||
"<content type=\"application/xml\">"
|
||||
"<item>"
|
||||
"<name>Orange</name><price>$3.55</price>"
|
||||
"</item>"
|
||||
"</content>"
|
||||
"<link href=\"cart-53d67a61-aa5e-4e5e-8401-39edeba8b83c\"/>"
|
||||
"</entry>"
|
||||
const string itemFeed("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||
"<feed xmlns=\"http://www.w3.org/2005/Atom\">\n"
|
||||
" <title type=\"text\">Feed</title>\n"
|
||||
" <id>1234</id>\n"
|
||||
" <entry xmlns=\"http://www.w3.org/2005/Atom\">\n"
|
||||
" <title type=\"text\">item</title>\n"
|
||||
" <id>cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b</id>\n"
|
||||
" <content type=\"application/xml\">\n"
|
||||
" <item>\n"
|
||||
" <name>Apple</name>\n"
|
||||
" <price>$2.99</price>\n"
|
||||
" </item>\n"
|
||||
" </content>\n"
|
||||
" <link href=\"cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b\"/>\n"
|
||||
" </entry>\n"
|
||||
" <entry xmlns=\"http://www.w3.org/2005/Atom\">\n"
|
||||
" <title type=\"text\">item</title>\n"
|
||||
" <id>cart-53d67a61-aa5e-4e5e-8401-39edeba8b83c</id>\n"
|
||||
" <content type=\"application/xml\">\n"
|
||||
" <item>\n"
|
||||
" <name>Orange</name>\n"
|
||||
" <price>$3.55</price>\n"
|
||||
" </item>\n"
|
||||
" </content>\n"
|
||||
" <link href=\"cart-53d67a61-aa5e-4e5e-8401-39edeba8b83c\"/>\n"
|
||||
" </entry>\n"
|
||||
"</feed>\n");
|
||||
|
||||
bool testFeed() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue