2 Replies Latest reply on Nov 23, 2006 4:16 AM by dlofthouse

    BUG: WSDL generate wrong java file when service port name co

    ppgogo

      the wsdl file is like below, it has a port named "SoapPortTypePort"

      <?xml version="1.0" encoding="UTF-8"?>
      <definitions name="MainIM_ServiceProxy" targetNamespace="http://ws.ydeng.com" xmlns:tns="http://ws.ydeng.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/">
       <types>
       </types>
       <message name="SoapPortType_getCountResponse">
       <part name="result" type="xsd:int"/>
       </message>
       <message name="SoapPortType_getCount">
       <part name="String_1" type="xsd:string"/>
       </message>
       <portType name="SoapPortType">
       <operation name="getCount" parameterOrder="String_1">
       <input message="tns:SoapPortType_getCount"/>
       <output message="tns:SoapPortType_getCountResponse"/>
       </operation>
       </portType>
       <binding name="SoapPortTypeBinding" type="tns:SoapPortType">
       <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
       <operation name="getCount">
       <soap:operation soapAction=""/>
       <input>
       <soap:body use="literal" namespace="http://ws.ydeng.com"/>
       </input>
       <output>
       <soap:body use="literal" namespace="http://ws.ydeng.com"/>
       </output>
       </operation>
       </binding>
       <service name="MainIM_ServiceProxy">
       <port name="SoapPortTypePort" binding="tns:SoapPortTypeBinding">
       <soap:address location="http://localhost/WebService-ejb/MainIM_ServiceProxyBean"/>
       </port>
       </service>
      </definitions>


      use the wstools to generate the java files, then it will generate 2 files:
      Soap.java (it should be SoapPortType.java)
      MainIM_ServiceProxy.java
      But in the MainIM_ServiceProxy, it generate the right type name.
      see the java code below:
      package com.ydeng.ws;
      
      
      import javax.xml.rpc.*;
      
      
      public interface MainIM_ServiceProxy extends javax.xml.rpc.Service
      {
      
       public com.ydeng.ws.SoapPortType getSoapPortTypePort() throws ServiceException;
      
      }
      

      package com.ydeng.ws;
      public interface Soap extends java.rmi.Remote
      {
      
       public int getCount(java.lang.String string_1) throws java.rmi.RemoteException;
      }


        • 1. Re: BUG: WSDL generate wrong java file when service port nam
          ppgogo

          re-attach the wsdl file:

          <?xml version="1.0" encoding="UTF-8"?>
          <definitions name="MainIM_ServiceProxy" targetNamespace="http://ws.ydeng.com" xmlns:tns="http://ws.ydeng.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/">
           <types>
           </types>
           <message name="SoapPortType_getCountResponse">
           <part name="result" type="xsd:int"/>
           </message>
           <message name="SoapPortType_getCount">
           <part name="String_1" type="xsd:string"/>
           </message>
           <portType name="SoapPortType">
           <operation name="getCount" parameterOrder="String_1">
           <input message="tns:SoapPortType_getCount"/>
           <output message="tns:SoapPortType_getCountResponse"/>
           </operation>
           </portType>
           <binding name="SoapPortTypeBinding" type="tns:SoapPortType">
           <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
           <operation name="getCount">
           <soap:operation soapAction=""/>
           <input>
           <soap:body use="literal" namespace="http://ws.ydeng.com"/>
           </input>
           <output>
           <soap:body use="literal" namespace="http://ws.ydeng.com"/>
           </output>
           </operation>
           </binding>
           <service name="MainIM_ServiceProxy">
           <port name="SoapPortTypePort" binding="tns:SoapPortTypeBinding">
           <soap:address location="http://localhost/WebService-ejb/MainIM_ServiceProxyBean"/>
           </port>
           </service>
          </definitions>


          • 2. Re: BUG: WSDL generate wrong java file when service port nam
            dlofthouse