[AC-1239] Connecting to soap web service- Urgent!!!
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Not Our Bug |
Resolution Date | 2014-08-04T05:45:07.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | n/a |
Reporter | Dhaval Shah |
Assignee | Mauro Parra-Miranda |
Created | 2014-07-25T10:59:04.000+0000 |
Updated | 2016-03-08T07:37:37.000+0000 |
Description
Hi,
i have build the web service which is returning me the Json String.
I am passing 3 params...which is simple. No XML and no Json string for now.
Below is the code that i am requesting:
function doClick(e){
Titanium.API.info("You clicked the button");
xhr.open('POST','http://192.168.60.31:8080/SearchContactProcessor/SearchContactProcessorPort?wsdl');
xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xhr.send({
searchType:'CON',
searchString:'Ros',
addStr:''
});
};
Above code giving me below error :
(TiHttpClient-1) [700,40331] HTTP Error (org.apache.http.client.HttpResponseException): Unsupported Media Type
i have changed the content type to (text/xml) :
xhr.setRequestHeader("Content-Type","text/xml");
I got below error:
from titanium
-----------------
(TiHttpClient-1) [645,31890] HTTP Error (org.apache.http.client.HttpResponseException): Internal Server Error
from webservice
---------------------
Internal server is :
Caused by: com.sun.xml.ws.streaming.XMLStreamReaderException: XML reader error: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
Please help me on this.
I am stuck since two days on this.
Hello! The best way to test this is make sure that your webservice is working properly. Please get an extension of your favorite browser that allows you to run the webservice testing. Once you make sure the webservice is working, please print with Ti.API.info the response, and let's work from there. It's strange in your report you mention SOAP (which is XML by nature - http://stackoverflow.com/questions/9140299/why-not-soap-with-json) and later you mention JSON. Please you have to decide: either you are using SOAP (XML) or JSON. Best Regards!
Hi Mauro, thanks it is resolved now.I have Passed request xml in sent and convert response in json. You can close the call now.
Closed per last customer's comment.