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 "Alex.K" <al...@gmail.com> on 2006/01/17 10:48:40 UTC

WSDL2JAVA for message style interfaces..

Hi,

I'm trying to generate the service stubs for a message style interface 
from a WSDL file but seems there are some namespace definitions such as: 
xmlns:tns3="http://dom.w3c.org" or xmlns:tns6="http://sax.xml.org which 
for them the namespaces have been imported but the schemaLocation is not 
generated. There is no schema at the specified URI either then the 
wsdl2java tool doesn't know how to process associated types; 
"Attributes" and "Node".

Does anybody know how to fix this problem and how to find/Where to 
import proper naming schema and so ??

There is a thread in this mailing list for the same problem but doesn't 
come with the final solution.


Cheers


Alex.


Parts of WSDL schema...

.
.
.

xmlns:apachesoap="http://xml.apache.org/xml-soap" 
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns2="http://message.axis.apache.org" xmlns:tns3="http://dom.w3c.org" xmlns:tns4="http://soap.xml.javax" xmlns:tns5="http://util.java" xmlns:tns6="http://sax.xml.org" xmlns:tns7="http://encoding.axis.apache.org" xmlns:tns8="http://soap.axis.apache.org" xmlns:tns9="http://schema.axis.apache.org" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.2.1
Built on Jun 07, 2005 (10:11:43 EDT)-->
 <wsdl:types>
  <schema targetNamespace="http://message.axis.apache.org" xmlns="http://www.w3.org/2001/XMLSchema">
   <import namespace="http://schema.axis.apache.org"/>
   <import namespace="http://encoding.axis.apache.org"/>
   <import namespace="http://soap.axis.apache.org"/>
   <import namespace="http://soap.xml.javax"/>
   <import namespace="http://util.java"/>
   <import namespace="http://sax.xml.org"/>
   <import namespace="http://xml.apache.org/xml-soap"/>
   <import namespace="http://dom.w3c.org"/>
   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
   <complexType name="NodeImpl">
    <sequence>
     <element name="attributes" nillable="true" type="xsd:anyType"/>
     <element name="childNodes" nillable="true" type="xsd:anyType"/>
     <element name="dirty" type="xsd:boolean"/>
     <element name="firstChild" nillable="true" type="xsd:anyType"/>
     <element name="lastChild" nillable="true" type="tns3:Node"/>
     <element name="localName" nillable="true" type="soapenc:string"/>
     <element name="namespaceURI" nillable="true" type="soapenc:string"/>
     <element name="nextSibling" nillable="true" type="tns3:Node"/>
     <element name="nodeName" nillable="true" type="soapenc:string"/>
     <element name="nodeType" type="xsd:short"/>
     <element name="nodeValue" nillable="true" type="soapenc:string"/>
     <element name="ownerDocument" nillable="true" type="apachesoap:Document"/>
     <element name="parentElement" nillable="true" type="xsd:anyType"/>
     <element name="parentNode" nillable="true" type="tns3:Node"/>
     <element name="prefix" nillable="true" type="soapenc:string"/>
     <element name="previousSibling" nillable="true" type="tns3:Node"/>
     <element name="value" nillable="true" type="soapenc:string"/>
    </sequence>
   </complexType>
   <complexType name="SAX2EventRecorder">
    <sequence>
     <element name="length" type="xsd:int"/>
    </sequence>
   </complexType>
   <complexType name="MessageElement">
    <complexContent>
     <extension base="tns2:NodeImpl">
      <sequence>
       <element name="ID" nillable="true" type="soapenc:string"/>
       <element name="NSMappings" nillable="true" type="impl:ArrayOf_xsd_anyType"/>
       <element name="QName" nillable="true" type="xsd:QName"/>
       <element name="allAttributes" nillable="true" type="xsd:anyType"/>
       <element name="asDOM" nillable="true" type="apachesoap:Element"/>
       <element name="asDocument" nillable="true" type="apachesoap:Document"/>
       <element name="asString" nillable="true" type="soapenc:string"/>
       <element name="attributesEx" nillable="true" type="xsd:anyType"/>
       <element name="childElements" nillable="true" type="tns5:Iterator"/>
       <element name="children" nillable="true" type="impl:ArrayOf_xsd_anyType"/>
       <element name="completeAttributes" nillable="true" type="tns6:Attributes"/>
       <element name="contentsIndex" type="xsd:int"/>
       <element name="deserializationContext" nillable="true" type="xsd:anyType"/>
       <element name="elementName" nillable="true" type="xsd:anyType"/>
       <element name="encodingStyle" nillable="true" type="soapenc:string"/>
       <element name="endIndex" type="xsd:int"/>
       <element name="envelope" nillable="true" type="tns2:SOAPEnvelope"/>
       <element name="fixupDeserializer" nillable="true" type="xsd:anyType"/>
       <element name="href" nillable="true" type="soapenc:string"/>
       <element name="length" type="xsd:int"/>
       <element name="name" nillable="true" type="soapenc:string"/>
       <element name="namespacePrefixes" nillable="true" type="tns5:Iterator"/>
       <element name="objectValue" nillable="true" type="xsd:anyType"/>
       <element name="realElement" nillable="true" type="tns2:MessageElement"/>
       <element name="recorder" nillable="true" type="tns2:SAX2EventRecorder"/>
       <element name="root" type="xsd:boolean"/>
       <element name="tagName" nillable="true" type="soapenc:string"/>
       <element name="type" nillable="true" type="xsd:QName"/>
       <element name="visibleNamespacePrefixes" nillable="true" type="tns5:Iterator"/>
       <element name="namespaces" nillable="true" type="impl:ArrayOf_xsd_anyType"/>
      </sequence>
     </extension>
    </complexContent>
   </complexType>
   <complexType name="SOAPBodyElement">
    <complexContent>
     <extension base="tns2:MessageElement">
      <sequence/>
     </extension>
    </complexContent>
   </complexType>

.
.
.

Re: WSDL2JAVA for message style interfaces..

Posted by Anne Thomas Manes <at...@gmail.com>.
Alex,

When using a message style service, you should *not* attempt to generate
WSDL from your code. It will simply generate xs:any or xs:anyType, and you
always want to avoid that. In your case, you also neglected to indicate that
you want a document/literal service, so java2wsdl (by default) generated an
rpc/encoded WSDL.

You should always start by defining the schema of the messages that you
intend to exchange. Then you want to plug that schema into a basic
document/literal WSDL, and generate your client stubs from that.

Anne

On 1/18/06, Alex.K <al...@gmail.com> wrote:
>
>
> Hi,
>
>
> I just made some changes in my Java interface and used the type
> org.apache.axis.MessageContext instead of SOAPEnvelope. Generated WSDL
> seems has the shape as it was expected but still when I'm trying to make
> java stubs it comes with the following exception :
>
> [java] java.io.IOException: Type {http://axis.apache.org}MessageContext
> is referenced but not defined.
>      [java]     at
> org.apache.axis.wsdl.symbolTable.SymbolTable.checkForUndefined(
> SymbolTable.java:665)
>      [java]     at
> org.apache.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:545)
>      [java]     at
> org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java
> :518)
>      [java]     at
> org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java
> :495)
>      [java]     at
> org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)
>      [java]     at java.lang.Thread.run(Thread.java:595)
>      [java] Java Result: 1
>
> ***** New interface **********
>
> import org.apache.axis.MessageContext;
>
> public interface STS {
>
>     public MessageContext issue(MessageContext message);
> }
>
> ***** Generated WSDL ************
>
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions targetNamespace="urn:org.services.services"
> xmlns:apachesoap="http://xml.apache.org/xml-soap"
> xmlns:impl="urn:org.services.services"
> xmlns:intf="urn:org.services.services"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:tns2="http://axis.apache.org"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> <!--WSDL created by Apache Axis version: 1.3
> Built on Oct 05, 2005 (05:23:37 EDT)-->
>
>    <wsdl:message name="issueResponse">
>
>       <wsdl:part name="issueReturn" type="tns2:MessageContext"/>
>
>    </wsdl:message>
>
>    <wsdl:message name="issueRequest">
>
>       <wsdl:part name="in0" type="xsd:anyType"/>
>
>    </wsdl:message>
>
>    <wsdl:portType name="STS">
>
>       <wsdl:operation name="issue" parameterOrder="in0">
>
>          <wsdl:input message="impl:issueRequest" name="issueRequest"/>
>
>          <wsdl:output message="impl:issueResponse" name="issueResponse"/>
>
>       </wsdl:operation>
>
>    </wsdl:portType>
>
>    <wsdl:binding name="stsSoapBinding" type="impl:STS">
>
>       <wsdlsoap:binding style="rpc"
> transport="http://schemas.xmlsoap.org/soap/http"/>
>
>       <wsdl:operation name="issue">
>
>          <wsdlsoap:operation soapAction=""/>
>
>          <wsdl:input name="issueRequest">
>
>             <wsdlsoap:body
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> namespace="urn:org.services.services" use="encoded"/>
>
>          </wsdl:input>
>
>          <wsdl:output name="issueResponse">
>
>             <wsdlsoap:body
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> namespace="urn:org.services.services" use="encoded"/>
>
>          </wsdl:output>
>
>       </wsdl:operation>
>
>    </wsdl:binding>
>
>    <wsdl:service name="STSService">
>
>       <wsdl:port binding="impl:stsSoapBinding" name="sts">
>
>          <wsdlsoap:address
> location="http://localhost:8080/axis/services/sts"/>
>
>       </wsdl:port>
>
>    </wsdl:service>
>
> </wsdl:definitions>
>
> Thanks for any help
>
> -- Alex
>
>
> Alex.K wrote:
>
> >
> > [Sorry for the reply to wrong message]
> >
> > Anne,
> >
> > I'm developing a web service on Axis. Here is the java interface that
> > I'm trying to make WSDL of it and then generating client stubs of that
> > WSDL through JAVA2WSDL and WSDL2JAVA utilities.
> >
> > import org.apache.axis.message.SOAPEnvelope;
> >
> > public interface MyService{
> >
> >   public SOAPEnvelope opr(SOAPEnvelope message);
> >
> > }
> >
> > I appreciate your help and hints.
> >
> > -- Alex
> >
> >
> >
> >
> >
> > Anne Thomas Manes wrote:
> >
> >> Yikes!
> >>
> >> Where did you get this schema? You absolutely should not have this
> >> type of information in the schema for a message style service. This
> >> schema is describing elements used to process XML, but all you want
> >> to describe is the XML that you will send back and forth.
> >>
> >> For example, you shouldn't be referencing things like parent and
> >> child nodes or attributes in your message description. You also
> >> shouldn't be using any soapenc types.
> >>
> >> Anne
> >>
> >> On 1/17/06, *Alex.K* <alex1353@gmail.com <ma...@gmail.com>>
> >> wrote:
> >>
> >>
> >>     Hi,
> >>
> >>     I'm trying to generate the service stubs for a message style
> >> interface
> >>     from a WSDL file but seems there are some namespace definitions
> >>     such as:
> >>     xmlns:tns3="http://dom.w3c.org <http://dom.w3c.org>" or
> >>     xmlns:tns6="http://sax.xml.org which
> >>     for them the namespaces have been imported but the schemaLocation
> >>     is not
> >>     generated. There is no schema at the specified URI either then the
> >>     wsdl2java tool doesn't know how to process associated types;
> >>     "Attributes" and "Node".
> >>
> >>     Does anybody know how to fix this problem and how to find/Where to
> >>     import proper naming schema and so ??
> >>
> >>     There is a thread in this mailing list for the same problem but
> >>     doesn't
> >>     come with the final solution.
> >>
> >>
> >>     Cheers
> >>
> >>
> >>     Alex.
> >>
> >>
> >>     Parts of WSDL schema...
> >>
> >>     .
> >>     .
> >>     .
> >>
> >>     xmlns:apachesoap=" http://xml.apache.org/xml-soap"
> >>     xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> >>     xmlns:tns2="http://message.axis.apache.org"
> >>     xmlns:tns3="http://dom.w3c.org" xmlns:tns4="http://soap.xml.javax"
> >>     xmlns:tns5="http://util.java" xmlns:tns6="http://sax.xml.org"
> >>     xmlns:tns7="http://encoding.axis.apache.org"
> >>     xmlns:tns8="http://soap.axis.apache.org" xmlns:tns9="
> >>     http://schema.axis.apache.org"
> >>     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> >>     xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/
> >>     <http://schemas.xmlsoap.org/wsdl/soap/>"
> >>     xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> >>     <!--WSDL created by Apache Axis version: 1.2.1
> >>     Built on Jun 07, 2005 (10:11:43 EDT)-->
> >>     <wsdl:types>
> >>       <schema targetNamespace="http://message.axis.apache.org"
> >>     xmlns="http://www.w3.org/2001/XMLSchema">
> >>        <import namespace="http://schema.axis.apache.org"/
> >>     <http://schema.axis.apache.org%22/>>
> >>        <import namespace="http://encoding.axis.apache.org"/
> >>     <http://encoding.axis.apache.org%22/>>
> >>        <import namespace="http://soap.axis.apache.org"/
> >>     <http://soap.axis.apache.org%22/>>
> >>        <import namespace="http://soap.xml.javax"/
> >>     <http://soap.xml.javax%22/>>
> >>        <import namespace="http://util.java"/ <http://util.java%22/>>
> >>        <import namespace="http://sax.xml.org"/ <http://sax.xml.org%22/
> >>
> >>        <import namespace=" http://xml.apache.org/xml-soap"/
> >>     <http://xml.apache.org/xml-soap%22/>>
> >>        <import namespace="http://dom.w3c.org"/ <http://dom.w3c.org%22/
> >>
> >>        <import namespace=" http://schemas.xmlsoap.org/soap/encoding/"/
> >>     <http://schemas.xmlsoap.org/soap/encoding/%22/>>
> >>        <complexType name="NodeImpl">
> >>         <sequence>
> >>          <element name="attributes" nillable="true"
> type="xsd:anyType"/>
> >>          <element name="childNodes" nillable="true"
> type="xsd:anyType"/>
> >>          <element name="dirty" type="xsd:boolean"/>
> >>          <element name="firstChild" nillable="true"
> type="xsd:anyType"/>
> >>          <element name="lastChild" nillable="true" type="tns3:Node"/>
> >>          <element name="localName" nillable="true"
> >> type="soapenc:string"/>
> >>          <element name="namespaceURI" nillable="true"
> >>     type="soapenc:string"/>
> >>          <element name="nextSibling" nillable="true" type="tns3:Node"/>
> >>          <element name="nodeName" nillable="true"
> >> type="soapenc:string"/>
> >>          <element name="nodeType" type="xsd:short"/>
> >>          <element name="nodeValue" nillable="true"
> >> type="soapenc:string"/>
> >>          <element name="ownerDocument" nillable="true"
> >>     type="apachesoap:Document"/>
> >>          <element name="parentElement" nillable="true"
> >>     type="xsd:anyType"/>
> >>          <element name="parentNode" nillable="true" type="tns3:Node"/>
> >>          <element name="prefix" nillable="true" type="soapenc:string"/>
> >>          <element name="previousSibling" nillable="true"
> >>     type="tns3:Node"/>
> >>          <element name="value" nillable="true" type="soapenc:string"/>
> >>         </sequence>
> >>        </complexType>
> >>        <complexType name="SAX2EventRecorder">
> >>         <sequence>
> >>          <element name="length" type="xsd:int"/>
> >>         </sequence>
> >>        </complexType>
> >>        <complexType name="MessageElement">
> >>         <complexContent>
> >>          <extension base="tns2:NodeImpl">
> >>           <sequence>
> >>            <element name="ID" nillable="true" type="soapenc:string"/>
> >>            <element name="NSMappings" nillable="true"
> >>     type="impl:ArrayOf_xsd_anyType"/>
> >>            <element name="QName" nillable="true" type="xsd:QName"/>
> >>            <element name="allAttributes" nillable="true"
> >>     type="xsd:anyType"/>
> >>            <element name="asDOM" nillable="true"
> >>     type="apachesoap:Element"/>
> >>            <element name="asDocument" nillable="true"
> >>     type="apachesoap:Document"/>
> >>            <element name="asString" nillable="true"
> >>     type="soapenc:string"/>
> >>            <element name="attributesEx" nillable="true"
> >>     type="xsd:anyType"/>
> >>            <element name="childElements" nillable="true"
> >>     type="tns5:Iterator"/>
> >>            <element name="children" nillable="true"
> >>     type="impl:ArrayOf_xsd_anyType"/>
> >>            <element name="completeAttributes" nillable="true"
> >>     type="tns6:Attributes"/>
> >>            <element name="contentsIndex" type="xsd:int"/>
> >>            <element name="deserializationContext" nillable="true"
> >>     type="xsd:anyType"/>
> >>            <element name="elementName" nillable="true"
> >>     type="xsd:anyType"/>
> >>            <element name="encodingStyle" nillable="true"
> >>     type="soapenc:string"/>
> >>            <element name="endIndex" type="xsd:int"/>
> >>            <element name="envelope" nillable="true"
> >>     type="tns2:SOAPEnvelope"/>
> >>            <element name="fixupDeserializer" nillable="true"
> >>     type="xsd:anyType"/>
> >>            <element name="href" nillable="true" type="soapenc:string"/>
> >>            <element name="length" type="xsd:int"/>
> >>            <element name="name" nillable="true" type="soapenc:string"/>
> >>            <element name="namespacePrefixes" nillable="true"
> >>     type="tns5:Iterator"/>
> >>            <element name="objectValue" nillable="true"
> >>     type="xsd:anyType"/>
> >>            <element name="realElement" nillable="true"
> >>     type="tns2:MessageElement"/>
> >>            <element name="recorder" nillable="true"
> >>     type="tns2:SAX2EventRecorder"/>
> >>            <element name="root" type="xsd:boolean"/>
> >>            <element name="tagName" nillable="true"
> >>     type="soapenc:string"/>
> >>            <element name="type" nillable="true" type="xsd:QName"/>
> >>            <element name="visibleNamespacePrefixes" nillable="true"
> >>     type="tns5:Iterator"/>
> >>            <element name="namespaces" nillable="true"
> >>     type="impl:ArrayOf_xsd_anyType"/>
> >>           </sequence>
> >>          </extension>
> >>         </complexContent>
> >>        </complexType>
> >>        <complexType name="SOAPBodyElement">
> >>         <complexContent>
> >>          <extension base="tns2:MessageElement">
> >>           <sequence/>
> >>          </extension>
> >>         </complexContent>
> >>        </complexType>
> >>
> >>     .
> >>     .
> >>     .
> >>
> >>
> >
> >
>
>

Re: WSDL2JAVA for message style interfaces..

Posted by "Alex.K" <al...@gmail.com>.
Hi,


I just made some changes in my Java interface and used the type 
org.apache.axis.MessageContext instead of SOAPEnvelope. Generated WSDL 
seems has the shape as it was expected but still when I'm trying to make 
java stubs it comes with the following exception :

 [java] java.io.IOException: Type {http://axis.apache.org}MessageContext 
is referenced but not defined.
     [java]     at 
org.apache.axis.wsdl.symbolTable.SymbolTable.checkForUndefined(SymbolTable.java:665)
     [java]     at 
org.apache.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:545)
     [java]     at 
org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:518)
     [java]     at 
org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:495)
     [java]     at 
org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)
     [java]     at java.lang.Thread.run(Thread.java:595)
     [java] Java Result: 1

***** New interface **********

import org.apache.axis.MessageContext;

public interface STS {

    public MessageContext issue(MessageContext message);
}

***** Generated WSDL ************

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="urn:org.services.services" 
xmlns:apachesoap="http://xml.apache.org/xml-soap" 
xmlns:impl="urn:org.services.services" 
xmlns:intf="urn:org.services.services" 
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:tns2="http://axis.apache.org" 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.3
Built on Oct 05, 2005 (05:23:37 EDT)-->

   <wsdl:message name="issueResponse">

      <wsdl:part name="issueReturn" type="tns2:MessageContext"/>

   </wsdl:message>

   <wsdl:message name="issueRequest">

      <wsdl:part name="in0" type="xsd:anyType"/>

   </wsdl:message>

   <wsdl:portType name="STS">

      <wsdl:operation name="issue" parameterOrder="in0">

         <wsdl:input message="impl:issueRequest" name="issueRequest"/>

         <wsdl:output message="impl:issueResponse" name="issueResponse"/>

      </wsdl:operation>

   </wsdl:portType>

   <wsdl:binding name="stsSoapBinding" type="impl:STS">

      <wsdlsoap:binding style="rpc" 
transport="http://schemas.xmlsoap.org/soap/http"/>

      <wsdl:operation name="issue">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="issueRequest">

            <wsdlsoap:body 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
namespace="urn:org.services.services" use="encoded"/>

         </wsdl:input>

         <wsdl:output name="issueResponse">

            <wsdlsoap:body 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
namespace="urn:org.services.services" use="encoded"/>

         </wsdl:output>

      </wsdl:operation>

   </wsdl:binding>

   <wsdl:service name="STSService">

      <wsdl:port binding="impl:stsSoapBinding" name="sts">

         <wsdlsoap:address 
location="http://localhost:8080/axis/services/sts"/>

      </wsdl:port>

   </wsdl:service>

</wsdl:definitions>

Thanks for any help

-- Alex


Alex.K wrote:

>
> [Sorry for the reply to wrong message]
>
> Anne,
>
> I'm developing a web service on Axis. Here is the java interface that 
> I'm trying to make WSDL of it and then generating client stubs of that 
> WSDL through JAVA2WSDL and WSDL2JAVA utilities.
>
> import org.apache.axis.message.SOAPEnvelope;
>
> public interface MyService{
>
>   public SOAPEnvelope opr(SOAPEnvelope message);
>
> }
>
> I appreciate your help and hints.
>
> -- Alex
>
>
>
>
>
> Anne Thomas Manes wrote:
>
>> Yikes!
>>
>> Where did you get this schema? You absolutely should not have this 
>> type of information in the schema for a message style service. This 
>> schema is describing elements used to process XML, but all you want 
>> to describe is the XML that you will send back and forth.
>>
>> For example, you shouldn't be referencing things like parent and 
>> child nodes or attributes in your message description. You also 
>> shouldn't be using any soapenc types.
>>
>> Anne
>>
>> On 1/17/06, *Alex.K* <alex1353@gmail.com <ma...@gmail.com>> 
>> wrote:
>>
>>
>>     Hi,
>>
>>     I'm trying to generate the service stubs for a message style 
>> interface
>>     from a WSDL file but seems there are some namespace definitions
>>     such as:
>>     xmlns:tns3="http://dom.w3c.org <http://dom.w3c.org>" or
>>     xmlns:tns6="http://sax.xml.org which
>>     for them the namespaces have been imported but the schemaLocation
>>     is not
>>     generated. There is no schema at the specified URI either then the
>>     wsdl2java tool doesn't know how to process associated types;
>>     "Attributes" and "Node".
>>
>>     Does anybody know how to fix this problem and how to find/Where to
>>     import proper naming schema and so ??
>>
>>     There is a thread in this mailing list for the same problem but
>>     doesn't
>>     come with the final solution.
>>
>>
>>     Cheers
>>
>>
>>     Alex.
>>
>>
>>     Parts of WSDL schema...
>>
>>     .
>>     .
>>     .
>>
>>     xmlns:apachesoap=" http://xml.apache.org/xml-soap"
>>     xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
>>     xmlns:tns2="http://message.axis.apache.org"
>>     xmlns:tns3="http://dom.w3c.org" xmlns:tns4="http://soap.xml.javax"
>>     xmlns:tns5="http://util.java" xmlns:tns6="http://sax.xml.org"
>>     xmlns:tns7="http://encoding.axis.apache.org"
>>     xmlns:tns8="http://soap.axis.apache.org" xmlns:tns9="
>>     http://schema.axis.apache.org"
>>     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
>>     xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/
>>     <http://schemas.xmlsoap.org/wsdl/soap/>"
>>     xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>>     <!--WSDL created by Apache Axis version: 1.2.1
>>     Built on Jun 07, 2005 (10:11:43 EDT)-->
>>     <wsdl:types>
>>       <schema targetNamespace="http://message.axis.apache.org"
>>     xmlns="http://www.w3.org/2001/XMLSchema">
>>        <import namespace="http://schema.axis.apache.org"/
>>     <http://schema.axis.apache.org%22/>>
>>        <import namespace="http://encoding.axis.apache.org"/
>>     <http://encoding.axis.apache.org%22/>>
>>        <import namespace="http://soap.axis.apache.org"/
>>     <http://soap.axis.apache.org%22/>>
>>        <import namespace="http://soap.xml.javax"/
>>     <http://soap.xml.javax%22/>>
>>        <import namespace="http://util.java"/ <http://util.java%22/>>
>>        <import namespace="http://sax.xml.org"/ <http://sax.xml.org%22/>>
>>        <import namespace=" http://xml.apache.org/xml-soap"/
>>     <http://xml.apache.org/xml-soap%22/>>
>>        <import namespace="http://dom.w3c.org"/ <http://dom.w3c.org%22/>>
>>        <import namespace=" http://schemas.xmlsoap.org/soap/encoding/"/
>>     <http://schemas.xmlsoap.org/soap/encoding/%22/>>
>>        <complexType name="NodeImpl">
>>         <sequence>
>>          <element name="attributes" nillable="true" type="xsd:anyType"/>
>>          <element name="childNodes" nillable="true" type="xsd:anyType"/>
>>          <element name="dirty" type="xsd:boolean"/>
>>          <element name="firstChild" nillable="true" type="xsd:anyType"/>
>>          <element name="lastChild" nillable="true" type="tns3:Node"/>
>>          <element name="localName" nillable="true" 
>> type="soapenc:string"/>
>>          <element name="namespaceURI" nillable="true"
>>     type="soapenc:string"/>
>>          <element name="nextSibling" nillable="true" type="tns3:Node"/>
>>          <element name="nodeName" nillable="true" 
>> type="soapenc:string"/>
>>          <element name="nodeType" type="xsd:short"/>
>>          <element name="nodeValue" nillable="true" 
>> type="soapenc:string"/>
>>          <element name="ownerDocument" nillable="true"
>>     type="apachesoap:Document"/>
>>          <element name="parentElement" nillable="true"
>>     type="xsd:anyType"/>
>>          <element name="parentNode" nillable="true" type="tns3:Node"/>
>>          <element name="prefix" nillable="true" type="soapenc:string"/>
>>          <element name="previousSibling" nillable="true"
>>     type="tns3:Node"/>
>>          <element name="value" nillable="true" type="soapenc:string"/>
>>         </sequence>
>>        </complexType>
>>        <complexType name="SAX2EventRecorder">
>>         <sequence>
>>          <element name="length" type="xsd:int"/>
>>         </sequence>
>>        </complexType>
>>        <complexType name="MessageElement">
>>         <complexContent>
>>          <extension base="tns2:NodeImpl">
>>           <sequence>
>>            <element name="ID" nillable="true" type="soapenc:string"/>
>>            <element name="NSMappings" nillable="true"
>>     type="impl:ArrayOf_xsd_anyType"/>
>>            <element name="QName" nillable="true" type="xsd:QName"/>
>>            <element name="allAttributes" nillable="true"
>>     type="xsd:anyType"/>
>>            <element name="asDOM" nillable="true"
>>     type="apachesoap:Element"/>
>>            <element name="asDocument" nillable="true"
>>     type="apachesoap:Document"/>
>>            <element name="asString" nillable="true"
>>     type="soapenc:string"/>
>>            <element name="attributesEx" nillable="true"
>>     type="xsd:anyType"/>
>>            <element name="childElements" nillable="true"
>>     type="tns5:Iterator"/>
>>            <element name="children" nillable="true"
>>     type="impl:ArrayOf_xsd_anyType"/>
>>            <element name="completeAttributes" nillable="true"
>>     type="tns6:Attributes"/>
>>            <element name="contentsIndex" type="xsd:int"/>
>>            <element name="deserializationContext" nillable="true"
>>     type="xsd:anyType"/>
>>            <element name="elementName" nillable="true"
>>     type="xsd:anyType"/>
>>            <element name="encodingStyle" nillable="true"
>>     type="soapenc:string"/>
>>            <element name="endIndex" type="xsd:int"/>
>>            <element name="envelope" nillable="true"
>>     type="tns2:SOAPEnvelope"/>
>>            <element name="fixupDeserializer" nillable="true"
>>     type="xsd:anyType"/>
>>            <element name="href" nillable="true" type="soapenc:string"/>
>>            <element name="length" type="xsd:int"/>
>>            <element name="name" nillable="true" type="soapenc:string"/>
>>            <element name="namespacePrefixes" nillable="true"
>>     type="tns5:Iterator"/>
>>            <element name="objectValue" nillable="true"
>>     type="xsd:anyType"/>
>>            <element name="realElement" nillable="true"
>>     type="tns2:MessageElement"/>
>>            <element name="recorder" nillable="true"
>>     type="tns2:SAX2EventRecorder"/>
>>            <element name="root" type="xsd:boolean"/>
>>            <element name="tagName" nillable="true"
>>     type="soapenc:string"/>
>>            <element name="type" nillable="true" type="xsd:QName"/>
>>            <element name="visibleNamespacePrefixes" nillable="true"
>>     type="tns5:Iterator"/>
>>            <element name="namespaces" nillable="true"
>>     type="impl:ArrayOf_xsd_anyType"/>
>>           </sequence>
>>          </extension>
>>         </complexContent>
>>        </complexType>
>>        <complexType name="SOAPBodyElement">
>>         <complexContent>
>>          <extension base="tns2:MessageElement">
>>           <sequence/>
>>          </extension>
>>         </complexContent>
>>        </complexType>
>>
>>     .
>>     .
>>     .
>>
>>
>
>


Re: WSDL2JAVA for message style interfaces..

Posted by "Alex.K" <al...@gmail.com>.
[Sorry for the reply to wrong message]

Anne,

I'm developing a web service on Axis. Here is the java interface that 
I'm trying to make WSDL of it and then generating client stubs of that 
WSDL through JAVA2WSDL and WSDL2JAVA utilities.

import org.apache.axis.message.SOAPEnvelope;

public interface MyService{

   public SOAPEnvelope opr(SOAPEnvelope message);

}

I appreciate your help and hints.

-- Alex





Anne Thomas Manes wrote:

> Yikes!
>
> Where did you get this schema? You absolutely should not have this 
> type of information in the schema for a message style service. This 
> schema is describing elements used to process XML, but all you want to 
> describe is the XML that you will send back and forth.
>
> For example, you shouldn't be referencing things like parent and child 
> nodes or attributes in your message description. You also shouldn't be 
> using any soapenc types.
>
> Anne
>
> On 1/17/06, *Alex.K* <alex1353@gmail.com <ma...@gmail.com>> 
> wrote:
>
>
>     Hi,
>
>     I'm trying to generate the service stubs for a message style interface
>     from a WSDL file but seems there are some namespace definitions
>     such as:
>     xmlns:tns3="http://dom.w3c.org <http://dom.w3c.org>" or
>     xmlns:tns6="http://sax.xml.org which
>     for them the namespaces have been imported but the schemaLocation
>     is not
>     generated. There is no schema at the specified URI either then the
>     wsdl2java tool doesn't know how to process associated types;
>     "Attributes" and "Node".
>
>     Does anybody know how to fix this problem and how to find/Where to
>     import proper naming schema and so ??
>
>     There is a thread in this mailing list for the same problem but
>     doesn't
>     come with the final solution.
>
>
>     Cheers
>
>
>     Alex.
>
>
>     Parts of WSDL schema...
>
>     .
>     .
>     .
>
>     xmlns:apachesoap=" http://xml.apache.org/xml-soap"
>     xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
>     xmlns:tns2="http://message.axis.apache.org"
>     xmlns:tns3="http://dom.w3c.org" xmlns:tns4="http://soap.xml.javax"
>     xmlns:tns5="http://util.java" xmlns:tns6="http://sax.xml.org"
>     xmlns:tns7="http://encoding.axis.apache.org"
>     xmlns:tns8="http://soap.axis.apache.org" xmlns:tns9="
>     http://schema.axis.apache.org"
>     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
>     xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/
>     <http://schemas.xmlsoap.org/wsdl/soap/>"
>     xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>     <!--WSDL created by Apache Axis version: 1.2.1
>     Built on Jun 07, 2005 (10:11:43 EDT)-->
>     <wsdl:types>
>       <schema targetNamespace="http://message.axis.apache.org"
>     xmlns="http://www.w3.org/2001/XMLSchema">
>        <import namespace="http://schema.axis.apache.org"/
>     <http://schema.axis.apache.org%22/>>
>        <import namespace="http://encoding.axis.apache.org"/
>     <http://encoding.axis.apache.org%22/>>
>        <import namespace="http://soap.axis.apache.org"/
>     <http://soap.axis.apache.org%22/>>
>        <import namespace="http://soap.xml.javax"/
>     <http://soap.xml.javax%22/>>
>        <import namespace="http://util.java"/ <http://util.java%22/>>
>        <import namespace="http://sax.xml.org"/ <http://sax.xml.org%22/>>
>        <import namespace=" http://xml.apache.org/xml-soap"/
>     <http://xml.apache.org/xml-soap%22/>>
>        <import namespace="http://dom.w3c.org"/ <http://dom.w3c.org%22/>>
>        <import namespace=" http://schemas.xmlsoap.org/soap/encoding/"/
>     <http://schemas.xmlsoap.org/soap/encoding/%22/>>
>        <complexType name="NodeImpl">
>         <sequence>
>          <element name="attributes" nillable="true" type="xsd:anyType"/>
>          <element name="childNodes" nillable="true" type="xsd:anyType"/>
>          <element name="dirty" type="xsd:boolean"/>
>          <element name="firstChild" nillable="true" type="xsd:anyType"/>
>          <element name="lastChild" nillable="true" type="tns3:Node"/>
>          <element name="localName" nillable="true" type="soapenc:string"/>
>          <element name="namespaceURI" nillable="true"
>     type="soapenc:string"/>
>          <element name="nextSibling" nillable="true" type="tns3:Node"/>
>          <element name="nodeName" nillable="true" type="soapenc:string"/>
>          <element name="nodeType" type="xsd:short"/>
>          <element name="nodeValue" nillable="true" type="soapenc:string"/>
>          <element name="ownerDocument" nillable="true"
>     type="apachesoap:Document"/>
>          <element name="parentElement" nillable="true"
>     type="xsd:anyType"/>
>          <element name="parentNode" nillable="true" type="tns3:Node"/>
>          <element name="prefix" nillable="true" type="soapenc:string"/>
>          <element name="previousSibling" nillable="true"
>     type="tns3:Node"/>
>          <element name="value" nillable="true" type="soapenc:string"/>
>         </sequence>
>        </complexType>
>        <complexType name="SAX2EventRecorder">
>         <sequence>
>          <element name="length" type="xsd:int"/>
>         </sequence>
>        </complexType>
>        <complexType name="MessageElement">
>         <complexContent>
>          <extension base="tns2:NodeImpl">
>           <sequence>
>            <element name="ID" nillable="true" type="soapenc:string"/>
>            <element name="NSMappings" nillable="true"
>     type="impl:ArrayOf_xsd_anyType"/>
>            <element name="QName" nillable="true" type="xsd:QName"/>
>            <element name="allAttributes" nillable="true"
>     type="xsd:anyType"/>
>            <element name="asDOM" nillable="true"
>     type="apachesoap:Element"/>
>            <element name="asDocument" nillable="true"
>     type="apachesoap:Document"/>
>            <element name="asString" nillable="true"
>     type="soapenc:string"/>
>            <element name="attributesEx" nillable="true"
>     type="xsd:anyType"/>
>            <element name="childElements" nillable="true"
>     type="tns5:Iterator"/>
>            <element name="children" nillable="true"
>     type="impl:ArrayOf_xsd_anyType"/>
>            <element name="completeAttributes" nillable="true"
>     type="tns6:Attributes"/>
>            <element name="contentsIndex" type="xsd:int"/>
>            <element name="deserializationContext" nillable="true"
>     type="xsd:anyType"/>
>            <element name="elementName" nillable="true"
>     type="xsd:anyType"/>
>            <element name="encodingStyle" nillable="true"
>     type="soapenc:string"/>
>            <element name="endIndex" type="xsd:int"/>
>            <element name="envelope" nillable="true"
>     type="tns2:SOAPEnvelope"/>
>            <element name="fixupDeserializer" nillable="true"
>     type="xsd:anyType"/>
>            <element name="href" nillable="true" type="soapenc:string"/>
>            <element name="length" type="xsd:int"/>
>            <element name="name" nillable="true" type="soapenc:string"/>
>            <element name="namespacePrefixes" nillable="true"
>     type="tns5:Iterator"/>
>            <element name="objectValue" nillable="true"
>     type="xsd:anyType"/>
>            <element name="realElement" nillable="true"
>     type="tns2:MessageElement"/>
>            <element name="recorder" nillable="true"
>     type="tns2:SAX2EventRecorder"/>
>            <element name="root" type="xsd:boolean"/>
>            <element name="tagName" nillable="true"
>     type="soapenc:string"/>
>            <element name="type" nillable="true" type="xsd:QName"/>
>            <element name="visibleNamespacePrefixes" nillable="true"
>     type="tns5:Iterator"/>
>            <element name="namespaces" nillable="true"
>     type="impl:ArrayOf_xsd_anyType"/>
>           </sequence>
>          </extension>
>         </complexContent>
>        </complexType>
>        <complexType name="SOAPBodyElement">
>         <complexContent>
>          <extension base="tns2:MessageElement">
>           <sequence/>
>          </extension>
>         </complexContent>
>        </complexType>
>
>     .
>     .
>     .
>
>


Re: WSDL2JAVA for message style interfaces..

Posted by Anne Thomas Manes <at...@gmail.com>.
Yikes!

Where did you get this schema? You absolutely should not have this type of
information in the schema for a message style service. This schema is
describing elements used to process XML, but all you want to describe is the
XML that you will send back and forth.

For example, you shouldn't be referencing things like parent and child nodes
or attributes in your message description. You also shouldn't be using any
soapenc types.

Anne

On 1/17/06, Alex.K <al...@gmail.com> wrote:
>
>
> Hi,
>
> I'm trying to generate the service stubs for a message style interface
> from a WSDL file but seems there are some namespace definitions such as:
> xmlns:tns3="http://dom.w3c.org" or xmlns:tns6="http://sax.xml.org which
> for them the namespaces have been imported but the schemaLocation is not
> generated. There is no schema at the specified URI either then the
> wsdl2java tool doesn't know how to process associated types;
> "Attributes" and "Node".
>
> Does anybody know how to fix this problem and how to find/Where to
> import proper naming schema and so ??
>
> There is a thread in this mailing list for the same problem but doesn't
> come with the final solution.
>
>
> Cheers
>
>
> Alex.
>
>
> Parts of WSDL schema...
>
> .
> .
> .
>
> xmlns:apachesoap="http://xml.apache.org/xml-soap"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns2="
> http://message.axis.apache.org" xmlns:tns3="http://dom.w3c.org"
> xmlns:tns4="http://soap.xml.javax" xmlns:tns5="http://util.java"
> xmlns:tns6="http://sax.xml.org" xmlns:tns7="
> http://encoding.axis.apache.org" xmlns:tns8="http://soap.axis.apache.org"
> xmlns:tns9="http://schema.axis.apache.org" xmlns:wsdl="
> http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="
> http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="
> http://www.w3.org/2001/XMLSchema">
> <!--WSDL created by Apache Axis version: 1.2.1
> Built on Jun 07, 2005 (10:11:43 EDT)-->
> <wsdl:types>
>   <schema targetNamespace="http://message.axis.apache.org" xmlns="
> http://www.w3.org/2001/XMLSchema">
>    <import namespace="http://schema.axis.apache.org"/>
>    <import namespace="http://encoding.axis.apache.org"/>
>    <import namespace="http://soap.axis.apache.org"/>
>    <import namespace="http://soap.xml.javax"/>
>    <import namespace="http://util.java"/>
>    <import namespace="http://sax.xml.org"/>
>    <import namespace="http://xml.apache.org/xml-soap"/>
>    <import namespace="http://dom.w3c.org"/>
>    <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
>    <complexType name="NodeImpl">
>     <sequence>
>      <element name="attributes" nillable="true" type="xsd:anyType"/>
>      <element name="childNodes" nillable="true" type="xsd:anyType"/>
>      <element name="dirty" type="xsd:boolean"/>
>      <element name="firstChild" nillable="true" type="xsd:anyType"/>
>      <element name="lastChild" nillable="true" type="tns3:Node"/>
>      <element name="localName" nillable="true" type="soapenc:string"/>
>      <element name="namespaceURI" nillable="true" type="soapenc:string"/>
>      <element name="nextSibling" nillable="true" type="tns3:Node"/>
>      <element name="nodeName" nillable="true" type="soapenc:string"/>
>      <element name="nodeType" type="xsd:short"/>
>      <element name="nodeValue" nillable="true" type="soapenc:string"/>
>      <element name="ownerDocument" nillable="true"
> type="apachesoap:Document"/>
>      <element name="parentElement" nillable="true" type="xsd:anyType"/>
>      <element name="parentNode" nillable="true" type="tns3:Node"/>
>      <element name="prefix" nillable="true" type="soapenc:string"/>
>      <element name="previousSibling" nillable="true" type="tns3:Node"/>
>      <element name="value" nillable="true" type="soapenc:string"/>
>     </sequence>
>    </complexType>
>    <complexType name="SAX2EventRecorder">
>     <sequence>
>      <element name="length" type="xsd:int"/>
>     </sequence>
>    </complexType>
>    <complexType name="MessageElement">
>     <complexContent>
>      <extension base="tns2:NodeImpl">
>       <sequence>
>        <element name="ID" nillable="true" type="soapenc:string"/>
>        <element name="NSMappings" nillable="true"
> type="impl:ArrayOf_xsd_anyType"/>
>        <element name="QName" nillable="true" type="xsd:QName"/>
>        <element name="allAttributes" nillable="true" type="xsd:anyType"/>
>        <element name="asDOM" nillable="true" type="apachesoap:Element"/>
>        <element name="asDocument" nillable="true"
> type="apachesoap:Document"/>
>        <element name="asString" nillable="true" type="soapenc:string"/>
>        <element name="attributesEx" nillable="true" type="xsd:anyType"/>
>        <element name="childElements" nillable="true"
> type="tns5:Iterator"/>
>        <element name="children" nillable="true"
> type="impl:ArrayOf_xsd_anyType"/>
>        <element name="completeAttributes" nillable="true"
> type="tns6:Attributes"/>
>        <element name="contentsIndex" type="xsd:int"/>
>        <element name="deserializationContext" nillable="true"
> type="xsd:anyType"/>
>        <element name="elementName" nillable="true" type="xsd:anyType"/>
>        <element name="encodingStyle" nillable="true"
> type="soapenc:string"/>
>        <element name="endIndex" type="xsd:int"/>
>        <element name="envelope" nillable="true" type="tns2:SOAPEnvelope"/>
>        <element name="fixupDeserializer" nillable="true"
> type="xsd:anyType"/>
>        <element name="href" nillable="true" type="soapenc:string"/>
>        <element name="length" type="xsd:int"/>
>        <element name="name" nillable="true" type="soapenc:string"/>
>        <element name="namespacePrefixes" nillable="true"
> type="tns5:Iterator"/>
>        <element name="objectValue" nillable="true" type="xsd:anyType"/>
>        <element name="realElement" nillable="true"
> type="tns2:MessageElement"/>
>        <element name="recorder" nillable="true"
> type="tns2:SAX2EventRecorder"/>
>        <element name="root" type="xsd:boolean"/>
>        <element name="tagName" nillable="true" type="soapenc:string"/>
>        <element name="type" nillable="true" type="xsd:QName"/>
>        <element name="visibleNamespacePrefixes" nillable="true"
> type="tns5:Iterator"/>
>        <element name="namespaces" nillable="true"
> type="impl:ArrayOf_xsd_anyType"/>
>       </sequence>
>      </extension>
>     </complexContent>
>    </complexType>
>    <complexType name="SOAPBodyElement">
>     <complexContent>
>      <extension base="tns2:MessageElement">
>       <sequence/>
>      </extension>
>     </complexContent>
>    </complexType>
>
> .
> .
> .
>