It's not a secret anymore!*
The moose likes Android and the fly likes ksoap2 libray: trying to set up header element of soap envelope Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "ksoap2 libray: trying to set up header element of soap envelope" Watch "ksoap2 libray: trying to set up header element of soap envelope" New topic
Author

ksoap2 libray: trying to set up header element of soap envelope

Anjana Patil
Greenhorn

Joined: Apr 19, 2010
Posts: 1
Hi

I am writing android app for using Ebay Finding API Call, using kSoap2 only. My goal is to set up the following as soap header elements for the envelope

X-EBAY-SOA-SERVICE-NAME: FindingService
X-EBAY-SOA-OPERATION-NAME: findItemsAdvanced
X-EBAY-SOA-SERVICE-VERSION: 1.0.0
X-EBAY-SOA-GLOBAL-ID: EBAY-US
X-EBAY-SOA-SECURITY-APPNAME: MyAppID
X-EBAY-SOA-REQUEST-DATA-FORMAT: XML

In my code, I am setting up
//Adding soap header
Element[] header = new Element[6];

header[0] = new Element().createElement(NAMESPACE, "HEADER");
Element appname = new Element().createElement(NAMESPACE, "X-EBAY-SOA-SECURITY-APPNAME");
appname.addChild(Node.TEXT, "Student63-f92b-wxyx-abcd-5ae8ea42fd8"); //APPID,APPNAME is mutated and not valid values.
header[0].addChild(Node.ELEMENT, appname);

likewise I add the header[1], header[2], header[3], header[4], header[5]

and then envelope.headerOut=header;

This is giving me SoapFault- faultcode: 'axis2ns3:Server' faultString:'Missing SOA operation name header' faultfactor: 'null' details: org.kxml2.kdom.Node4379f818

Please note, the following URL in AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(URL); doesn't work
http://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsByKeywords&SERVICE-VERSION=1.0.0&SECURITY-APPNAME=Student63-f92b-wxyx-abcd-5ae8ea42fd8&RESPONSE-DATA-FORMAT=XML&REST-PAYLOAD&paginationInput.entriesPerPage=2&keywords=harry%20potter%20phoenix
APPID,APPNAME is mutated and not valid values.

Any idea? I appreciate your insight or thoughts. Thanks for your time.

Regards,
Anj
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ksoap2 libray: trying to set up header element of soap envelope
 
Similar Threads
WebServices and Android
webmethod of Doc/Lit bare style with only one header param generates part="" invalid wsdl soap:body
Including information in the SOAP header in a web service invocation.
BP-compliant SOAP Envelope's namespace
Reading a SOAP Response/Handlers