Hi,
We are using axis2 v0.92 to deploy webservices, but we
are getting some problem while associating .wsdl 
file with the webservice. One of the solution we saw
in axis offical website mailing list, but the reply 
was little bit confusing. Following is the text of
that mailing thread.

Hi Gordon;
>
> It should work , but you need to do some
modifications
> 1. You need to have services.xml instead of
service.xml
> 2. There should be a service element in side
services.xml similar to 
> service element in WSDL file
>
> as an example , say you have a wsdl with following
service element
>
>  <service name="MySerevice">
>        <port name="MySerevicePort"
binding="mh:MySereviceBinding">
>            <soap:address 
>
location="http://www.Monson-Haefel.com/jwsbook/MySereviceService"/>
>        </port>
>    </service>
>
> Then the services.xml should look like follows
> op 1 :
>  <services>
>     <service MySerevice>
>         ..........................
>         ..........................
>     </service>
>  </services>
>
> op 2 :  there should be a service archive file with
the name 
> MySerevice.aar and its services.xml should look like
follows
>  <service >
>     ..........................
>   </service>
>
>
>
>
> Thanks,
> Deepal


The very first point in the solution says "You need to
have services.xml instead of service.xml". 
service.xml is the default xml file which describes
webservice operations. Its work fine. When i added my 
services.wsdl file I got an error. My wsdl file and
xml file is as follows:


services.xml

<services>
<service name="NameServiceSkeletonTest">
        <port name="Service1Soap"
binding="tns:GetNameSoapBinding">
                <address
location="http://localhost:8080/axis2/services/nameservice";
/>
        </port>
        <parameter locked="xsd:false"
name="ServiceClass">nameservice.NameService</parameter>
        <operation name="getName"/>
</service>
</services>



services.wsdl

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/";
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
xmlns:s="http://www.w3.org/2001/XMLSchema";
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:tns="http://tempuri.org/";
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/";
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/";
targetNamespace="http://tempuri.org/";
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";>
  <wsdl:types>
    <s:schema elementFormDefault="qualified"
targetNamespace="http://tempuri.org/";>
      <s:element name="GetNameRequest">
       <s:element name="input" type="s:string" />     
    
      </s:element>
      <s:element name="GetNameResponse">
        <s:element name="result" type="s:string" />
      </s:element>      
    </s:schema>
  </wsdl:types>
  <wsdl:message name="GetNameSoapIn">
    <wsdl:part name="parameters"
element="tns:GetNameRequest" />
  </wsdl:message>
  <wsdl:message name="GetNameSoapOut">
    <wsdl:part name="parameters"
element="tns:GetNameResponse" />
  </wsdl:message>

  <wsdl:portType name="Service1Soap">
    <wsdl:operation name="getName">
      <wsdl:input message="tns:GetNameSoapIn" />
      <wsdl:output message="tns:GetNameSoapOut" />
    </wsdl:operation>
  </wsdl:portType>

  <wsdl:binding name="Service1Soap"
type="tns:Service1Soap">
    <soap:binding
transport="http://schemas.xmlsoap.org/soap/http";
style="document" />
    <wsdl:operation name="getName">
      <soap:operation
soapAction="http://tempuri.org/getName";
style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>      
    </wsdl:operation>
  </wsdl:binding>

  <wsdl:service name="NameServiceSkeletonTest">
    <documentation
xmlns="http://schemas.xmlsoap.org/wsdl/"; />
    <wsdl:port name="Service1Soap"
binding="tns:GetNameSoapBinding">
      <soap:address
location="http://localhost:8080/axis2/services/nameservice";
/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>


Regds,
Farooq

Reply via email to