Win a copy of Java Persistence with Spring Data and Hibernate this week in the Spring forum!
  • 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
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

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
 
Live ordinary life in an extraordinary way. Details embedded in this tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic