Hi

 

This is a web service I found on the internet, you can access this wsdl with 
the url http://www.webxml.com.cn/WebServices/WeatherWebService.asmx?WSDL, I try 
to generate the service side code and client side code of this wsdl file, but 
axis2 failed. Suriarachchi sugguests rewriting this wsdl file with multiple 
<services>, each contains only one <port>. But it still fails too. Do you know 
the solution to this problem?

 

Regards

---------------

Robin

Sycamore Networks (Shanghai China)

 

________________________________

From: keith chapman [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 01, 2008 11:25 AM
To: [email protected]
Subject: Re: [axis2] error when generate code using wsdl2java with multiple 
binding

 

Hi,

Is this some sort of a sample WSDL? It does not look well constructed at all. 
You can author this WSDL in a much cleaner fashion. I do not understand the 
rational for having 3 portTypes. This could be described using a single port 
type (The abstract definition of the service) and 4 bindings.  Bindings for 
SOAP 1.1, SOAP 1.2, HTTP GET and HTTP POST.

Thanks,
Keith.

2008/8/1 Zhuang, Guanxia (Robin) <[EMAIL PROTECTED]>

Hi Suriarachchi,

Thank you very much for your time.

I try to change the wsdl file, I put each <port> element a <services>. but it 
fail to generate all the skeletons for all <services>. of course I use the 
option �Cap.

Please help to look at the wsdl file below, the whole version can be found at 
http://www.webxml.com.cn/WebServices/WeatherWebService.asmx?WSDL

 

I think maybe I should create several wsdl file, each file contain one 
<porttype>, one <binding> and one <service> only. Is it that what the axis2 
want?

 

<?xml version="1.0" encoding="UTF-8"?>

<wsdl:definitions>

 

       <wsdl:types>

              <s:schema elementFormDefault="qualified"

                     targetNamespace="http://WebXml.com.cn/";>

                     ......

              </s:schema>

 

       </wsdl:types>

 

       <wsdl:message name="getSupportCitySoapIn">

              <wsdl:part name="parameters" element="tns:getSupportCity" />

       </wsdl:message>

              ..........

       <wsdl:message name="getWeatherbyCityNameProHttpPostOut">

              <wsdl:part name="Body" element="tns:ArrayOfString" />

       </wsdl:message>

 

       <wsdl:portType name="WeatherWebServiceSoap">

              ........

       </wsdl:portType>

 

       <wsdl:portType name="WeatherWebServiceHttpGet">

              .............

       </wsdl:portType>

 

       <wsdl:portType name="WeatherWebServiceHttpPost">

              ..........

       </wsdl:portType>

 

       <wsdl:binding name="WeatherWebServiceSoap"

              type="tns:WeatherWebServiceSoap">

              <soap:binding transport="http://schemas.xmlsoap.org/soap/http"; />

              ..........

       </wsdl:binding>

 

       <wsdl:binding name="WeatherWebServiceSoap12"

              type="tns:WeatherWebServiceSoap">

              <soap12:binding

                     transport="http://schemas.xmlsoap.org/soap/http"; />

              .............

       </wsdl:binding>

 

       <wsdl:binding name="WeatherWebServiceHttpGet"

              type="tns:WeatherWebServiceHttpGet">

              <http:binding verb="GET" />

              ..............

       </wsdl:binding>

 

       <wsdl:binding name="WeatherWebServiceHttpPost"

              type="tns:WeatherWebServiceHttpPost">

              <http:binding verb="POST" />

              .................

       </wsdl:binding>

 

       <wsdl:service name="WeatherWebService1">

              <wsdl:port name="WeatherWebServiceSoap"

                     binding="tns:WeatherWebServiceSoap">

                     ...

       </wsdl:service>

 

       <wsdl:service name="WeatherWebService2">

              <wsdl:port name="WeatherWebServiceSoap12"

                     binding="tns:WeatherWebServiceSoap12">

                     ...

       </wsdl:service>

 

       <wsdl:service name="WeatherWebService3">

              <wsdl:port name="WeatherWebServiceHttpGet"

                     binding="tns:WeatherWebServiceHttpGet">

                     ....

       </wsdl:service>

 

       <wsdl:service name="WeatherWebService4">

              <wsdl:port name="WeatherWebServiceHttpPost"

                     binding="tns:WeatherWebServiceHttpPost">

                     ....

       </wsdl:service>

 

</wsdl:definitions>

 

Regards

---------------

Guanxia Zhuang (Robin)

Sycamore Networks (SDC)

Phone: 021-24050832

 

________________________________

From: Amila Suriarachchi [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 31, 2008 12:54 PM
To: [email protected]
Subject: Re: [axis2] error when generate code using wsdl2java with multiple 
binding

 

 

On Thu, Jul 31, 2008 at 9:32 AM, Zhuang, Guanxia (Robin) <[EMAIL PROTECTED]> 
wrote:

i have got a wsdl file from 
http://www.webxml.com.cn/WebServices/WeatherWebService.asmx?WSDL , and i want 
to generate the sever side code and client code from it. but axis4 1.4 only 
generate five methods. it should generate 5 methods for each binding i think.

Axis2 generates the code for one portType (per service). So it generates the 
code for the portType of the port it selects.
for Axis2 what ever your service should have  one port Type. So if you can 
change the wsdl  to as follows and use -ap option it generates correctly.

<wsdl:service name="WeatherWebService1">
-
    -
    <wsdl:port name="WeatherWebServiceSoap" binding="tns:WeatherWebServiceSoap">
<soap:address 
location="http://www.webxml.com.cn/WebServices/WeatherWebService.asmx"/>
</wsdl:port>
-
    <wsdl:port name="WeatherWebServiceSoap12" 
binding="tns:WeatherWebServiceSoap12">
<soap12:address 
location="http://www.webxml.com.cn/WebServices/WeatherWebService.asmx"/>
</wsdl:port>

</wsdl:service> 
<wsdl:service name="WeatherWebService2">

-
    <wsdl:port name="WeatherWebServiceHttpGet" 
binding="tns:WeatherWebServiceHttpGet">
<http:address 
location="http://www.webxml.com.cn/WebServices/WeatherWebService.asmx"/>
</wsdl:port>
-
   
<wsdl:service name="WeatherWebService3">

<wsdl:port name="WeatherWebServiceHttpPost" 
binding="tns:WeatherWebServiceHttpPost">
<http:address 
location="http://www.webxml.com.cn/WebServices/WeatherWebService.asmx"/>
</wsdl:port>
</wsdl:service> 

thanks,
Amila.

         

        i try to use axis2 to generate code from other wsdl file with multiple 
binding, but it just generate part of the methods, not all of the methods. can 
anybody try this wsdl, and let me know how to generate the server side and the 
client side code from it? thanks

         

        Regards

        ---------------

        Guanxia Zhuang (Robin)

        Sycamore Networks (SDC)

        Phone: 021-24050832

         

         




-- 
Amila Suriarachchi,
WSO2 Inc.




-- 
Keith Chapman
Senior Software Engineer
WSO2 Inc.
Oxygenating the Web Service Platform.
http://wso2.org/

blog: http://www.keith-chapman.org

Reply via email to