Re: Setting HTTP Header for While sending SOAP Requests
tata pavan kumar <[email protected]> Wed, 28 Apr 2004 20:14:03 -0700
| Newsgroups | gmane.comp.windows.devel.soap.general |
|---|---|
| Message-ID | <[email protected]> |
Thanks for the reply. Yes. SOAP part is fine. The problem is., in server side the main tag "<?xml version='1.0' encoding='UTF-8'?>" is missing. Only SOAP part is going. Because of that, server couldn't process my request. I need to debug why that main tag is missing.. Mainly i am using these functions: First i am loading my xml template in memory and inserting proper values in proper places and calling these functins. Before calling this function,the main tag is there. doc = xmlParseMemory(xml_in_memory,length+1); After calling the above fn. and if i display the doc using function soap_env_new_from_doc(doc); i couldn't see the main tag. Is it problem in xmlParseMemory?? ii) env = soap_env_new_from_doc(doc); iii) res = soap_client_invoke(env, url, ""); Thanks & Regards, Pavan "Clemens F. Vasters" <[email protected]> wrote: The SOAP part is ok. The server is apparently dying with a NullPointerException after receiving the message and while Processing the request. You wouldn't be getting that response if This was a SOAP problem. SOAP-ENV:Server.Exception: java.lang.NullPointerException /soap/servlet/messagerouter -----Original Message----- From: Discussion of implementing SOAP applications today [mailto:[email protected]] On Behalf Of tata pavan kumar Sent: Wednesday, April 28, 2004 4:15 PM To: [email protected] Subject: [SOAP] Setting HTTP Header for While sending SOAP Requests Hi, I prepared a SOAP Client application.,it will take short message details and prepares SOAP Envelope and send it to SOAP Server. I used C SOAP library for this. Here the problem is.,i am getting error messages from the server. If i observe the server logs..the main xml header ( encoding='UTF-8'?>) doesn't appear in the request.,eventhough i put it in my program. And content type doesn't appear. Actually i didn't set http header. I want to know how to set this. Which function i have to use. My logic of the application is take xml template and fill the values, parse ti and invoke soap_client_invoke function to send the request. ( Shortly i) doc = xmlParseMemory(xml_in_memory,length+1); ii) env = soap_env_new_from_doc(doc); iii) res = soap_client_invoke(env, url, ""); Finally my problems are: I) How come xml header is missing 2) How to set HTTP Header... Please find request & response of message: POST /soap/servlet/messagerouter HTTP/1.1 Host: 202.6.80.67 Date: Wed, 28 Apr 04 16:00:02 GMT Content-Length: 666 SoapAction: xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP-ENV:encoding="http://schemas.xmlsoap.org/soap/encoding/"> smsgw smsgw 919825000359 jTesting 1 HTTP/1.1 500 Internal Server Error Server: Resin/2.1.6 Cache-Control: private Set-Cookie: JSESSIONID=a8NMuhIFZXO-; Path=/ Content-Type: text/xml; charset=utf-8 Content-Length: 479 Date: Wed, 28 Apr 2004 10:35:05 GMT Response: ------------- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> SOAP-ENV:Server.Exception: java.lang.NullPointerException /soap/servlet/messagerouter My XML Template: ----------------------------- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> $USERID $PASSWORD $DESTINATION $MESSAGE $MSGTYPE Any one help me..How to solve this?? Thanks & Regards, Pavankumar.. --------------------------------- Do you Yahoo!? Win a $20,000 Career Makeover at Yahoo! HotJobs --------------------------------- Do you Yahoo!? Win a $20,000 Career Makeover at Yahoo! HotJobs