Hi,

I am wanting to consume a web service (GetPrimeNumbers).

In order to do this, I have written a sample C code, which generates the xml 
request. However, while sending the request, I get an error 

"System.Web.Services.Protocols.SoapException: Server was unable to process 
request. ---> System.ArgumentOutOfRangeException: Length cannot be less than 
zero"

What could be the reason for this error ?

My request node looks like:
<ns0:GetPrimeNumbers xmlns:ns0="http://microsoft.com/webservices";>
<ns0:max>23</ns0:max>
</ns0:GetPrimeNumbers>

However, I think it should look like :

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:tns="http://www50.brinkster.com/vbfacileinpt/np"; 
xmlns:xs="http://www.w3.org/2001/XMLSchema";>
<soap:Body>
<tns:GetPrimeNumbers>
<tns:Max>10</tns:Max>
</tns:GetPrimeNumbers>
</soap:Body>
</soap:Envelope>

How do I modify the source code to send the soap:body and soap:envelope

Code listing :
--------------
tns = axiom_namespace_create(env, "http://microsoft.com/webservices";, "tns");
    echo_om_ele = axiom_element_create(env, NULL, "GetPrimeNumbers", tns, 
&echo_om_node);
    text_om_ele = axiom_element_create(env, echo_om_node, "max", tns, 
&text_om_node);
    axiom_element_set_text(text_om_ele, env, "10", text_om_node);
return echo_om_node;


Rgds,
Ramesh.



      Add more friends to your messenger and enjoy! Go to 
http://messenger.yahoo.com/invite/

Reply via email to