From: Surya K. <kas...@gm...> - 2013-06-21 09:20:01
|
I am having a Axis2 Apache Tomcat6 Server running a webservice. On the client side using ZSI as it supports attachments. The client side method is like this public String uploadFile(OMElement omEle) throws AxisFault { System.out.println( omEle.getText() ); return omEle.getText(); } I used wsdl2py script to here on client side wsdl2py -lb <my wsdl url here> Now, my python script is this from WebService_client import * from WebService_server import * from WebService_types import * import sys loc = WebServiceLocator() port = loc.getWebServiceHttpSoap11Endpoint(tracefile=sys.stdout) msg = uploadGpxFileRequest() file_url = "/output/t2.gpx" msg.OmEle = open(file_url, "rb").read() port.uploadGpxFile(msg) So, I am getting receiving the output but also seeing some errors raising on client! The below is the info I got on terminal 200 OK ------- Server: Apache-Coyote/1.1 Content-Type: multipart/related; boundary="MIMEBoundary_5baf77a976ecb100cea67d47217928ea46f8c7b8a66ad8cf"; type="text/xml"; start="<0.4baf77a976ecb100cea67d4721EDITEDg>" Transfer-Encoding: chunked Date: Mon, 17 Jun 2013 15:56:51 GMT --MIMEBoundary_5baf77a976ecb100cea67d47217928ea46f8c7b8a66ad8cf Content-Type: text/xml; charset=utf-8 Content-Transfer-Encoding: binary Content-ID: <0.4baf77a976ecb100cea67d47217928eaEDITEDg> <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv=" http://EDITEDvelope/"><soapenv:Body><ns:upEDITEDesponse xmlns:ns="http://G.......e"><ns:return><?xml version="1.0" encoding="UTF-8"?> <gpx xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http:/......1/0" version="1.0" xsi:schemaLocation="http://www.../0 http://w.../1/0/g..xsd" creator="my.py -- https://github.com/...."> <name>t2</name> <trk> <name>A Name</name> <desc>A track</desc> <trkseg> ------------------- data sent is here ------------------- <speed>13.2495155519</speed></trkpt></trkseg></trk></gpx></ns:return></ns:uploadGpxFileResponse></soapenv:Body></soapenv:Envelope> --MIMEBoundary_5baf77a976ecb100cea67d47217928ea46f8c7b8a66ad8cf-- Traceback (most recent call last): File "gpxupload.py", line 14, in <module> port.uploadGpxFile(msg) File "/home/developer/soap-client/WebService_client.py", line 81, in uploadGpxFile response = self.binding.Receive(uploadGpxFileResponse.typecode) File "/usr/local/lib/python2.7/dist-packages/ZSI-2.1_a1-py2.7.egg/ZSI/client.py", line 531, in Receive self.ReceiveSOAP(**kw) File "/usr/local/lib/python2.7/dist-packages/ZSI-2.1_a1-py2.7.egg/ZSI/client.py", line 416, in ReceiveSOAP 'Response is "%s", not "text/xml"' % self.reply_headers.type) TypeError: Response is "multipart/related", not "text/xml" *Where is it going wrong and how to fix it??? Thanks* |