How to consume XML WSDL with Header Authentication?

Posted on 2010-11-29
Last Modified: 2013-11-19
I have a web service I'm trying to program to.  I've used other web services (XML) fine, but this one is perplexing me; as it requires header authentication.


The documentation for it is at

I'm interested in doing simple operations such as getChannel, and createChannel

Any help would be greatly appreciated....
Question by:adworldmedia

Accepted Solution

r3nder earned 250 total points
ID: 34231308
Its just authentication - real simple
Get channel is just
public: static IChannel GetChannel( String name);
CreateChannel() in code below

IChannelFactory<IRequestChannel> factory = binding.BuildChannelFactory<IRequestChannel>(bindingParams);


EndpointAddress address = new EndpointAddress("http://localhost:8000/ChannelApp");

IRequestChannel channel = factory.CreateChannel(address);


Open in new window

LVL 29

Assisted Solution

by:Kumaraswamy R
Kumaraswamy R earned 250 total points
ID: 34238246

Author Comment

ID: 34257919
Thanks for the replies, but neither of them really are helping me much...  I've attached a snippet of java code, that does what I want.  I would need it converted to C#.. any one that can help, thanks in advance!
import com.zedo.zapi.*;

import com.zedo.zapi.ZEDOAPIStub.*;

import javax.xml.namespace.QName;

import org.apache.axis2.AxisFault;

public class GetChannelTest {

    public static void main(String[] args) {



    private static void getChannelTest() {


        try {


            ZEDOAPIStub stub = new ZEDOAPIStub("");

                stub._getServiceClient().addStringHeader(new QName("", "user", "zedoapi"),     "");

                stub._getServiceClient().addStringHeader(new QName("", "password", "zedoapi"),     "password");

            stub._getServiceClient().addStringHeader(new QName("", "network", "zedoapi"),  "525");

            stub._getServiceClient().getOptions().setTimeOutInMilliSeconds(10 * 60 * 1000);


            GetChannel gc = new GetChannel();



            Channel c = stub.getChannel(gc).get_return();


            System.out.println("GET_CHANNEL COMPLETE!");

            System.out.println("PLEASE: " + c.getId() + " " + c.getName());

        } catch (Exception e) {

            System.err.println("ERROR: GET_CHANNEL FAILED!");

            System.err.println("Exception: " + e.getMessage());

            if (e instanceof AxisFault) {

                AxisFault af = (AxisFault) e;

                System.err.println("AxisFault's detail: " + af.getDetail());


            } else {






Open in new window


Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now