xWeb Namespace
The namespace of xWeb is http://www.avectra.com/2005.
Since this namespace is in the form of a URL, a common confusion and mistake is that this is the URL of the xWeb web service. http://www.avectra.com/2005 is not the URL of the web service. It is not the location of the schema.
The URL of xWeb endpoint is in the following form:
https://netforumsite/xweb/secure/netForumXML.asmx
where netformsite is the actual host name of the NetForum application, for example, www.abcde.org.
Formatting Requests with Namespace
Many of the complex xWeb Objects such as Shopping Cart Object, Registrant Object require setting the namespace correctly when these Objects are passed as parameters to web methods.
When you send a request, you have two options.
You can set a default namespace in the parameter you pass, as shown on lines 9 and 24. This option is preferable because it's shorter and easier to read by a human for troubleshooting/diagnostics.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.avectra.com/2005/"> <soapenv:Header> <ns:AuthorizationToken> <ns:Token>?</ns:Token> </ns:AuthorizationToken> </soapenv:Header> <soapenv:Body> <ns:WEBCentralizedShoppingCartGetEventFees> <oRegistration xmlns="http://www.avectra.com/2005/"> <CurrentKey>?</CurrentKey> <Registrant> <reg_prod_qty>?</reg_prod_qty> <reg_key>?</reg_key> <reg_cst_key>?</reg_cst_key> <!-- additional elements omitted for brevity --> </Registrant> <Individual> <ind_cst_key>?</ind_cst_key> <ind_prf_code>?</ind_prf_code> <ind_first_name>?</ind_first_name> </Individual> <!-- additional Data Object nodes omitted for brevity --> </oRegistration> <oCOE xmlns="http://www.avectra.com/2005/"> <CurrentKey>?</CurrentKey> <Invoice> <inv_key>?</inv_key> <inv_proforma>?</inv_proforma> <inv_code>?</inv_code> <!-- additional elements omitted for brevity --> </Invoice> <!-- additional Data Object nodes omitted for brevity --> </oCOE> </ns:WEBCentralizedShoppingCartGetEventFees> </soapenv:Body> </soapenv:Envelope>
Alternately, you can provide a namespace for every element, for example:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.avectra.com/2005/">
<soapenv:Header>
<ns:AuthorizationToken>
<ns:Token>?</ns:Token>
</ns:AuthorizationToken>
</soapenv:Header>
<soapenv:Body>
<ns:WEBCentralizedShoppingCartGetEventFees>
<ns:oRegistration>
<ns:CurrentKey>?</ns:CurrentKey>
<ns:Registrant>
<ns:reg_prod_qty>?</ns:reg_prod_qty>
<ns:reg_key>?</ns:reg_key>
<ns:reg_cst_key>?</ns:reg_cst_key>
<!-- additional elements omitted for brevity -->
</ns:Registrant>
<ns:Individual>
<ns:ind_cst_key>?</ns:ind_cst_key>
<ns:ind_prf_code>?</ns:ind_prf_code>
<ns:ind_first_name>?</ns:ind_first_name>
</ns:Individual>
<!-- additional Data Object nodes omitted for brevity -->
</ns:oRegistration>
<ns:oCOE>
<ns:CurrentKey>?</ns:CurrentKey>
<ns:Invoice>
<ns:inv_key>?</ns:inv_key>
<ns:inv_proforma>?</ns:inv_proforma>
<ns:inv_code>?</ns:inv_code>
<!-- additional elements omitted for brevity -->
</ns:Invoice>
<!-- additional Data Object nodes omitted for brevity -->
</ns:oCOE>
</ns:WEBCentralizedShoppingCartGetEventFees>
</soapenv:Body>
</soapenv:Envelope>
Either of these requests will work. The major difference between the two is that in the first request, we default the namespace in the parameter, and we omit the namespace for the elements within each parameter. This line will default the namespace for all elements within the parameter:
<oRegistration xmlns="http://www.avectra.com/2005/">
You must do this for each parameter.
Namespaces in xWeb Responses
When most xWeb web methods return a response, the response provides a default namespace, as shown here in the <AuthorizationToken> node on line 4 and the <WEBCentralizedShoppingCartGetEventFeesResponse> node on line 9.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Header> <AuthorizationToken xmlns="http://www.avectra.com/2005/"> <Token>d5aa344e-5688-4490-a8b8-d1e85066f04d</Token> </AuthorizationToken> </soap:Header> <soap:Body> <WEBCentralizedShoppingCartGetEventFeesResponse xmlns="http://www.avectra.com/2005/"> <WEBCentralizedShoppingCartGetEventFeesResult> <Results recordReturn="2"> <Result> <prd_key>d07e434d-4544-4a8d-9a90-fc97b58dc1ee</prd_key> <Product>Event Fund</Product> <prd_short_description/> <prc_key>1d976e24-5661-4aa8-84d6-50915f43ebd2</prc_key> <prc_display_name>Event Fund</prc_display_name> <ptp_key>1a8be41b-7e30-4d45-b3ab-c290ae1e73a6</ptp_key> <ptp_online_code>Fundraising Activities</ptp_online_code> <pat_prc_key/> <Price>200</Price> <prc_available>0</prc_available> <prc_membertypeapplies>1</prc_membertypeapplies> <prc_status/> <Category/> <cur_key/> <prc_qty_min/> <prc_qty_max/> </Result> <Result> <prd_key>d07e434d-4544-4a8d-9a90-fc97b58dc1ee</prd_key> <Product>Gold Table</Product> <prd_short_description/> <prc_key>173938d9-0521-44e2-9358-e1f37dd69131</prc_key> <prc_display_name>Gold Table</prc_display_name> <ptp_key>1a8be41b-7e30-4d45-b3ab-c290ae1e73a6</ptp_key> <ptp_online_code>Fundraising Activities</ptp_online_code> <pat_prc_key/> <Price>500</Price> <prc_available>0</prc_available> <prc_membertypeapplies>1</prc_membertypeapplies> <prc_status/> <Category/> <cur_key/> <prc_qty_min/> <prc_qty_max/> </Result> </Results> </WEBCentralizedShoppingCartGetEventFeesResult> </WEBCentralizedShoppingCartGetEventFeesResponse> </soap:Body> </soap:Envelope>