Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1239] Connecting to soap web service- Urgent!!!

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNot Our Bug
Resolution Date2014-08-04T05:45:07.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterDhaval Shah
AssigneeMauro Parra-Miranda
Created2014-07-25T10:59:04.000+0000
Updated2016-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.

Comments

  1. Mauro Parra-Miranda 2014-08-03

    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!
  2. Dhaval Shah 2014-08-04

    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.
  3. Mauro Parra-Miranda 2014-08-04

    Closed per last customer's comment.

JSON Source