Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6564239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:56:30+00:00 2026-05-25T13:56:30+00:00

I am trying to implement a simple client for a webservice, the only problem

  • 0

I am trying to implement a simple client for a webservice, the only problem I am facing with the webservice is, it has a generic endpoint: http://myserver3333.com:8080/ws/services and the way you lookup for web services deployed is via SOAP header.

So, for example, if you try to hit the service vis SOAP UI,

  1. the endpoint I specify is: http://myserver3333.com:8080/ws/services
  2. In the SOAP headers I specific the following:
    SERVICE-NAME = MyAwesomeService
    OPERATION-NAME = makeMeMoreAwesome

So, how can I do the same thing using apache cxf client?

My current code:

    URL wsdlLocation = new URL("http://myserver3333.com:8080/ws/service");

    MyAwesomeService  service = new MyAwesomeService(wsdlLocation);
    MyAwesomeServicePort port = service.getMyAwesomeServiceSOAPPort();

    List<Header> headers = new ArrayList<Header>();
    Header operationNameHeader = new Header(new QName("OPERATION-NAME"), "makeMeMoreAwesome",
                                            new JAXBDataBinding(String.class));
    Header serviceNameHeader = new Header(new QName("SERVICE-NAME"), "MyAwesomeService",
                                            new JAXBDataBinding(String.class));

    headers.add(operationNameHeader);
    headers.add(serviceNameHeader);

    BindingProvider bindingProvider = (BindingProvider)port;
    bindingProvider.getRequestContext().put(Header.HEADER_LIST, headers);

    MakeMeMoreAwesomeRequest request = new MakeMeMoreAwesomeRequest();
    MakeMeMoreAwesomeResponse response = port.makeMeMoreAwesome(request);

    System.out.println(response.getAck());

But when I run this, I get this error:

Exception in thread "main" com.sun.xml.ws.wsdl.parser.InaccessibleWSDLException: 2 counts of InaccessibleWSDLException.

java.io.IOException: Server returned HTTP response code: 500 for URL: http://myserver3333.com:8080/ws/services
java.io.IOException: Server returned HTTP response code: 500 for URL: http://myserver3333.com:8080/ws/services?wsdl

Which is correct because there is no WSDL at that location, it need to follow the soap header to get the service.

Update:

After two points from @Daniel Kulp I am here:

  1. I added a new line: bindingProvider.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://myserver3333.com:8080/ws/services");

And now I get this error:

org.apache.cxf.binding.soap.SoapFault: "http://www.myserver.com/ws/services", the namespace on the "errorMessage" element, is not a valid SOAP version.
    at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.readVersion(ReadHeadersInterceptor.java:115)
    at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:141)
    at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
    at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:771)

My assumption is, this error is same as this one. But I am not using ?wsdl. So, any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T13:56:31+00:00Added an answer on May 25, 2026 at 1:56 pm

    2 comments:

    1) You aren’t picking up CXF. Check your classpath to make sure CXF is there and not the Sun/Oracle implementation. com.sun.xml.ws.wsdl.parser.InaccessibleWSDLException shows you are picking up the Sun implementation.

    2) The URL passed into MyAwesomeService(wsdlLocation) MUST be a URL to the WSDL, not the endpoint itself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

im trying to implement simple secured client server communiction using WCF. when im launching
I'm trying to implement a simple client-middleware-database architecture, where the client send the request
I'm trying to make a simple http client server using java. It will show
I am trying to implement a very simple file transfer client in python using
I'm trying to implement a simple horizontal navigation menu that just shows a single
I am trying to implement a simple request to Wikipedia's API using AJAX (XMLHttpRequest).
I am trying to implement a simple authorization strategy for my Wicket application. I
I am now trying to implement a simple HTML webpage scraper using Java.Now I
I've been trying to implement a simple component-based game object architecture using Objective-C, much
I'm new to Flex SDK and trying to implement a simple project using Doug

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.