You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by jayasreeb <ja...@infosys.com> on 2008/07/08 14:28:53 UTC

Urgent!! Need input to create Web service Client in Service mix.

Hi,

I have created a http webservice using axis (literal/wrapped) style and
deployed it in Tomcat. 
By entering "http://localhost:8080/axis/services/fibonacci?wsdl" in browser
following wsdl gets generated.


 <?xml version="1.0" encoding="UTF-8" ?> 
- <wsdl:definitions targetNamespace="urn:fibonacci"
xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="urn:fibonacci"
xmlns:intf="urn:fibonacci" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <!-- 
WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)

  --> 
- <wsdl:types>
- <schema elementFormDefault="qualified" targetNamespace="urn:fibonacci"
xmlns="http://www.w3.org/2001/XMLSchema">
- <element name="calculateFibonacci">
- <complexType>
- <sequence>
  <element name="in0" type="xsd:int" /> 
  </sequence>
  </complexType>
  </element>
- <element name="calculateFibonacciResponse">
- <complexType>
- <sequence>
  <element name="calculateFibonacciReturn" type="xsd:int" /> 
  </sequence>
  </complexType>
  </element>
- <element name="calculateFibonacciRange">
- <complexType>
- <sequence>
  <element name="in0" type="xsd:int" /> 
  <element name="in1" type="xsd:int" /> 
  </sequence>
  </complexType>
  </element>
- <element name="calculateFibonacciRangeResponse">
- <complexType>
- <sequence>
  <element maxOccurs="unbounded" name="calculateFibonacciRangeReturn"
type="xsd:int" /> 
  </sequence>
  </complexType>
  </element>
  </schema>
  </wsdl:types>
- <wsdl:message name="calculateFibonacciRangeResponse">
  <wsdl:part element="impl:calculateFibonacciRangeResponse"
name="parameters" /> 
  </wsdl:message>
- <wsdl:message name="calculateFibonacciRequest">
  <wsdl:part element="impl:calculateFibonacci" name="parameters" /> 
  </wsdl:message>
- <wsdl:message name="calculateFibonacciRangeRequest">
  <wsdl:part element="impl:calculateFibonacciRange" name="parameters" /> 
  </wsdl:message>
- <wsdl:message name="calculateFibonacciResponse">
  <wsdl:part element="impl:calculateFibonacciResponse" name="parameters" /> 
  </wsdl:message>
- <wsdl:portType name="Fibonacci">
- <wsdl:operation name="calculateFibonacci">
  <wsdl:input message="impl:calculateFibonacciRequest"
name="calculateFibonacciRequest" /> 
  <wsdl:output message="impl:calculateFibonacciResponse"
name="calculateFibonacciResponse" /> 
  </wsdl:operation>
- <wsdl:operation name="calculateFibonacciRange">
  <wsdl:input message="impl:calculateFibonacciRangeRequest"
name="calculateFibonacciRangeRequest" /> 
  <wsdl:output message="impl:calculateFibonacciRangeResponse"
name="calculateFibonacciRangeResponse" /> 
  </wsdl:operation>
  </wsdl:portType>
- <wsdl:binding name="fibonacciSoapBinding" type="impl:Fibonacci">
  <wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" /> 
- <wsdl:operation name="calculateFibonacci">
  <wsdlsoap:operation soapAction="" /> 
- <wsdl:input name="calculateFibonacciRequest">
  <wsdlsoap:body use="literal" /> 
  </wsdl:input>
- <wsdl:output name="calculateFibonacciResponse">
  <wsdlsoap:body use="literal" /> 
  </wsdl:output>
  </wsdl:operation>
- <wsdl:operation name="calculateFibonacciRange">
  <wsdlsoap:operation soapAction="" /> 
- <wsdl:input name="calculateFibonacciRangeRequest">
  <wsdlsoap:body use="literal" /> 
  </wsdl:input>
- <wsdl:output name="calculateFibonacciRangeResponse">
  <wsdlsoap:body use="literal" /> 
  </wsdl:output>
  </wsdl:operation>
  </wsdl:binding>
- <wsdl:service name="FibonacciService">
- <wsdl:port binding="impl:fibonacciSoapBinding" name="fibonacci">
  <wsdlsoap:address location="http://localhost:8080/axis/services/fibonacci"
/> 
  </wsdl:port>
  </wsdl:service>
  </wsdl:definitions>


1)I created service unit and I have placed this wsdl file(fib.wsdl)
in(src\main\resources) of service unit(cxf-se).

2)I have added following entry in xbean of service unit(cxf-se):

<beans xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0">

<cxfse:endpoint> 
<cxfse:pojo> 
<bean class="org.apache.servicemix.samples.webservice.FibonacciClient"> 
</bean>
 </cxfse:pojo>
 </cxfse:endpoint>

</beans>


3)I have added following entry in pom.xml file of service unit(cxf-se) to
generate xfire client stub during run time.



<plugin>
	<artifactId>maven-antrun-plugin</artifactId>
	<executions>
		<execution>
			<phase>generate-sources</phase>
			<configuration>
				<tasks>
					<taskdef classname="org.codehaus.xfire.gen.WsGenTask" name="wsgen"
classpathref="maven.compile.classpath">
					</taskdef>
					
					<wsgen
						wsdl="${basedir}/src/main/resources/fib.wsdl"
						outputDirectory="${basedir}/target/generated-sources"
						profile="org.codehaus.xfire.jaxws.gen.JAXWSProfile"
						explicitAnnotation="true" />
				</tasks>
				<sourceRoot>
					${basedir}/target/generated-sources
				</sourceRoot>
			</configuration>
			<goals>
				<goal>run</goal>
			</goals>
		</execution>
	</executions>
</plugin>


4)I also created one binding component Service unit(cxf-bc) and placed the
same wsdl file (fib.wsdl)under(src\main\resources).

5)I have added following xbean entry in Binding component xbean::

<cxfbc:provider wsdl="/wsdl/fib.wsdl"
locationURI="http://localhost:8080/axis/services/fibonacci"
service="fib:FibonacciService" endpoint="FibonacciClient"
interfaceName="fib:Fibonacci" > </cxfbc:provider>

6)When I give mvn install all the neccessary jar and class file gets
generated properly.

7)Following Client stubs class file gets generated
under(target\classess\fibonacci) folder of cxf-se service unit.

i)CalculateFibonacci.java
ii)CalculateFibonacciRange.java
iii)CalculateFibonacciRangeResponse.java
iv)CalculateFibonacciResponse.java
v)Fibonacci.java
vi)FibonacciServiceImpl.java
vii)FibonacciServiceService.java
vIII)ObjectFactory.java


8) Now I dont know how to write client class to invoke that external
webservice which is running on tomcat server deployed using axis.

9)Where do I need to place Client Class which I need to use to Invoke this
exgternal web service?Will it work if i place it under (src\main\java) of
cxf-se service unit?

10) Which of the following generated class do i need to use to invoke the
method of external web service?

11) Do i need to make any additional entry in xbean/pom files?

Please help me in this as this is on high priority..

Thanks
Jayasree.B

-- 
View this message in context: http://www.nabble.com/Urgent%21%21-Need-input-to-create-Web-service-Client-in-Service-mix.-tp18338086p18338086.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.