Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 7 of 7

Thread: java service client for wsdl

  1. #1
    Junior Member
    Join Date
    Oct 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default java service client for wsdl

    hi ,
    this my my very first thread on this forum.
    Completely new bee in web services.

    I am having the wsdl from some url abc.xyz.com/api/?wsdl(suppose) as:

    <message name="call">
    <part name="sessionId" type="xsd:string"/>
    <part name="resourcePath" type="xsd:string"/>
    <part name="args" type="xsd:anyType"/>
    </message>

    <message name="callResponse">
    <part name="callReturn" type="xsd:anyType"/>
    </message>

    <portType name="Mage_Api_Model_Server_HandlerPortType">
    <operation name="call">
    <documentation>Call api functionality</documentation>
    <input message="typens:call"/>
    <output message="typens:callResponse"/>
    </operation>
    </portType >

    <binding name="Mage_Api_Model_Server_HandlerBinding" type="typens:Mage_Api_Model_Server_HandlerPortType ">
    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="call">
    <soapperation soapAction="urn:Mage_Api_Model_Server_HandlerActio n"/>
    <input>
    <soap:body namespace="urn:Magento" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
    </input>
    <output>
    <soap:body namespace="urn:Magento" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
    </output>
    </operation>
    </binding>

    This is what I have tried:

    Created a new JAVA project from Eclipse wizard.

    right click on the project navigate to web service-> web service client.

    Give the service definition http://abc.xyz.com/api/?wsdl(suppose)

    in configuration:

    (a) server runtime:tomcat v7.0 server
    (b) webservice runtime:apache axis
    Choose test client from slider (I have also tried develop client a bit confuse,as I have to create client much confused)

    Click on finish.

    As a result I found web service test client browser with some method, input and result. Also I got some JAVA file in my resources folder:

    Mage_Api_Model_Server_HandlerBindingStub
    Mage_Api_Model_Server_HandlerPortType
    Mage_Api_Model_Server_HandlerPortTypeProxy
    MagentoService
    MagentoServiceLocator
    now how to write my client code in java some thing like this just a try :
    package Magento;
    public class MyClient {
    public static void main(String[] args) {
    try{
    MagentoServiceLocator msl = new MagentoServiceLocator();
    MagentoService ms = (MagentoService) msl.WHICH_METHOD_TO_CALL();
     
            double product_list = ms.catalogProductList;  
            System.out.println("Product List: " + product_list);  
     
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    }
    any help i have tried to the best of mine but not getting which method should i call for accessing a webservice?
    thanks


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: java service client for wsdl

    I've moved this thread to a new forum for better topic alignment. Please read this for more information: http://www.javaprogrammingforums.com...e-posting.html
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Member
    Join Date
    Oct 2011
    Posts
    50
    My Mood
    Fine
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: java service client for wsdl

    Getting/sending that from/to a webservice is not as easy as a System.out.printl() -- at least apparently, because of the SOAP messages' format. There must be done some mapping between data-types, packaging the messages etc ...and even though it might sound complicated, it's not, because there are libraries out there that will do the hard work for you, so consuming a webservice becomes a piece of cake. For starting, read about JAXWS JAX-WS Reference Implementation &mdash; Java.net .

    application context
    Last edited by daniel.j2ee; December 13th, 2011 at 04:54 PM.

  4. #4
    Member
    Join Date
    Nov 2011
    Posts
    37
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: java service client for wsdl

    Hi,
    I have a small question , how I ll set up in my eclipse for web service wsdl.
    Can any one help.

    Core java
    Last edited by mr.miku; January 11th, 2012 at 07:14 PM.

  5. #5
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: java service client for wsdl

    Quote Originally Posted by mr.miku View Post
    Hi,
    I have a small question , how I ll set up in my eclipse for web service wsdl.
    Can any one help.
    If you have a question, post it in its own thread in the appropriate forum. Don't hijack another person's thread.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  6. #6
    Member
    Join Date
    Nov 2011
    Posts
    37
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: java service client for wsdl

    Hi KevinWorkman,
    I have post it in this thread as I thought it is relevant .
    OK for further I ll put it in a new thread.

  7. #7
    Junior Member
    Join Date
    Nov 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: java service client for wsdl

    Hi Upadhyay,

    I'm also facing the same issue, did you find the solution, If yes please help me out. Expecting you reply.

Similar Threads

  1. Java Web Service Client Authentication (limiting the number of failed attempts)
    By pranay_reddy in forum JavaServer Pages: JSP & JSTL
    Replies: 1
    Last Post: September 19th, 2011, 04:30 PM
  2. Java web client - > .NET web service
    By codeJ in forum Web Frameworks
    Replies: 0
    Last Post: July 8th, 2010, 04:34 AM
  3. [SOLVED] Web Service from WSDL
    By wilky in forum Java Theory & Questions
    Replies: 3
    Last Post: January 25th, 2010, 10:45 AM
  4. Replies: 2
    Last Post: November 19th, 2009, 11:55 PM