Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Anjana Patil
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic