• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic