views:

942

answers:

2

I have a web server built in Delphi, and I'm trying to consume its web services on Java (I'm using Eclipse IDE) by creating a Web Service Client through the Eclipse wizard. The Web Services Explorer recognice the WSDL file, but when trying to create the client, the wizard says there's an "unexpected attribute" and does not create any file.

This is my wsdl file (the one that my Delphi Web Server publishes).

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="ITSOAPWebServiceservice" targetNamespace="http://tempuri.org/" xmlns:tns="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"&gt;
  <message name="WebMethod0Request">
    <part name="Document" type="xs:string"/>
  </message>
  <message name="WebMethod0Response">
    <part name="return" type="xs:boolean"/>
  </message>
  <portType name="ITSOAPWebService">
    <operation name="WebMethod">
      <input message="tns:WebMethod0Request"/>
      <output message="tns:WebMethod0Response"/>
    </operation>
  </portType>
  <binding name="ITSOAPWebServicebinding" type="tns:ITSOAPWebService">
    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/&gt;
    <operation name="WebMethod">
      <soap:operation soapAction="urn:TWebServiceIntf1-ITSOAPWebService#WebMethod" style="rpc"/>
      <input message="tns:WebMethod0Request">
        <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:TWebServiceIntf1-ITSOAPWebService"/>
      </input>
      <output message="tns:WebMethod0Response">
        <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:TWebServiceIntf1-ITSOAPWebService"/>
      </output>
    </operation>
  </binding>
  <service name="ITSOAPWebServiceservice">
    <port name="ITSOAPWebServicePort" binding="tns:ITSOAPWebServicebinding">
      <soap:address location="http://localhost:1024/soap/ITSOAPWebService"/&gt;
    </port>
  </service>
</definitions>

Now, Eclipse says that the "message" attribute in both:

definicions.binding.operation.input  
definitions.binding.operation.output

is unexpected. I know it's redundant, since these are already defined in

definitions.portType.operation.input  
definitions.portType.operation.output

but still, I can't import the web service.

My Java app will be running on a JBoss 4.2 server, but I thought it'd be easier to create the client as a Java Utility Project (since it creates only one project instead of two).

So, any idea on how to make Eclipse ignore these attributes, or Delphi not to publish them?

A: 

A couple of questions: What do you mean by import the webservice? Are you trying to comsume it in a java application? What technology stack are you using? or are you just using plain java?

Abarax
+1  A: 

Try Axis2 from apache, look at the wsdl2java command to generate a java client to your Delphi web service. If you are using Ant for your build there is a task to generate your client.

http://ws.apache.org/axis2/1_3/userguide-creatingclients.html

Anson Smith