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 8869721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:32:58+00:00 2026-06-14T17:32:58+00:00

I have a pre-existing web service connect (SOAP) I would like to call without

  • 0

I have a pre-existing web service “connect” (SOAP) I would like to call without using the Swing framework if possible. I have followed the contact first development generating my java files using cxf/wsdl2java tool.

I wish for the userName and password to be extracted from the java object and placed in a SOAP object then sent onot my localhost web service.

When sending the Connect object as a body to the “direct:start” I get an exception…

Caused by: java.lang.IllegalArgumentException: Get the wrong parameter size to invoke the out service, Expect size 2, Parameter size 1. Please check if the message body matches the CXFEndpoint POJO Dataformat request.

I’ve checked the first argument is actually an instance of the Connect object passed in.

Do I need some additional annotations in the one of the classes, is the method of testing invalid or
is there an alternative pattern I should follow?

public class TestConnectCXF extends CamelTestSupport
{
    @Override
    protected RouteBuilder createRouteBuilder() throws Exception
    {
        return new RouteBuilder()
        {
            String cxfAddressLine = "cxf:http://localhost:8081/nuxeo/webservices/privateadservice?wsdlURL=wsdl/privateadservice.wsdl" //
                    + "&dataFormat=POJO" //
                    + "&serviceClass=com.sandbox.camelfeed.PrivateAdServiceInterface" //
                    + "&serviceName={http://ws.sandboxtest.com/}PrivateAdService" //
                    + "&synchronous=true" //
                    + "&loggingFeatureEnabled=true" //
                    + "&portName={http://ws.sandboxtest.com/}PrivateAdServiceInterfacePort";
            @Override
            public void configure() throws Exception
            {
                from("direct:start").to(cxfAddressLine).to("mock:end");
            }
        };
    }

    @Test
    public void testConnectViaPojo() throws InterruptedException
    {
        Connect connectToServer = new Connect();
        connectToServer.setUserName("FakeUser");
        connectToServer.setPassword("scrubbed");
        template.sendBody("direct:start", connectToServer);
        Thread.sleep(1000);
    }
}

I’m new to camel and web services so any helpful pointers would be greatly appreciated.

Additional info

Using camel 2.10, Java 1.6

Classes generated from wsdl2java

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "connect", propOrder = {
   "userName",
   "password"
})
public class Connect {

protected String userName;
protected String password;

public String getUserName() {
    return userName;
}

public void setUserName(String value) {
    this.userName = value;
}


public String getPassword() {
    return password;
}

public void setPassword(String value) {
    this.password = value;
}
}

@WebService(targetNamespace = "http://ws.sandboxtest.com/", name = "PrivateAdServiceInterface")
@XmlSeeAlso({ObjectFactory.class})
public interface PrivateAdServiceInterface {

        // Omitted Code relating to other web calls

        @WebResult(name = "return", targetNamespace = "")
        @RequestWrapper(localName = "connect", targetNamespace = "http://ws.sandboxtest.com/", className = "com.sandbox.camelfeed.Connect")
        @WebMethod
        @ResponseWrapper(localName = "connectResponse", targetNamespace = "http://ws.sandboxtest.com/", className = "com.sandbox.camelfeed.ConnectResponse")
        public java.lang.String connect(
            @WebParam(name = "userName", targetNamespace = "")
            java.lang.String userName,
            @WebParam(name = "password", targetNamespace = "")
            java.lang.String password
        ) throws ClientException_Exception;
    }

@XmlRegistry
public class ObjectFactory {
{
    // Omitted other web calls information
      private final static QName _Connect_QNAME = new QName("http://ws.sandboxtest.com/", "connect");

    @XmlElementDecl(namespace = "http://ws.sandboxtest.com/", name = "connect")
    public JAXBElement<Connect> createConnect(Connect value) {
        return new JAXBElement<Connect>(_Connect_QNAME, Connect.class, null, value);
    }

}
  • 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-06-14T17:32:59+00:00Added an answer on June 14, 2026 at 5:32 pm

    In my experience there are some things in Camel, like calling a SOAP Web service or making a REST call, that are easier to do in a custom processor, than using a component like CXF, HTTP or HTTP4.

    I usually work with Spring, so I tend to use either Spring REST template or the JaxWsPortProxyFactoryBean (for Webservice calls) for outbound calls.

    Here is an example using a JAX-WS call:

        public class WebServiceProcessorBean {
    
        @Autowired
        private JAXWSProxy theProxy;
    
    
        public void callWebservice(Exchange exchange) {
            Response response = theProxy.call();
    
            //Do something with the response and Exchange.
        }
      }
    

    The definition in the Spring application context:

    <bean id="theProxyService" class="org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean">
            <property name="serviceInterface" value="XXX"/>
            <property name="wsdlDocumentUrl" value="http://xxxxx.wsdl"/>
            <property name="namespaceUri" value="xxxx"/>
            <property name="serviceName" value="xxxx"/>
            <property name="portName" value="xxxxx"/>
    </bean> 
    

    Use the WebServiceProcessorBean defined in Spring application context with beanRef() DSL method.

    .beanRef("theProxyService", "callWebservice")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have this pre-existing database that I'm trying to connect to using Django
I have a lot of pre-existing BMPs (and our clients have pre-existing bmps as
I have a couple of pre-existing applications which I need to run in one
I have recently begun working on a pre-existing PHP application, and am having a
I have all my content pre-escaped, so rather than using the triple stash everywhere
I have an idea for a web application that would allow users to create
I have a pre-existing database, and this code: class User private() extends MongoRecord[User] with
I have a plain ruby application (it's not a Web app, so not using
I'm using Eclipse to automatically create a WebLogic web service (not client) from a
I'm working on a project where we have a pre-existing DataSet . We don't

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.