1
0
Fork 0

updates to MM7/SOAP: Add mm7 namespace to all tags

This commit is contained in:
bagyenda 2006-10-19 07:30:21 +00:00
parent 63b90a7845
commit 89fbf157c8
1 changed files with 23 additions and 23 deletions

View File

@ -320,10 +320,10 @@ static int append_address(Octstr *p, Octstr *addr_spec)
j = octstr_case_search(v, octstr_imm("/TYPE=PLMN"),0); j = octstr_case_search(v, octstr_imm("/TYPE=PLMN"),0);
if (j >= 0) { if (j >= 0) {
Octstr *z = octstr_copy(v, 2, j-2); /* skip the initial char that is only for info purposes. */ Octstr *z = octstr_copy(v, 2, j-2); /* skip the initial char that is only for info purposes. */
octstr_format_append(p, "<Number%s>%S</Number>\n", y, z); octstr_format_append(p, "<mm7:Number%s>%S</mm7:Number>\n", y, z);
octstr_destroy(z); octstr_destroy(z);
} else } else
octstr_format_append(p, "<RFC2822Address%s>%s</RFC2822Address>\n", octstr_format_append(p, "<mm7:RFC2822Address%s>%s</mm7:RFC2822Address>\n",
y, octstr_get_cstr(v) + 2); /* as above... */ y, octstr_get_cstr(v) + 2); /* as above... */
return 0; return 0;
} }
@ -340,16 +340,16 @@ static void output_rcpt(char *hdr, List *hdrs, Octstr *p)
if (octstr_str_compare(h, x) != 0) { if (octstr_str_compare(h, x) != 0) {
if (x[0]) if (x[0])
octstr_format_append(p, "</%s>\n", x); octstr_format_append(p, "</mm7:%s>\n", x);
strncpy(x, octstr_get_cstr(h), sizeof x); strncpy(x, octstr_get_cstr(h), sizeof x);
octstr_format_append(p, "<%S>\n", h); octstr_format_append(p, "<mm7:%S>\n", h);
} }
octstr_destroy(h); octstr_destroy(h);
append_address(p, v); append_address(p, v); /* put the address in */
octstr_destroy(v); octstr_destroy(v);
} }
if (x[0]) /* close it off. */ if (x[0]) /* close it off. */
octstr_format_append(p, "</%s>\n", x); octstr_format_append(p, "</mm7:%s>\n", x);
http_destroy_headers(l); http_destroy_headers(l);
} }
@ -404,7 +404,7 @@ Octstr *headers_to_soapxml(List *hdrs)
/* Output the details. */ /* Output the details. */
p = http_header_value(hdrs, octstr_imm("MM7Version")); p = http_header_value(hdrs, octstr_imm("MM7Version"));
octstr_format_append(s, "<MM7Version>%S</MM7Version>\n", p); octstr_format_append(s, "<mm7:MM7Version>%S</mm7:MM7Version>\n", p);
octstr_destroy(p); octstr_destroy(p);
p = http_header_value(hdrs, octstr_imm("VASPID")); p = http_header_value(hdrs, octstr_imm("VASPID"));
@ -412,21 +412,21 @@ Octstr *headers_to_soapxml(List *hdrs)
r = http_header_value(hdrs, octstr_imm("SenderAddress")); r = http_header_value(hdrs, octstr_imm("SenderAddress"));
if (p || q || r) { if (p || q || r) {
octstr_append_cstr(s, "<SenderIdentification>\n"); octstr_append_cstr(s, "<mm7:SenderIdentification>\n");
if (p) if (p)
octstr_format_append(s, "<VASPID>%S</VASPID>\n", p); octstr_format_append(s, "<mm7:VASPID>%S</mm7:VASPID>\n", p);
if (q) if (q)
octstr_format_append(s, "<VASID>%S</VASID>\n", q); octstr_format_append(s, "<mm7:VASID>%S</mm7:VASID>\n", q);
if (r) { if (r) {
Octstr *xx = octstr_create(""); Octstr *xx = octstr_create("");
append_address(xx, r); append_address(xx, r);
octstr_format_append(s, "<SenderAddress>%S</SenderAddress>\n", xx); octstr_format_append(s, "<mm7:SenderAddress>%S</mm7:SenderAddress>\n", xx);
octstr_destroy(xx); octstr_destroy(xx);
} }
octstr_append_cstr(s, "</SenderIdentification>\n"); octstr_append_cstr(s, "</mm7:SenderIdentification>\n");
if (p) octstr_destroy(p); if (p) octstr_destroy(p);
if (q) octstr_destroy(q); if (q) octstr_destroy(q);
if (r) octstr_destroy(r); if (r) octstr_destroy(r);
@ -440,10 +440,10 @@ Octstr *headers_to_soapxml(List *hdrs)
output_rcpt("Bcc", hdrs, p); output_rcpt("Bcc", hdrs, p);
if (octstr_len(p) > 0) if (octstr_len(p) > 0)
octstr_format_append(s, "<Recipients>\n%S</Recipients>\n", p); octstr_format_append(s, "<mm7:Recipients>\n%S</mm7:Recipients>\n", p);
} else if ((q = http_header_value(hdrs, octstr_imm("To"))) != NULL) { } else if ((q = http_header_value(hdrs, octstr_imm("To"))) != NULL) {
append_address(p, q); append_address(p, q);
octstr_format_append(s, "<Recipient>\n%S</Recipient>\n", p); octstr_format_append(s, "<mm7:Recipient>\n%S</mm7:Recipient>\n", p);
octstr_destroy(q); octstr_destroy(q);
} }
octstr_destroy(p); octstr_destroy(p);
@ -484,19 +484,19 @@ Octstr *headers_to_soapxml(List *hdrs)
case MM7_TAG_Sender: case MM7_TAG_Sender:
p = octstr_create(""); p = octstr_create("");
append_address(p, v); append_address(p, v);
octstr_format_append(s, "<Sender>%S</Sender>\n", p); octstr_format_append(s, "<mm7:Sender>%S</mm7:Sender>\n", p);
octstr_destroy(p); octstr_destroy(p);
skip = 1; skip = 1;
break; break;
case MM7_TAG_Content: case MM7_TAG_Content:
octstr_format_append(s, "<Content href=\"%S\"/>\n", v); octstr_format_append(s, "<mm7:Content href=\"%S\"/>\n", v);
skip = 1; skip = 1;
break; break;
case MM7_TAG_ReplyCharging: case MM7_TAG_ReplyCharging:
p = http_header_value(hdrs, octstr_imm("replyChargingSize")); p = http_header_value(hdrs, octstr_imm("replyChargingSize"));
q = http_header_value(hdrs, octstr_imm("replyDeadline")); q = http_header_value(hdrs, octstr_imm("replyDeadline"));
octstr_append_cstr(s, "<ReplyCharging"); octstr_append_cstr(s, "<mm7:ReplyCharging");
if (p) { if (p) {
octstr_format_append(s, " replyChargingSize=\"%S\"", p); octstr_format_append(s, " replyChargingSize=\"%S\"", p);
octstr_destroy(p); octstr_destroy(p);
@ -521,22 +521,22 @@ Octstr *headers_to_soapxml(List *hdrs)
q = http_header_value(hdrs, octstr_imm("StatusText")); q = http_header_value(hdrs, octstr_imm("StatusText"));
octstr_append_cstr(s, "<Status>\n"); octstr_append_cstr(s, "<mm7:Status>\n");
if (p) { if (p) {
octstr_format_append(s, "<StatusCode>%S</StatusCode>\n", p); octstr_format_append(s, "<mm7:StatusCode>%S</mm7:StatusCode>\n", p);
octstr_destroy(p); octstr_destroy(p);
} }
if (q) { if (q) {
octstr_format_append(s, "<StatusText>%S</StatusText>\n", q); octstr_format_append(s, "<mm7:StatusText>%S</mm7:StatusText>\n", q);
octstr_destroy(q); octstr_destroy(q);
} }
q = http_header_value(hdrs, octstr_imm("Details")); q = http_header_value(hdrs, octstr_imm("Details"));
if (q) { if (q) {
octstr_format_append(s, "<Details>%S</Details>\n", q); octstr_format_append(s, "<mm7:Details>%S</mm7:Details>\n", q);
octstr_destroy(q); octstr_destroy(q);
} }
octstr_append_cstr(s, "</Status>\n"); octstr_append_cstr(s, "</mm7:Status>\n");
skip = 1; skip = 1;
break; break;
@ -545,7 +545,7 @@ Octstr *headers_to_soapxml(List *hdrs)
} }
if (!skip && h && v) if (!skip && h && v)
octstr_format_append(s, "<%S>%S</%S>\n", h, v, h); octstr_format_append(s, "<mm7:%S>%S</mm7:%S>\n", h, v, h);
if (h) octstr_destroy(h); if (h) octstr_destroy(h);
if (v) octstr_destroy(v); if (v) octstr_destroy(v);