You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Shantanu Sen <ss...@pacbell.net> on 2003/07/30 01:05:16 UTC

soap fault and WSDL2Java question

When I use the following WSDL file, I get this error,
even though the WSDL is validated by Cape Clear WSDL
editor, and I see the name attribute is there. 

java.io.IOException: ERROR: Fault is missing a name=
attribute in operation "MyOperation", in binding
{http://MyService}rpc-encoded.        at
org.apache.axis.wsdl.symbolTable.SymbolTable.faultsFromSOAPFault(Symb
olTable.java:1988)        at
org.apache.axis.wsdl.symbolTable.SymbolTable.populateBindings(SymbolT
able.java:1801)        at
org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav
a:577)        at
org.apache.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:421
)        at
org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav
a:408)        at
org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav
a:393)        at
org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:245)
        at java.lang.Thread.run(Thread.java:479)

The WSDL file is attadched, but here is the relvant
section:

<binding name="rpc-encoded" type="tns:MyPort">
    <soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="MyOperation">
      <soap:operation soapAction="MyOperation"/>
      <input>
        <soap:body use="encoded"
namespace="http://MyService"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      </input>
      <output>
        <soap:body use="encoded"
namespace="http://MyService"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      </output>
      <fault>
        <soap:fault  name="tns:MyF"  use="encoded"
namespace="http://MyService"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
/>
      </fault>
    </operation>
</binding>


I am declaring the name attribute here, as you can
see. But with Axis 1.1 I get the above error. It runs
fine with Axis 1.0, which, I believe ignores the name
attribute in a soap fault declaration.

Any ideas what I am missing?

Thanks,
Shantanu Sen

Re: soap fault and WSDL2Java question

Posted by Anne Thomas Manes <an...@manes.net>.
I didn't notice this before -- there's another problem in your WSDL. A Fault assumes document style, therefore your MyException wsdl:message definition should reference an element definition rather than specify a type definition. You also should remove the encodingStyle and namespace attributes from the soap:fault definition.

Anne
  ----- Original Message ----- 
  From: Shantanu Sen 
  To: axis-user@ws.apache.org 
  Sent: Tuesday, July 29, 2003 9:54 PM
  Subject: Re: soap fault and WSDL2Java question


  I found the error. I did not have the name attribute of wsdl:fault. I was focusing on the name attribute of the soap:fault, which is not really required: 

  <fault name="MyF"> 
  <soap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
  namespace="http://MyService/binding" 
  use="literal"/> 
  </fault> 

  I can run WSDL2Java with the above change without any problem. But CapeClear does not validate this unless I add a name attribute to the soap:fault. Is the name attribute required in soap:fault? I looked at the WSDL spec. section 3.6, but I am still not clear if it is mandatory.


  Shantanu Sen 
  Shantanu Sen <ss...@pacbell.net> wrote:Anne, 

  Thanks. But even with that change I get the same 
  error. It seems that javax.xml.BindingFault.getName() 
  returns null. I am not sure why it is not picking up 
  the name attribute. I could not step into that part of 
  the code which is creating the Bindi! ngFault, which is 
  in the wsdl4j.jar 

  Thanks, 
  Shantanu 

  --- Anne Thomas Manes wrote: 
  > Shantanu, 
  > 
  > The name= attribute should specify a nmtoken, not a 
  > QName. 
  > Therefore your WSDL definition should read: 
  > 
  > > namespace="http://MyService" 
  > 
  encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
  > /> 
  > 
  > Regards, 
  > Anne 
  > 
  > ----- Original Message ----- 
  > From: "Shantanu Sen" 
  > To: 
  > Sent: Tuesday, July 29, 2003 7:05 PM 
  > Subject: soap fault and WSDL2Java question 
  > 
  > 
  > > When I use the following WSDL file, I get this 
  > error, 
  > > even though the WSDL is validated by Cape Clear 
  > WSDL 
  > > editor, and I see the name attribute is there. 
  > > 
  > > java.io.IOException: ERROR: Fault is missing a 
  > name= 
  > > attribute in operation "MyOper! ation", in binding 
  > > {http://MyService}rpc-encoded. at 
  > > 
  > 
  org.apache.axis.wsdl.symbolTable.SymbolTable.faultsFromSOAPFault(Symb 
  > > olTable.java:1988) at 
  > > 
  > 
  org.apache.axis.wsdl.symbolTable.SymbolTable.populateBindings(SymbolT 
  > > able.java:1801) at 
  > > 
  > 
  org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav 
  > > a:577) at 
  > > 
  > 
  org.apache.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:421 
  > > ) at 
  > > 
  > 
  org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav 
  > > a:408) at 
  > > 
  > 
  org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav 
  > > a:393) at 
  > > 
  > 
  org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:245) 
  > > at java.lang.Thread.run(Thread.java:479) 
  > > 
  > > The WSDL fi! le is attadched, but here is the 
  > relvant 
  > > section: 
  > > 
  > > 
  > > > > transport="http://schemas.xmlsoap.org/soap/http"/> 
  > > 
  > > 
  > > [input] 
  > > > > namespace="http://MyService" 
  > > 
  > 
  encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> 
  > > 
  > > 
  > > > > namespace="http://MyService" 
  > > 
  > 
  encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> 
  > > 
  > > 
  > > > > namespace="http://MyService" 
  > > 
  > 
  encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
  > > /> 
  > > 
  > > 
  > > 
  > > 
  > > 
  > > I am declaring the name attribute here, as you can 
  > > see. But with Axis 1.1 I get the above error. It 
  > runs 
  > > fine with Axis 1.0, which, I believe ig! nores the 
  > name 
  > > attribute in a soap fault declaration. 
  > > 
  > > Any ideas what I am missing? 
  > > 
  > > Thanks, 
  > > Shantanu Sen 
  > 
  > 
  > 
  ---------------------------------------------------------------------------- 
  > ---- 
  > 
  > 
  > > 
  > > 
  > > > > targetNamespace="http://MyService" 
  > > xmlns:tns="http://MyService" 
  > > xmlns:typens="http://MyService" 
  > > 
  > xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  > > 
  > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
  > > 
  > xmlns="http://schemas.xmlsoap.org/wsdl/"> 
  > > 
  > > 
  > > 
  > > 
  > > 
  > > 

  > > 
  > > 
  > > 
  > > 

  > > 
  > > 
  > > 
  > > 

  > > 
  > > 
  > > 
  > > 

  >! ; > 
  > > [input] 
  > > 
  > > > message="tns:MyException"/> 
  > > 
  > > 

  > > 
  > > 
  > > 
  > > > transport="http://schemas.xmlsoap.org/soap/http"/> 
  > > 
  > > 
  > > [input] 
  > > > namespace="http://MyService" 
  > 
  encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> 
  > > 
  > > 
  > > > namespace="http://MyService" 
  > 
  encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> 
  > > 
  > > 
  > > > namespace="http://MyService" 
  > 
  encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
  > /> 
  > > 
  > > 
  > > 
  > > 
  > > 
  > > 
  > > 

  > > > 
  location="http://localhost:8084/webservice/Test//Web+Input+Proxy"/> 
  > > 

  > > 
  > > 
  > > 
  > &g! t; 
  > > 
  > 



Re: soap fault and WSDL2Java question

Posted by Anne Thomas Manes <an...@manes.net>.
Per the SOAP Binding Schema [1], the name attribute is required in the
soap:tFault type:

  <xs:complexType name="tFault">
    <xs:complexContent>
             <xs:extension base="soap:tFaultRes">
                <xs:attribute name="name" type="xs:NCName" use="required" />
       </xs:extension>
     </xs:complexContent>
 </xs:complexType>

Likewise, per the WSDL Schema [2], the name attribute is also required in
the wsdl:tFault type:

<xs:complexType name="tFault">
  <xs:complexContent>
    <xs:extension base="wsdl:tExtensibleAttributesDocumented">
       <xs:attribute name="name" type="xs:NCName" use="required" />
       <xs:attribute name="message" type="xs:QName" use="required" />
    </xs:extension>
  </xs:complexContent>
</xs:complexType>


[1] http://schemas.xmlsoap.org/wsdl/soap/
[2] http://schemas.xmlsoap.org/wsdl/


Regards,
Anne

----- Original Message -----
From: Shantanu Sen
To: axis-user@ws.apache.org
Sent: Tuesday, July 29, 2003 9:54 PM
Subject: Re: soap fault and WSDL2Java question


I found the error. I did not have the name attribute of wsdl:fault. I was
focusing on the name attribute of the soap:fault, which is not really
required:

<fault name="MyF">
<soap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://MyService/binding"
use="literal"/>
</fault>

I can run WSDL2Java with the above change without any problem. But CapeClear
does not validate this unless I add a name attribute to the soap:fault. Is
the name attribute required in soap:fault? I looked at the WSDL spec.
section 3.6, but I am still not clear if it is mandatory.


Shantanu Sen
Shantanu Sen <ss...@pacbell.net> wrote:Anne,

Thanks. But even with that change I get the same
error. It seems that javax.xml.BindingFault.getName()
returns null. I am not sure why it is not picking up
the name attribute. I could not step into that part of
the code which is creating the Bindi! ngFault, which is
in the wsdl4j.jar

Thanks,
Shantanu

--- Anne Thomas Manes wrote:
> Shantanu,
>
> The name= attribute should specify a nmtoken, not a
> QName.
> Therefore your WSDL definition should read:
>
> > namespace="http://MyService"
>
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> />
>
> Regards,
> Anne
>
> ----- Original Message -----
> From: "Shantanu Sen"
> To:
> Sent: Tuesday, July 29, 2003 7:05 PM
> Subject: soap fault and WSDL2Java question
>
>
> > When I use the following WSDL file, I get this
> error,
> > even though the WSDL is validated by Cape Clear
> WSDL
> > editor, and I see the name attribute is there.
> >
> > java.io.IOException: ERROR: Fault is missing a
> name=
> > attribute in operation "MyOper! ation", in binding
> > {http://MyService}rpc-encoded. at
> >
>
org.apache.axis.wsdl.symbolTable.SymbolTable.faultsFromSOAPFault(Symb
> > olTable.java:1988) at
> >
>
org.apache.axis.wsdl.symbolTable.SymbolTable.populateBindings(SymbolT
> > able.java:1801) at
> >
>
org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav
> > a:577) at
> >
>
org.apache.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:421
> > ) at
> >
>
org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav
> > a:408) at
> >
>
org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav
> > a:393) at
> >
>
org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:245)
> > at java.lang.Thread.run(Thread.java:479)
> >
> > The WSDL fi! le is attadched, but here is the
> relvant
> > section:
> >
> >
> > > > transport="http://schemas.xmlsoap.org/soap/http"/>
> >
> >
> > [input]
> > > > namespace="http://MyService"
> >
>
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
> >
> >
> > > > namespace="http://MyService"
> >
>
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
> >
> >
> > > > namespace="http://MyService"
> >
>
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > />
> >
> >
> >
> >
> >
> > I am declaring the name attribute here, as you can
> > see. But with Axis 1.1 I get the above error. It
> runs
> > fine with Axis 1.0, which, I believe ig! nores the
> name
> > attribute in a soap fault declaration.
> >
> > Any ideas what I am missing?
> >
> > Thanks,
> > Shantanu Sen
>
>
>
----------------------------------------------------------------------------
> ----
>
>
> >
> >
> > > > targetNamespace="http://MyService"
> > xmlns:tns="http://MyService"
> > xmlns:typens="http://MyService"
> >
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> >
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> >
> xmlns="http://schemas.xmlsoap.org/wsdl/">
> >
> >
> >
> >
> >
> >

> >
> >
> >
> >

> >
> >
> >
> >

> >
> >
> >
> >

>! ; >
> > [input]
> >
> > > message="tns:MyException"/>
> >
> >

> >
> >
> >
> > > transport="http://schemas.xmlsoap.org/soap/http"/>
> >
> >
> > [input]
> > > namespace="http://MyService"
>
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
> >
> >
> > > namespace="http://MyService"
>
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
> >
> >
> > > namespace="http://MyService"
>
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> />
> >
> >
> >
> >
> >
> >
> >

> > >
location="http://localhost:8084/webservice/Test//Web+Input+Proxy"/>
> >

> >
> >
> >
> &g! t;
> >
>


Re: soap fault and WSDL2Java question

Posted by Shantanu Sen <ss...@pacbell.net>.
I found the error. I did not have the name attribute of wsdl:fault. I was focusing on the name attribute of the soap:fault, which is not really required: 

<fault name="MyF"> 
<soap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
namespace="http://MyService/binding" 
use="literal"/> 
</fault> 

I can run WSDL2Java with the above change without any problem. But CapeClear does not validate this unless I add a name attribute to the soap:fault. Is the name attribute required in soap:fault? I looked at the WSDL spec. section 3.6, but I am still not clear if it is mandatory.


Shantanu Sen 
Shantanu Sen <ss...@pacbell.net> wrote:Anne, 

Thanks. But even with that change I get the same 
error. It seems that javax.xml.BindingFault.getName() 
returns null. I am not sure why it is not picking up 
the name attribute. I could not step into that part of 
the code which is creating the BindingFault, which is 
in the wsdl4j.jar 

Thanks, 
Shantanu 

--- Anne Thomas Manes wrote: 
> Shantanu, 
> 
> The name= attribute should specify a nmtoken, not a 
> QName. 
> Therefore your WSDL definition should read: 
> 
> > namespace="http://MyService" 
> 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
> /> 
> 
> Regards, 
> Anne 
> 
> ----- Original Message ----- 
> From: "Shantanu Sen" 
> To: 
> Sent: Tuesday, July 29, 2003 7:05 PM 
> Subject: soap fault and WSDL2Java question 
> 
> 
> > When I use the following WSDL file, I get this 
> error, 
> > even though the WSDL is validated by Cape Clear 
> WSDL 
> > editor, and I see the name attribute is there. 
> > 
> > java.io.IOException: ERROR: Fault is missing a 
> name= 
> > attribute in operation "MyOperation", in binding 
> > {http://MyService}rpc-encoded. at 
> > 
> 
org.apache.axis.wsdl.symbolTable.SymbolTable.faultsFromSOAPFault(Symb 
> > olTable.java:1988) at 
> > 
> 
org.apache.axis.wsdl.symbolTable.SymbolTable.populateBindings(SymbolT 
> > able.java:1801) at 
> > 
> 
org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav 
> > a:577) at 
> > 
> 
org.apache.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:421 
> > ) at 
> > 
> 
org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav 
> > a:408) at 
> > 
> 
org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav 
> > a:393) at 
> > 
> 
org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:245) 
> > at java.lang.Thread.run(Thread.java:479) 
> > 
> > The WSDL file is attadched, but here is the 
> relvant 
> > section: 
> > 
> > 
> > > > transport="http://schemas.xmlsoap.org/soap/http"/> 
> > 
> > 
> > [input] 
> > > > namespace="http://MyService" 
> > 
> 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> 
> > 
> > 
> > > > namespace="http://MyService" 
> > 
> 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> 
> > 
> > 
> > > > namespace="http://MyService" 
> > 
> 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
> > /> 
> > 
> > 
> > 
> > 
> > 
> > I am declaring the name attribute here, as you can 
> > see. But with Axis 1.1 I get the above error. It 
> runs 
> > fine with Axis 1.0, which, I believe ignores the 
> name 
> > attribute in a soap fault declaration. 
> > 
> > Any ideas what I am missing? 
> > 
> > Thanks, 
> > Shantanu Sen 
> 
> 
> 
---------------------------------------------------------------------------- 
> ---- 
> 
> 
> > 
> > 
> > > > targetNamespace="http://MyService" 
> > xmlns:tns="http://MyService" 
> > xmlns:typens="http://MyService" 
> > 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> > 
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
> > 
> xmlns="http://schemas.xmlsoap.org/wsdl/"> 
> > 
> > 
> > 
> > 
> > 
> > 

> > 
> > 
> > 
> > 

> > 
> > 
> > 
> > 

> > 
> > 
> > 
> > 

> > 
> > [input] 
> > 
> > > message="tns:MyException"/> 
> > 
> > 

> > 
> > 
> > 
> > > transport="http://schemas.xmlsoap.org/soap/http"/> 
> > 
> > 
> > [input] 
> > > namespace="http://MyService" 
> 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> 
> > 
> > 
> > > namespace="http://MyService" 
> 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> 
> > 
> > 
> > > namespace="http://MyService" 
> 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
> /> 
> > 
> > 
> > 
> > 
> > 
> > 
> > 

> > > 
location="http://localhost:8084/webservice/Test//Web+Input+Proxy"/> 
> > 

> > 
> > 
> > 
> > 
> > 
> 



Re: soap fault and WSDL2Java question

Posted by Shantanu Sen <ss...@pacbell.net>.
Anne,

Thanks. But even with that change I get the same
error. It seems that javax.xml.BindingFault.getName()
returns null. I am not sure why it is not picking up
the name attribute. I could not step into that part of
the code which is creating the BindingFault, which is
in the wsdl4j.jar

Thanks,
Shantanu

--- Anne Thomas Manes <an...@manes.net> wrote:
> Shantanu,
> 
> The name= attribute should specify a nmtoken, not a
> QName.
> Therefore your WSDL definition should read:
> 
> <soap:fault  name="MyF"  use="encoded"
> namespace="http://MyService"
>
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> />
> 
> Regards,
> Anne
> 
> ----- Original Message -----
> From: "Shantanu Sen" <ss...@pacbell.net>
> To: <ax...@ws.apache.org>
> Sent: Tuesday, July 29, 2003 7:05 PM
> Subject: soap fault and WSDL2Java question
> 
> 
> > When I use the following WSDL file, I get this
> error,
> > even though the WSDL is validated by Cape Clear
> WSDL
> > editor, and I see the name attribute is there.
> >
> > java.io.IOException: ERROR: Fault is missing a
> name=
> > attribute in operation "MyOperation", in binding
> > {http://MyService}rpc-encoded.        at
> >
>
org.apache.axis.wsdl.symbolTable.SymbolTable.faultsFromSOAPFault(Symb
> > olTable.java:1988)        at
> >
>
org.apache.axis.wsdl.symbolTable.SymbolTable.populateBindings(SymbolT
> > able.java:1801)        at
> >
>
org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav
> > a:577)        at
> >
>
org.apache.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:421
> > )        at
> >
>
org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav
> > a:408)        at
> >
>
org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav
> > a:393)        at
> >
>
org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:245)
> >         at java.lang.Thread.run(Thread.java:479)
> >
> > The WSDL file is attadched, but here is the
> relvant
> > section:
> >
> > <binding name="rpc-encoded" type="tns:MyPort">
> >     <soap:binding style="rpc"
> > transport="http://schemas.xmlsoap.org/soap/http"/>
> >     <operation name="MyOperation">
> >       <soap:operation soapAction="MyOperation"/>
> >       <input>
> >         <soap:body use="encoded"
> > namespace="http://MyService"
> >
>
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
> >       </input>
> >       <output>
> >         <soap:body use="encoded"
> > namespace="http://MyService"
> >
>
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
> >       </output>
> >       <fault>
> >         <soap:fault  name="tns:MyF"  use="encoded"
> > namespace="http://MyService"
> >
>
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > />
> >       </fault>
> >     </operation>
> > </binding>
> >
> >
> > I am declaring the name attribute here, as you can
> > see. But with Axis 1.1 I get the above error. It
> runs
> > fine with Axis 1.0, which, I believe ignores the
> name
> > attribute in a soap fault declaration.
> >
> > Any ideas what I am missing?
> >
> > Thanks,
> > Shantanu Sen
> 
> 
>
----------------------------------------------------------------------------
> ----
> 
> 
> > <?xml version="1.0" ?>
> >
> > <definitions name="http://MyService"
> >              targetNamespace="http://MyService"
> >              xmlns:tns="http://MyService"
> >              xmlns:typens="http://MyService"
> >             
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> >             
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> >             
> xmlns="http://schemas.xmlsoap.org/wsdl/">
> >
> >   <!-- type defs -->
> >
> >   <!-- message declns -->
> >   <message name="MyRequest">
> >     <part name="subject" type="xsd:string"/>
> >   </message>
> >
> >   <message name="MyResponse">
> >     <part name="confirmation" type="xsd:string"/>
> >   </message>
> >
> >   <message name="MyException">
> >     <part name="exception" type="xsd:string"/>
> >   </message>
> >
> >   <!-- port type declns -->
> >   <portType name="MyPort">
> >     <operation name="MyOperation">
> >       <input message="tns:MyRequest"/>
> >       <output message="tns:MyResponse"/>
> >       <fault name="MyF"
> message="tns:MyException"/>
> >     </operation>
> >   </portType>
> >
> >   <!-- binding declns -->
> >   <binding name="rpc-encoded" type="tns:MyPort">
> >     <soap:binding style="rpc"
> transport="http://schemas.xmlsoap.org/soap/http"/>
> >     <operation name="MyOperation">
> >       <soap:operation soapAction="MyOperation"/>
> >       <input>
> >         <soap:body use="encoded"
> namespace="http://MyService"
>
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
> >       </input>
> >       <output>
> >         <soap:body use="encoded"
> namespace="http://MyService"
>
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
> >       </output>
> >       <fault>
> >         <soap:fault  name="tns:MyF"  use="encoded"
> namespace="http://MyService"
>
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> />
> >       </fault>
> >     </operation>
> >   </binding>
> >
> >   <!-- service decln -->
> >   <service name="MyProvider">
> >     <port name="MyPort" binding="tns:rpc-encoded">
> >       <soap:address
>
location="http://localhost:8084/webservice/Test//Web+Input+Proxy"/>
> >     </port>
> >  </service>
> >
> > </definitions>
> >
> >
> 


Re: soap fault and WSDL2Java question

Posted by Anne Thomas Manes <an...@manes.net>.
Shantanu,

The name= attribute should specify a nmtoken, not a QName.
Therefore your WSDL definition should read:

<soap:fault  name="MyF"  use="encoded" namespace="http://MyService"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />

Regards,
Anne

----- Original Message -----
From: "Shantanu Sen" <ss...@pacbell.net>
To: <ax...@ws.apache.org>
Sent: Tuesday, July 29, 2003 7:05 PM
Subject: soap fault and WSDL2Java question


> When I use the following WSDL file, I get this error,
> even though the WSDL is validated by Cape Clear WSDL
> editor, and I see the name attribute is there.
>
> java.io.IOException: ERROR: Fault is missing a name=
> attribute in operation "MyOperation", in binding
> {http://MyService}rpc-encoded.        at
> org.apache.axis.wsdl.symbolTable.SymbolTable.faultsFromSOAPFault(Symb
> olTable.java:1988)        at
> org.apache.axis.wsdl.symbolTable.SymbolTable.populateBindings(SymbolT
> able.java:1801)        at
> org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav
> a:577)        at
> org.apache.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:421
> )        at
> org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav
> a:408)        at
> org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav
> a:393)        at
> org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:245)
>         at java.lang.Thread.run(Thread.java:479)
>
> The WSDL file is attadched, but here is the relvant
> section:
>
> <binding name="rpc-encoded" type="tns:MyPort">
>     <soap:binding style="rpc"
> transport="http://schemas.xmlsoap.org/soap/http"/>
>     <operation name="MyOperation">
>       <soap:operation soapAction="MyOperation"/>
>       <input>
>         <soap:body use="encoded"
> namespace="http://MyService"
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>       </input>
>       <output>
>         <soap:body use="encoded"
> namespace="http://MyService"
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>       </output>
>       <fault>
>         <soap:fault  name="tns:MyF"  use="encoded"
> namespace="http://MyService"
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> />
>       </fault>
>     </operation>
> </binding>
>
>
> I am declaring the name attribute here, as you can
> see. But with Axis 1.1 I get the above error. It runs
> fine with Axis 1.0, which, I believe ignores the name
> attribute in a soap fault declaration.
>
> Any ideas what I am missing?
>
> Thanks,
> Shantanu Sen


----------------------------------------------------------------------------
----


> <?xml version="1.0" ?>
>
> <definitions name="http://MyService"
>              targetNamespace="http://MyService"
>              xmlns:tns="http://MyService"
>              xmlns:typens="http://MyService"
>              xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>              xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>              xmlns="http://schemas.xmlsoap.org/wsdl/">
>
>   <!-- type defs -->
>
>   <!-- message declns -->
>   <message name="MyRequest">
>     <part name="subject" type="xsd:string"/>
>   </message>
>
>   <message name="MyResponse">
>     <part name="confirmation" type="xsd:string"/>
>   </message>
>
>   <message name="MyException">
>     <part name="exception" type="xsd:string"/>
>   </message>
>
>   <!-- port type declns -->
>   <portType name="MyPort">
>     <operation name="MyOperation">
>       <input message="tns:MyRequest"/>
>       <output message="tns:MyResponse"/>
>       <fault name="MyF" message="tns:MyException"/>
>     </operation>
>   </portType>
>
>   <!-- binding declns -->
>   <binding name="rpc-encoded" type="tns:MyPort">
>     <soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
>     <operation name="MyOperation">
>       <soap:operation soapAction="MyOperation"/>
>       <input>
>         <soap:body use="encoded" namespace="http://MyService"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>       </input>
>       <output>
>         <soap:body use="encoded" namespace="http://MyService"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>       </output>
>       <fault>
>         <soap:fault  name="tns:MyF"  use="encoded"
namespace="http://MyService"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
>       </fault>
>     </operation>
>   </binding>
>
>   <!-- service decln -->
>   <service name="MyProvider">
>     <port name="MyPort" binding="tns:rpc-encoded">
>       <soap:address
location="http://localhost:8084/webservice/Test//Web+Input+Proxy"/>
>     </port>
>  </service>
>
> </definitions>
>
>