1 Reply Latest reply: Aug 22, 2007 4:21 PM by J C RSS

Webservice client

tilak Newbie

Hi Jobss Gurus,

jobss: 4.1.05

I am new to jobss, trying to create a web service client in jboss, using eclipes. I tried different ways but got the same error. Any help or pointers are highly appreciated

Web Service (wsdl): http://www.webservicex.net/country.asmx?wsdl

Client-interface xml

?xml version="1.0" encoding="UTF-8"?
configuration
xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
<wsdl location="http://www.webservicex.net/country.asmx?wsdl"
packageName="edu.smccd.cis681.spring2007.country.client"
/configuration

I have written an ant script o download the client from wsdl

target name="generate-client-classesandmapping" depends="init"
<exec executable="${jwsdp.home}/jaxrpc/bin/wscompile.${wscompile.extension}"
arg value="-gen:client" /
arg value="-nd" /
arg value="client-bin" /
arg value="-d" /
arg value="client-bin" /
arg value="-mapping" /
arg value="client-bin/generatedfromwsdl-mapping.xml" /
arg value="build/client-config-interface.xml"
exec
target

So far everything looks good
My client is as follows
public class CountryInfo {


public static void main(String[] args) throws Exception {

//ServiceFactoryImpl factory = new ServiceFactoryImpl();


//org.apache.log4j.BasicConfigurator.configure();
String urlstr = "http://www.webservicex.net/country.asmx?wsdl";
URL url = new URL(urlstr);
// target namespace and webservices name
QName qname = new QName("http://www.webserviceX.NET", "country");
//File mapping = new File("C:\\webservice\\countryinfo\\client-bin\\generatedfromwsdl-mapping.xml");

ServiceFactory factory = ServiceFactory.newInstance();
Service service = factory.createService( url, qname );

System.out.println("factory " );

// service1 = factory.createService(url, qname);
// port type
System.out.println("service " );
//
CountrySoap age = ( CountrySoap ) service.getPort( CountrySoap.class );


When I execute the client I get the following error
Exception in thread "main" org.jboss.ws.WSException: Cannot obtain java type mapping for: {http://www.webserviceX.NET}>GetCountryByCountryCode
at org.jboss.ws.deployment.JSR109MetaDataBuilder.buildParameterMetaDataDoc(JSR109MetaDataBuilder.java:451)
at org.jboss.ws.deployment.JSR109MetaDataBuilder.setupOperationsFromWSDL(JSR109MetaDataBuilder.java:200)
at org.jboss.ws.deployment.JSR109ClientMetaDataBuilder.buildMetaDataInternal(JSR109ClientMetaDataBuilder.java:208)
at org.jboss.ws.deployment.JSR109ClientMetaDataBuilder.buildMetaData(JSR109ClientMetaDataBuilder.java:126)
at org.jboss.ws.deployment.JSR109ClientMetaDataBuilder.buildMetaData(JSR109ClientMetaDataBuilder.java:82)
at org.jboss.ws.jaxrpc.ServiceImpl.(ServiceImpl.java:96)
at org.jboss.ws.jaxrpc.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:157)
at org.jboss.ws.jaxrpc.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:128)
at edu.smccd.cis681.spring2007.country.client.CountryInfo.main(CountryInfo.java:28)