Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 98258 invoked from network); 10 Apr 2006 10:55:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 10 Apr 2006 10:55:36 -0000 Received: (qmail 87500 invoked by uid 500); 10 Apr 2006 10:54:48 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 87468 invoked by uid 500); 10 Apr 2006 10:54:48 -0000 Mailing-List: contact axis-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-dev@ws.apache.org Received: (qmail 87438 invoked by uid 99); 10 Apr 2006 10:54:47 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Apr 2006 03:54:47 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of for.svkrish@gmail.com designates 64.233.166.180 as permitted sender) Received: from [64.233.166.180] (HELO pproxy.gmail.com) (64.233.166.180) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Apr 2006 03:54:45 -0700 Received: by pproxy.gmail.com with SMTP id b29so1055901pya for ; Mon, 10 Apr 2006 03:54:25 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=hI4ICUp8upxaSc0PS7B3nkUTNBKZlfwkk0+1+XtRlVCQfivCCp2jcc20CQ5HlYpT+cdzi143exY79geyzH7cyoz6mjin/wHvNVse1yDpAFvShCbnDrAtrFENS90hT+y/JPKslq6p2CzESO+6Ht4MqRTunApuF8WCkXoBsuXljVw= Received: by 10.35.39.2 with SMTP id r2mr248007pyj; Mon, 10 Apr 2006 03:54:25 -0700 (PDT) Received: by 10.35.18.16 with HTTP; Mon, 10 Apr 2006 03:54:25 -0700 (PDT) Message-ID: <33e260400604100354n461bdd1fv9c7646c29902a0e2@mail.gmail.com> Date: Mon, 10 Apr 2006 16:24:25 +0530 From: "Venkata Krishnan" To: axis-dev@ws.apache.org Subject: Re: [jira] Kommentiert: (AXIS2-544) Java2WSDL generates invalid WSDL In-Reply-To: <1943731489.1144074833147.JavaMail.jira@ajax> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1593_2160684.1144666465179" References: <57519975.1144046326997.JavaMail.jira@ajax> <1943731489.1144074833147.JavaMail.jira@ajax> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_1593_2160684.1144666465179 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi.. I see that you have the namespaces in the schema element sorted out. = I don't see those namespaces with n0, n1, n2 prefixes. Is this updated into the Axis2 Code? When I looked into the code it seems that these things get added during the serialization of the XMLSchema. There is a transformer that the XMLSchemaSerializer (in the apache ws commons) and this is where there is a problem. Has this been already figured out and fixed? - Krish On 4/3/06, Sebastian Mittelst=E4dt (JIRA) wrote: > > [ > http://issues.apache.org/jira/browse/AXIS2-544?page=3Dcomments#action_123= 72952] > > Sebastian Mittelst=E4dt commented on AXIS2-544: > --------------------------------------------- > > I got it running, when you specify no namespaces (no -tn -tp -stn -stp) > the generated WSDL is valid. > > HOWEVER: > > When specifying namespaces, the generated WSDL contains errors at the > wsdl:message definitions: > The wsdl:part element is buggy. > > The "element" attribute gets assigned the wrong namespace, it gets > actually assigned the TNS of the WSDL, but it must be assigned the > schema-namespace. In addition, the schema-namespace has to be be declared= at > the wsdl:definitions element. > > Here is the generated invalid WSDL: > > > xmlns:wsdl=3D"http://schemas.xmlsoap.org/wsdl/" xmlns:tns=3D" > http://ws.apache.org/axis2" xmlns:xs=3D"http://www.w3.org/2001/XMLSchema" > xmlns:soap=3D"http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns1=3D" > http://org.apache.axis2/xsd"> > > elementFormDefault=3D"unqualified" attributeFormDefault=3D"unqualified" > xmlns:r002schema=3D"com.mycompany.r002.schema"> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > http://schemas.xmlsoap.org/soap/http"/> > > > > > > > > > > > > > > > > > > > Have a look at this > > > > > > > Actually, ns1 is xmlns:ns1=3D"http://org.apache.axis2/xsd". > > But for the WSDL to be valid, the namespace has to be r002schema, the > schema-namespace. > > Correct would be > > > > > > > The namespace r002schema is xmlns:r002schema=3D"com.mycompany.r002.schema= ", > but it is actually only defined at the schema. > > For the WSDL to be valid, it has to be declared at the wsdl:definitions > element. > > With those changes, the WSDL is valid. > > > > > > > > > > > > Java2WSDL generates invalid WSDL > > -------------------------------- > > > > Key: AXIS2-544 > > URL: http://issues.apache.org/jira/browse/AXIS2-544 > > Project: Apache Axis 2.0 (Axis2) > > Type: Bug > > > Components: Tools > > Versions: 0.95 > > Reporter: Sebastian Mittelst=E4dt > > > > > In 0.95, the Java2WSDL class generates invalid WSDL. > > The following WSDL was generated with Java2WSDL: > > java2wsdl -cn com.mycompany.r002.R002 -cp bin -tn > http://com.mycompany.r002 -stn http://com.mycompany.r002.schema -stp > r002schema -sn r002 -of r002.wsdl > > This generated the following WSDL: > > > > http://www.w3.org/2001/XMLSchema" xmlns:soap=3D" > http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl=3D" > http://schemas.xmlsoap.org/wsdl/" xmlns:tns=3D"http://com.mycompany.r002"= > > > > > elementFormDefault=3D"unqualified" attributeFormDefault=3D"unqualified" > xmlns:r002schema=3D"http://com.mycompany.r002.schema"> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > style=3D"document"/> > > > > > > > > > > > > > > > > > > > > > > > > > > "/> > > > > > > > > This WSDL is invalid due to the following errors: > > - The value 'axis2:r002Binding' of attribute 'binding' on element > 'wsdl:port' is not valid with respect to its type, 'QName'. > > - The value 'r002schema:calculateRequest' of attribute 'element' on > element 'wsdl:part' is not valid with respect to its type, 'QName'. > > - The value 'r002schema:calculateResponse' of attribute 'element' on > element 'wsdl:part' is not valid with respect to its type, 'QName'. > > - Cannot resolve 'axis2:r002Binding' as a QName: the prefix 'axis2' is > not declared. > > - Cannot resolve 'r002schema:calculateRequest' as a QName: the prefix > 'r002schema' is not declared. > > - Cannot resolve 'r002schema:calculateResponse' as a QName: the prefix > 'r002schema' is not declared. > > -- > This message is automatically generated by JIRA. > - > If you think it was sent incorrectly contact one of the administrators: > http://issues.apache.org/jira/secure/Administrators.jspa > - > For more information on JIRA, see: > http://www.atlassian.com/software/jira > > ------=_Part_1593_2160684.1144666465179 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi.. I see that you have the namespaces in the schema element sorted out.  I don't see those namespaces with n0, n1, n2 prefixes.  Is this updated into the Axis2 Code?  When I looked into the code it seems that these things get added during the serialization of the XMLSchema.  There is a transformer that the XMLSchemaSerializer (in the apache ws commons) and this is where there is a problem.  Has this been already figured out and fixed?

- Krish

On 4/3/06, Sebastian Mittelst=E4dt (JIRA) <jira@apache.org> wrote:
    [ http://issues.apache.org/jira/bro= wse/AXIS2-544?page=3Dcomments#action_12372952 ]

Sebastian Mittel= st=E4dt commented on AXIS2-544:
---------------------------------------------

I got it running, = when you specify no namespaces (no -tn -tp -stn -stp) the generated WSDL is= valid.

HOWEVER:

When specifying namespaces, the generated WS= DL contains errors at the wsdl:message definitions:
The wsdl:part element is buggy.

The "element" attribute gets assigned the wrong namespace, it gets ac= tually assigned the TNS of the WSDL, but it must be assigned the schema-namespace. In addition, the schema-namespace has to be be declared at the wsdl:definitions element.

Here is the generated inva= lid WSDL:

<?xml version=3D"1.0" encoding=3D"UTF-8&= quot;?>
<wsdl:definitions targetNamespace=3D" http://ws.apache.org/axis2" xmlns:wsdl=3D"http://schemas.xmlsoap.org/wsdl/" xmlns:= tns=3D"http://ws.apache.org/axi= s2 " xmlns:xs=3D"http:/= /www.w3.org/2001/XMLSchema" xmlns:soap=3D"http://schemas.xmlsoap.org/wsdl/soap/&qu= ot; xmlns:ns1=3D" http://org.apache.axis2/xsd&quo= t;>
  <wsdl:types>
    <xs:= schema targetNamespace=3D"com.mycompany.r002.schema" elementFormD= efault=3D"unqualified" attributeFormDefault=3D"unqualified&q= uot; xmlns:r002schema=3D" com.mycompany.r002.schema">
    <!-- Some= definitions omitted -->
      <xs:e= lement name=3D"calculate">
     &n= bsp;  <xs:complexType>
     &nb= sp;    <xs:sequence>
    &= nbsp;       <xs:element type=3D"r002schema:Input" name=3D"param0"/>
 = ;         </xs:sequence>=
        </xs:complexType>=
      </xs:element>
  =     <xs:element name=3D"calculateResponse"= >
        <xs:complexType><= br>          <xs:seque= nce>
          &nbs= p; <xs:element type=3D"r002schema:Output" name=3D"return"/>
&nbs= p;         </xs:sequence>= ;
        </xs:complexType>= ;
      </xs:element>
  = ;  </xs:schema>
  </wsdl:types>
 = ; <wsdl:message name=3D"calculateRequestMessage">
    <wsdl:part element=3D"ns1:calculate&quo= t; name=3D"part1"/>
  </wsdl:message>
&n= bsp; <wsdl:message name=3D"calculateReponseMessage">    <wsdl:part element=3D"ns1:calculateRespon= se" name=3D"part1"/>
  </wsdl:message>
  <wsdl:portType name= =3D"r002PortType">
    <wsdl:operati= on name=3D"calculate">
      = <wsdl:input message=3D"tns:calculateRequestMessage"/>
      <wsdl:output message=3D"tns:cal= culateReponseMessage"/>
    </wsdl:operat= ion>
  </wsdl:portType>
  <wsdl:bindi= ng type=3D"tns:r002PortType" name=3D"r002SOAP11Binding"= >
    <soap:binding style=3D"document" t= ransport=3D"http://sc= hemas.xmlsoap.org/soap/http"/>
    <w= sdl:operation name=3D"calculate">
      <soap:operation style=3D"do= cument" soapAction=3D"calculate"/>
   &= nbsp;  <wsdl:input>
      =   <soap:body namespace=3D"com.mycompany.r002" use=3D= "literal"/>
      </wsdl:i= nput>
      <wsdl:output>
  =       <soap:body namespace=3D"com.myc= ompany.r002" use=3D"literal"/>
    = ;  </wsdl:output>
    </wsdl:oper= ation>
  </wsdl:binding>
  <wsdl:serv= ice name=3D"r002">
    <wsdl:port binding=3D"tns:r002SOAP11Bin= ding" name=3D"r002port">
     = ; <soap:address location=3D"http://localhost:8080/axis2/services/r002 "/>
    </wsdl:port>
 &nbs= p;</wsdl:service>
</wsdl:definitions>


Have a look= at this
<snippet>
   <wsdl:message name=3D"c= alculateRequestMessage">
      <= ;wsdl:part element=3D"ns1:calculate" name=3D"part1"/>= ;
  </wsdl:message>
</snippet>

Actually, = ns1 is xmlns:ns1=3D"http://org= .apache.axis2/xsd".

But for the WSDL to be valid, the names= pace has to be r002schema,  the schema-namespace.

Correct would be
<snippet>
   <wsdl:messag= e name=3D"calculateRequestMessage">
    = ;<wsdl:part element=3D"r002schema:calculate" name=3D"part= 1"/>
  </wsdl:message>
</snippet>

The namespace r002schema is xmlns:r002schema=3D= "com.mycompany.r002.schema", but it is actually only defined at t= he schema.

For the WSDL to be valid, it has to be declared at the ws= dl:definitions element.

With those changes, the WSDL is valid.






<= br>


> Java2WSDL generates invalid WSDL
> --------------= ------------------
>
>       = ;   Key: AXIS2-544
>     &nbs= p;    URL:=20 http://issues.ap= ache.org/jira/browse/AXIS2-544
>     &nb= sp;Project: Apache Axis 2.0 (Axis2)
>     &n= bsp;   Type: Bug

>   Components: Tools
>= ;     Versions:=20 0.95
>     Reporter: Sebastian Mittelst=E4dt
<= br>>
> In 0.95, the Java2WSDL class generates invalid WSDL.
>= ; The following WSDL was generated with Java2WSDL:
> java2wsdl -cn co= m.mycompany.r002.R002 -cp bin -tn http://com.mycompany.r00= 2 -stn http://com.mycompan= y.r002.schema -stp r002schema -sn r002 -of r002.wsdl
> This gener= ated the following WSDL:
> <?xml version=3D"1.0" encoding=3D"UTF-8"?&g= t;
> <wsdl:definitions targetNamespace=3D"http://com.mycompany.r002" xmlns:xs=3D" http://www.w3.org/2001/XMLSchema" xmlns:soap=3D"http://schemas.xmlsoap.org/wsdl/soap/<= /a>" xmlns:wsdl=3D"h= ttp://schemas.xmlsoap.org/wsdl/ " xmlns:tns=3D"http://c= om.mycompany.r002">
>   <wsdl:types>
&= gt;     <xs:schema targetNamespace=3D" http://com.mycompany.r002.schema" elementFormDefault=3D"unqua= lified" attributeFormDefault=3D"unqualified" xmlns:r002schem= a=3D"http://com.mycompany= .r002.schema ">
>       <!-- Type def= initions (omitted) -->
>     </xs:schema>= ;
>   </wsdl:types>
>   <wsdl:mess= age name=3D"calculateResponseMessage">
>  &nbs= p;  <wsdl:part name=3D"part1" element=3D"r002schema:= calculateResponse"/>
>   </wsdl:message>
>   <wsdl:mes= sage name=3D"calculateRequestMessage">
>  &nbs= p;  <wsdl:part name=3D"part1" element=3D"r002schema:= calculateRequest"/>
>   </wsdl:message>
>   <wsdl:portType name=3D"r002PortType"><= br>>     <wsdl:operation name=3D"calculate&q= uot;>
>       <wsdl:input message= =3D"tns:calculateRequestMessage"/>
>   &n= bsp;   <wsdl:output message=3D"tns:calculateResponseMessa= ge"/>
>     </wsdl:operation>
>  = ; </wsdl:portType>
>   <wsdl:binding name=3D"= r002Binding" type=3D"tns:r002PortType">
> &nbs= p;   <soap:binding transport=3D" http://schemas.xmlsoap.org/soap/http" style=3D"document"= />
>     <wsdl:operation name=3D"calcu= late">
>       <soap:operati= on soapAction=3D"calculate" style=3D"document"/>
>       <wsdl:input>
>&nbs= p;        <soap:body use=3D"lite= ral" namespace=3D"http://co= m.mycompany.r002"/>
>      = </wsdl:input>
>       <wsdl:o= utput>
>         <soap:body use= =3D"literal" namespace=3D"http://com.mycompany.r002"/>
>    = ;   </wsdl:output>
>     </wsd= l:operation>
>   </wsdl:binding>
>   <wsdl:service= name=3D"r002">
>     <wsdl:port = name=3D"r002Port" binding=3D"axis2:r002Binding">
= >       <soap:address location=3D" http://127.0.0.1:8080= /axis2/services/r002"/>
>     </ws= dl:port>
>   </wsdl:service>
> </wsdl:def= initions>
> This WSDL is invalid due to the following errors:
> - The value 'axis2:r002Binding' of attribute 'binding' on element 'wsdl:port' is not valid with respect to its type, 'QName'.
> - The value 'r002schema:calculateRequest' of attribute 'element' on element 'wsdl:part' is not valid with respect to its type, 'QName'.
> - The value 'r002schema:calculateResponse' of attribute 'element' on element 'wsdl:part' is not valid with respect to its type, 'QName'.
>= - Cannot resolve 'axis2:r002Binding' as a QName: the prefix 'axis2' is not= declared.
> - Cannot resolve 'r002schema:calculateRequest' as a QNam= e: the prefix 'r002schema' is not declared.
> - Cannot resolve 'r002schema:calculateResponse' as a QName: the pr= efix 'r002schema' is not declared.

--
This message is automatical= ly generated by JIRA.
-
If you think it was sent incorrectly contact = one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
= -
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


------=_Part_1593_2160684.1144666465179--