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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:05:12+00:00 2026-05-13T22:05:12+00:00

I need to jump into the Spring Web Service Project, in that I required

  • 0

I need to jump into the Spring Web Service Project, in that I required to implement the Spring Web Service’s Client Only..

So, I have already gone through with Spring’s Client Reference Document.

So, I got the idea of required classes for the implementation of Client.

But my problem is like I have done some googling, but didn’t get any proper example of both Client and Server from that I can implement one sample for my client.

So, if anybody gives me some link or tutorial for proper example from that I can learn my client side implementation would be greatly appreciated.

Thanks in advance…

  • 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-13T22:05:13+00:00Added an answer on May 13, 2026 at 10:05 pm

    in my previous project, I implemented a Webservice client with Spring 2.5.6, maven2, xmlbeans.

    • xmlbeans is responsible for un/marshal
    • maven2 is for project mgmt/building etc.

    I paste some codes here and hope they are helpful.

    xmlbeans maven plugin conf: (in pom.xml)

    <build>
            <finalName>projectname</finalName>
    
            <resources>
    
            <resource>
    
                <directory>src/main/resources</directory>
    
                <filtering>true</filtering>
    
            </resource>
    
            <resource>
    
                <directory>target/generated-classes/xmlbeans
    
                </directory>
    
            </resource>
    
        </resources>
    
    
            <!-- xmlbeans maven plugin for the client side -->
    
            <plugin>
    
                <groupId>org.codehaus.mojo</groupId>
    
                <artifactId>xmlbeans-maven-plugin</artifactId>
    
                <version>2.3.2</version>
    
                <executions>
    
                    <execution>
    
                        <goals>
    
                            <goal>xmlbeans</goal>
    
                        </goals>
    
                    </execution>
    
                </executions>
    
                <inherited>true</inherited>
    
                <configuration>
    
                    <schemaDirectory>src/main/resources/</schemaDirectory>
    
                </configuration>
    
            </plugin>
    <plugin>
    
                <groupId>org.codehaus.mojo</groupId>
    
                <artifactId>build-helper-maven-plugin
    
                </artifactId>
    
                <version>1.1</version>
    
                <executions>
    
                    <execution>
    
                        <id>add-source</id>
    
                        <phase>generate-sources</phase>
    
                        <goals>
    
                            <goal>add-source</goal>
    
                        </goals>
    
                        <configuration>
    
                            <sources>
    
                                <source> target/generated-sources/xmlbeans</source>
    
                            </sources>
    
                        </configuration>
    
                    </execution>
    
    
    
                </executions>
    
            </plugin>
        </plugins>
    </build>
    

    So from the above conf, you need to put the schema file (either standalone or in your WSDL file, you need to extract them and save as a schema file.) under src/main/resources. when you build the project with maven, the pojos are gonna be generated by xmlbeans. The generated sourcecodes will be under
    target/generated-sources/xmlbeans.

    then we come to Spring conf. I just put the WS relevant context here:

        <bean id="messageFactory" class="org.springframework.ws.soap.axiom.AxiomSoapMessageFactory">
    
            <property name="payloadCaching" value="true"/>
    
        </bean>
    
    
        <bean id="abstractClient" abstract="true">
            <constructor-arg ref="messageFactory"/>
        </bean>
    
        <bean id="marshaller" class="org.springframework.oxm.xmlbeans.XmlBeansMarshaller"/>
    
     <bean id="myWebServiceClient" parent="abstractClient" class="class.path.MyWsClient">
    
            <property name="defaultUri" value="http://your.webservice.url"/>
    
            <property name="marshaller" ref="marshaller"/>
    
            <property name="unmarshaller" ref="marshaller"/>
    
        </bean>
    

    finally, take a look the ws-client java class

    public class MyWsClient extends WebServiceGatewaySupport {
     //if you need some Dao, Services, just @Autowired here.
    
        public MyWsClient(WebServiceMessageFactory messageFactory) {
            super(messageFactory);
        }
    
        // here is the operation defined in your wsdl
        public Object someOperation(Object parameter){
    
          //instantiate the xmlbeans generated class, infact, the instance would be the document (marshaled) you are gonna send to the WS
    
          SomePojo requestDoc = SomePojo.Factory.newInstance(); // the factory and other methods are prepared by xmlbeans
          ResponsePojo responseDoc = (ResponsePojo)getWebServiceTemplate().marshalSendAndReceive(requestDoc); // here invoking the WS
    
    
    //then you can get the returned object from the responseDoc.
    
       }
    

    }

    I hope the example codes are helpful.

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

Sidebar

Related Questions

I have a web application that accesses a database through a wcf service. The
I have a matrix that is mapped to a .NET web service via the
Need to an expression that returns only things with an I followed by either
need ask you about some help. I have web app running in Net 2.0.
Need a function that takes a character as a parameter and returns true if
Need a function like: function isGoogleURL(url) { ... } that returns true iff URL
I want to smoothly transition between two audio clips that are loaded into an
I have a list that gets refreshed every 2 seconds via the Handler postDelayed()
i have a input tag which is non editable, but some times i need
Is there a way to test if a collection is already initialized? try-catch only?

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.