Regarding client side code generation from WSDL
NickName:Saral Saxena Ask DateTime:2013-04-17T18:15:05

Regarding client side code generation from WSDL

I am a new bie to the world of webservices , I have to develop the client side code that is the java code,I have been provided a wsdl which I can see by opening that wsdl in the browser , As i have access to wsdl please let me know how can I generate the client side code from that wsdl itself through Axis 2, any help will be appreciated, Thanks in advance

Copyright Notice:Content Author:「Saral Saxena」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/16057417/regarding-client-side-code-generation-from-wsdl

Answers
Khalil 2013-04-17T11:09:17

There are many ways to generate client and server stubs.\nyou can use WSDL2Code Plug-in approach\nThis plugin takes as input a WSDL and generates client and server stubs for calling or implementing a Web service matching the WSDL.\nadd the following section to your POM\n\n <plugin>\n <groupId>org.apache.axis2</groupId>\n <artifactId>axis2-wsdl2code-maven-plugin</artifactId>\n <version>1.6.0</version>\n <executions>\n <execution>\n <id>ws1</id>\n <goals>\n <goal>wsdl2code</goal>\n </goals>\n <configuration>\n <unpackClasses>true</unpackClasses>\n <databindingName>adb</databindingName>\n <packageName>ma.glasnost.sample.axis2-maven</packageName>\n <wsdlFile>src/main/resources/ws.wsdl</wsdlFile>\n <outputDirectory>target/generated-sources</outputDirectory>\n <syncMode>sync</syncMode>\n </configuration>\n </execution>\n ..... if you have many web services \n </executions>\n </plugin>\n\n\nAlso add axis2 jars as a dependency\n\n <dependency>\n <groupId>org.apache.axis2</groupId>\n <artifactId>axis2</artifactId>\n <version>1.4</version>\n </dependency>\n",


user_CC 2013-04-17T10:58:59

Here a brief overview what you will have to do to generate the client-side java code:\n\n\nOpen the URL pointing to wsdl document in the webbrowser.\nSave that webpage as a xml document.\nRename the file to have a .wsdl extension (optional)\nThen you need to run the WSDLToJava java file through the java command this class will be contained in the axis.jar \nProvide the wsdl filename as an argument to this java file.\nProvide all the jar files needed as a classpath argument to this java command\n\n\nSo your command will look something like below:\n\njava -classpath axis.jar;%CATALINA_HOME%/shared/lib/commons-httpclient.jar;%CATALINA_HOME%/shared/lib/log4j.jar;%CATALINA_HOME%/shared/lib/commons-logging.jar;wsdl4j.jar;commons-net.jar;commons-discovery.jar;jaxrpc.jar;soap.jar;saaj.jar org.apache.axis.wsdl.WSDL2Java your_wsdl_fileName.wsdl",


More about “Regarding client side code generation from WSDL” related questions

Regarding client side code generation from WSDL

I am a new bie to the world of webservices , I have to develop the client side code that is the java code,I have been provided a wsdl which I can see by opening that wsdl in the browser , As i have

Show Detail

wso2 cpp code generation with wsdl2cpp client side with MTOM attachment

I have a soap web service exposed with axis2 (Java) which serializes POJOs, such as a Person that has a name and so on, as action responses. Moreover, I have an action which uses a DataHandler that...

Show Detail

WSDL Client Generation not complete?

Just tried to generate java client generation from a WSDL file ( using XFire using XMLBeans binding ) I am able to generate the client + Fault Message ( no error ) , however input message and output

Show Detail

Regarding developing client through wsdl using Axis2

I am a new bie to the world of webservices ,i am asking the question which mite be reptitive one also,My query is that I have a wsdl which I can access by hitting the url of that wsdl in the browse...

Show Detail

Server code generation from WSDL publishes different output

I have an WSDL with external .xsd files referenced inside that was given to me by my client. Now my job is to create a web service server in Visual Studio using C#. I tried using wsdl.exe and svcut...

Show Detail

netbeans wsdl client code generation

Am trying to use netbeans to build a web service client. The remote WSDL has relative paths to the service and the schemaLocation. Copied the wsdl localy, replaced the relative links and tried usi...

Show Detail

Java WSDL client side with dynamic address

Initially WSDL location was given using which I generated the server classes in the client side. Now the server side is deployed as a war file at a different port. We must be able to load wsdl from...

Show Detail

WCF and code generation from WSDL

I am writing a "universal" client for Web services, and have hit an unexpected problem. I generate the code for the client dynamically by retrieving the Web services WSDL, and using the following (

Show Detail

Code generation from WSDL using XML Catalog

Is there any tool for generating Java code from WSDL using XML Catalogs? The problem is that I have wsdl files that import XML schemas which also import other schemas and the schemas are not availa...

Show Detail

Generating C# client code from a JAXB WSDL with a binding file

I have a WSDL with dozens of XSD and I need to generate client code from the WSDL to consume a Web Service. The owner of the web service uses Java and generated the WSDL/XSD using JAXB. JAXB specif...

Show Detail