Hi everybody,

I try to use Axis to build a Web service client for a gSOAP server.
I get a wsdl file from the server and use WSDL2Java to generate stub code.
And, when I run my Client it said me this error :
org.apache.axis.types.URI$MalformedURIException: Cannot initialize URI with
empty parameters .
I search on the Internet, but I cant fidn any solution or clues to resolve
this error.

To be more precise the gSOAP server is a magicservice from the samples on
there website.

Attach to this mail is the wsdl file and the Client Code file.

If someone have an idea of when it could come from.

Thanks in advance.

Maxime.
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="Service"
 targetNamespace="http://localhost:80/Service.wsdl";
 xmlns:tns="http://localhost:80/Service.wsdl";
 xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
 xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
 xmlns:xsd="http://www.w3.org/2001/XMLSchema";
 xmlns:ns1="http://tempuri.org/ns1.xsd";
 xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/";
 xmlns:MIME="http://schemas.xmlsoap.org/wsdl/mime/";
 xmlns:DIME="http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/";
 xmlns:WSDL="http://schemas.xmlsoap.org/wsdl/";
 xmlns="http://schemas.xmlsoap.org/wsdl/";>

<types>

 <schema targetNamespace="http://tempuri.org/ns1.xsd";
  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
  xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xmlns:xsd="http://www.w3.org/2001/XMLSchema";
  xmlns:ns1="http://tempuri.org/ns1.xsd";
  xmlns="http://www.w3.org/2001/XMLSchema";
  elementFormDefault="unqualified"
  attributeFormDefault="unqualified">
  <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
  <complexType name="ArrayOfint">
   <complexContent>
    <restriction base="SOAP-ENC:Array">
     <sequence>
      <element name="item" type="xsd:int" minOccurs="0" maxOccurs="unbounded"/>
     </sequence>
     <attribute ref="SOAP-ENC:arrayType" WSDL:arrayType="xsd:int[]"/>
    </restriction>
   </complexContent>
  </complexType>
  <complexType name="ArrayOfArrayOfint">
   <complexContent>
    <restriction base="SOAP-ENC:Array">
     <sequence>
      <element name="item" type="ns1:ArrayOfint" minOccurs="0" maxOccurs="unbounded"/>
     </sequence>
     <attribute ref="SOAP-ENC:arrayType" WSDL:arrayType="ns1:ArrayOfint[]"/>
    </restriction>
   </complexContent>
  </complexType>
  <!-- operation request element -->
  <element name="magic">
   <complexType>
    <sequence>
     <element name="rank" type="xsd:int" minOccurs="1" maxOccurs="1"/>
    </sequence>
   </complexType>
  </element>
  <!-- operation response element -->
  <element name="magicResponse">
   <complexType>
    <sequence>
     <element name="result" type="ns1:ArrayOfArrayOfint" minOccurs="0" maxOccurs="1" nillable="true"/>
    </sequence>
   </complexType>
  </element>
 </schema>

</types>

<message name="magicRequest">
 <part name="parameters" element="ns1:magic"/>
</message>

<message name="magicResponse">
 <part name="parameters" element="ns1:magicResponse"/>
</message>

<portType name="ServicePortType">
 <operation name="magic">
  <documentation>Service definition of function ns1__magic</documentation>
  <input message="tns:magicRequest"/>
  <output message="tns:magicResponse"/>
 </operation>
</portType>

<binding name="Service" type="tns:ServicePortType">
 <SOAP:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
 <operation name="magic">
  <SOAP:operation soapAction=""/>
  <input>
     <SOAP:body parts="parameters" use="literal"/>
  </input>
  <output>
     <SOAP:body parts="parameters" use="literal"/>
  </output>
 </operation>
</binding>

<service name="Service">
 <documentation>gSOAP 2.7.10 generated service definition</documentation>
 <port name="Service" binding="tns:Service">
  <SOAP:address location="http://ozzy-6.tml.hut.fi:15081"/>
 </port>
</service>

</definitions>
import localhost.Service_wsdl.*;
import java.net.URL;
import java.rmi.RemoteException;
import javax.xml.rpc.ServiceException;

public class ServiceClient{
    public static void main(String[] args)throws Exception {
        try{
	    String url = "http://ozzy-6.tml.hut.fi:15082/";;
	    int rank = 5;
	    Service service = new ServiceLocator();
	    ServicePortType port = service.getService(new URL(url));
	    String addr = service.getServiceAddress();
	    System.out.println("Service address : "+addr+"\n");
	    try{
		int[][] response = port.magic(rank);
	    }catch (RemoteException e1){
		e1.printStackTrace();
	    }
        }catch (ServiceException e) {
	    e.printStackTrace();
        }
    }
} 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to