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 Elaine Nance <el...@commerce.state.ak.us> on 2005/03/09 18:43:45 UTC
wsdl/soap question
TIA for considering these questions.
I am working through the note at
<!--http://www.w3.org/TR/2001/NOTE-wsdl-20010315-->, but mapping
it to my understanding of what I'm seeing gives rise to questions
(and frustrations).
1) How does a wsdl indicate that headers are required?
2) Fragment of existing wsdl which appears to be incorrect:
<s:element name="AdminAuthHeader" type="s0:AdminAuthHeader"/>
<s:complexType name="AdminAuthHeader">
<s:sequence>
<s:element maxOccurs="1" minOccurs="0"
name="sAdminLogin" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0"
name="sPassword" type="s:string"/>
<s:element maxOccurs="1" minOccurs="1"
name="nExSysID" type="s:int"/>
<s:element maxOccurs="1" minOccurs="1"
name="nMajorVersion" type="s:int"/>
<s:element maxOccurs="1" minOccurs="1"
name="nMinorVersion" type="s:int"/>
</s:sequence>
</s:complexType>
a) Shouldn't this have an end </s:element> tag and not have
the "/" in the leading element tag before the <s:complexType> tag?
b) Shouldn't minOccurs="1" indicate a required parameter?
3) Fragment of existing wsdl:
<definitions
targetNamespace="http://yyy.ourname.xxx/webservices/"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:s0="http://yyy.ourname.xxx/webservices/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/">
a) Wouldn't it be better to import the additional namespaces
using the <import> tag?
b) Shouldn't the "s" namespace designated above be "xsd" and
point to "http://www.w3.org/2001/10/XMLSchema"?
c) Shouldn't the "soapenc" namespace be "SOAP-ENC"?
I've been told that wsdl is generated automatically, but if it is
the tool seems inadequte. (NOT Axis!)
Final question for this:
4) Am I on the right track with the wsdl?
REALLY APPRECIATE the input,
Elaine
<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Computers are useless. They can only give you answers.
| -- Pablo Picasso --
<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Re: wsdl/soap question
Posted by Elaine Nance <el...@commerce.state.ak.us>.
Thanks again. I am studying the XML primer now.
My first forays into SOAP-land were using the MS SOAP toolkit 3
and VB 6. Some of the stuff works and some not. MS never
corrected some of the known bugs between 2 and 3. Fortunately
for me I am comfortable with sockets and the Win32 API in VB, so
. . .
However, we are moving toward a Java environment, so this has
also been my learning environment for Java. Steep, steep curves.
BUT, a well-formed wsdl and WSDL2Java are so, so easy. I was
testing against a decent external service and studied the code
and built the tests, logged everything, no problem.
This service which returns a string for EVERYTHING -- PROBLEMS
everywhere. Some of the returns are simple strings, some
delimited strings, but most are XML documents as String. Horrid,
horrid. Especially because the WSDL is subject to change.
Our best hope for positive change is to present the managing
group with a correct wsdl and say, "Please program to this for
these reasons."
Anne Thomas Manes wrote:
> Elaine,
>
> No need to apologize. XML Schema is a very complex subject, and lots
> of people get confused. In fact, someone sent me a note off list
> thanking me for answering your questions.
>
> When learning schema, I suggest you start with the Primer:
> http://www.w3.org/TR/xmlschema-0/.
> Also, XML Schema has been updated since the document you referenced.
> The two current specifications are at
> http://www.w3.org/TR/xmlschema-1/ and
> http://www.w3.org/TR/xmlschema-2/.
>
> I also suggest reading Namespaces in XML: http://www.w3.org/TR/xml-names11/.
>
> I also recommend reading some of the various vendor documentation. I
> particularly like Systinet's documentation. They have a really nice
> web services primer:
> http://www.systinet.com/doc/ssj-55/primerj/index.html
>
> Plus there are tons of articles available at IBM's developerWorks and
> various web services community pages that can help you learn your way
> around.
>
> And, as far as your secnd question goes, putting extraneous namespace
> declarations in a document isn't a bad thing, except that it makes the
> document just that much bigger. Most SOAP toolkits automatically stuff
> every WSDL document with a bunch of standard namespace declarations,
> even if they aren't used.
>
> Anne
>
[snipped previous posts]
<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Computers are useless. They can only give you answers.
| -- Pablo Picasso --
<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Re: wsdl/soap question
Posted by Anne Thomas Manes <at...@gmail.com>.
Elaine,
No need to apologize. XML Schema is a very complex subject, and lots
of people get confused. In fact, someone sent me a note off list
thanking me for answering your questions.
When learning schema, I suggest you start with the Primer:
http://www.w3.org/TR/xmlschema-0/.
Also, XML Schema has been updated since the document you referenced.
The two current specifications are at
http://www.w3.org/TR/xmlschema-1/ and
http://www.w3.org/TR/xmlschema-2/.
I also suggest reading Namespaces in XML: http://www.w3.org/TR/xml-names11/.
I also recommend reading some of the various vendor documentation. I
particularly like Systinet's documentation. They have a really nice
web services primer:
http://www.systinet.com/doc/ssj-55/primerj/index.html
Plus there are tons of articles available at IBM's developerWorks and
various web services community pages that can help you learn your way
around.
And, as far as your secnd question goes, putting extraneous namespace
declarations in a document isn't a bad thing, except that it makes the
document just that much bigger. Most SOAP toolkits automatically stuff
every WSDL document with a bunch of standard namespace declarations,
even if they aren't used.
Anne
On Fri, 11 Mar 2005 07:53:29 -0900, Elaine Nance
<el...@commerce.state.ak.us> wrote:
> Thank you very much, Anne.
>
> Two more questions:
>
> 1) <!--http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/-->
> is the XML schema document to read?
>
> 2) There are a lot of namespace declarations in the document
> which have no additional referents further down. Is this a good
> thing, immaterial, or bad practice?
>
> Thanks again,
> Elaine
>
> PS I'm not stupid, just having to translate a huge amount of
> data into knowledge in a (relatively) short period of time. The
> people managing the web service project are not programmers. No
> one in my group has *any* of this expertise, so . . . I'm
> learning *all* of this stuff at the same time.
>
> Thanks for clarifying the import tag for me. I think I knew
> that, but everything I've been studying is kind of blurring together.
>
> I am not as backward about XML as it must seem, either, but
> haven't the applied knowledge to keep everything straight
> automatically.
>
>
> Anne Thomas Manes wrote:
> > See responses inline ...
> >
> > On Wed, 09 Mar 2005 08:43:45 -0900, Elaine Nance
> > <el...@commerce.state.ak.us> wrote:
> >
> >>TIA for considering these questions.
> >>
> >>I am working through the note at
> >><!--http://www.w3.org/TR/2001/NOTE-wsdl-20010315-->, but mapping
> >>it to my understanding of what I'm seeing gives rise to questions
> >>(and frustrations).
> >>
> >> 1) How does a wsdl indicate that headers are required?
> >
> >
> > Required headers can be specified in the <binding> element, although
> > most people don't specify headers in WSDL. In the long run, I expect
> > people to specify header requirements using WS-Policy (or some other
> > as yet undefined policy language).
> >
> >
> >> 2) Fragment of existing wsdl which appears to be incorrect:
> >> <s:element name="AdminAuthHeader" type="s0:AdminAuthHeader"/>
> >> <s:complexType name="AdminAuthHeader">
> >> <s:sequence>
> >> <s:element maxOccurs="1" minOccurs="0"
> >>name="sAdminLogin" type="s:string"/>
> >> <s:element maxOccurs="1" minOccurs="0"
> >>name="sPassword" type="s:string"/>
> >> <s:element maxOccurs="1" minOccurs="1"
> >>name="nExSysID" type="s:int"/>
> >> <s:element maxOccurs="1" minOccurs="1"
> >>name="nMajorVersion" type="s:int"/>
> >> <s:element maxOccurs="1" minOccurs="1"
> >>name="nMinorVersion" type="s:int"/>
> >> </s:sequence>
> >> </s:complexType>
> >>
> >> a) Shouldn't this have an end </s:element> tag and not have
> >>the "/" in the leading element tag before the <s:complexType> tag?
> >
> >
> > No.
> >
> >
> >> b) Shouldn't minOccurs="1" indicate a required parameter?
> >
> >
> > Yes.
> >
> >
> >> 3) Fragment of existing wsdl:
> >> <definitions
> >> targetNamespace="http://yyy.ourname.xxx/webservices/"
> >> xmlns="http://schemas.xmlsoap.org/wsdl/"
> >> xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
> >> xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
> >> xmlns:s="http://www.w3.org/2001/XMLSchema"
> >> xmlns:s0="http://yyy.ourname.xxx/webservices/"
> >> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> >> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> >> xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/">
> >>
> >> a) Wouldn't it be better to import the additional namespaces
> >>using the <import> tag?
> >
> >
> > No. These are namespace declarations, not imports. In order to
> > reference an element in one of these namespaces, you must declare the
> > namespace. You only use the <wsdl:import> element to import other WSDL
> > documents. Even if you do import another WSDL document, you still need
> > to declare the namespace using a namespace declaration.
> >
> >
> >> b) Shouldn't the "s" namespace designated above be "xsd"
> >
> >
> > No. The string used for the prefix ("s" versus "xsd") isn't
> > significant. All that matters is that it's used consistently within
> > the document.
> >
> >
> >>and
> >>point to "http://www.w3.org/2001/10/XMLSchema"?
> >
> >
> > No. Per the XML Schema specification, the XML Schema namespace is
> > "http://www.w3.org/2001/XMLSchema"
> >
> >
> >> c) Shouldn't the "soapenc" namespace be "SOAP-ENC"?
> >
> >
> > No. As I said before, the prefix string is insignificant.
> >
> >
> >>I've been told that wsdl is generated automatically, but if it is
> >>the tool seems inadequte. (NOT Axis!)
> >>
> >>Final question for this:
> >>
> >> 4) Am I on the right track with the wsdl?
> >
> >
> > It seems to me that you first need to learn a little more about XML
> > Schema and XML namespaces. Once you've done that, I recommend that you
> > study the WS-I Basic Profile. (see http://www.ws-i.org).
> >
> >>REALLY APPRECIATE the input,
> >>Elaine
> >
> >
> > Any time.
> > - Anne
> >
>
> <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> | Computers are useless. They can only give you answers.
> | -- Pablo Picasso --
> <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
Re: wsdl/soap question
Posted by Elaine Nance <el...@commerce.state.ak.us>.
Thank you very much, Anne.
Two more questions:
1) <!--http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/-->
is the XML schema document to read?
2) There are a lot of namespace declarations in the document
which have no additional referents further down. Is this a good
thing, immaterial, or bad practice?
Thanks again,
Elaine
PS I'm not stupid, just having to translate a huge amount of
data into knowledge in a (relatively) short period of time. The
people managing the web service project are not programmers. No
one in my group has *any* of this expertise, so . . . I'm
learning *all* of this stuff at the same time.
Thanks for clarifying the import tag for me. I think I knew
that, but everything I've been studying is kind of blurring together.
I am not as backward about XML as it must seem, either, but
haven't the applied knowledge to keep everything straight
automatically.
Anne Thomas Manes wrote:
> See responses inline ...
>
> On Wed, 09 Mar 2005 08:43:45 -0900, Elaine Nance
> <el...@commerce.state.ak.us> wrote:
>
>>TIA for considering these questions.
>>
>>I am working through the note at
>><!--http://www.w3.org/TR/2001/NOTE-wsdl-20010315-->, but mapping
>>it to my understanding of what I'm seeing gives rise to questions
>>(and frustrations).
>>
>> 1) How does a wsdl indicate that headers are required?
>
>
> Required headers can be specified in the <binding> element, although
> most people don't specify headers in WSDL. In the long run, I expect
> people to specify header requirements using WS-Policy (or some other
> as yet undefined policy language).
>
>
>> 2) Fragment of existing wsdl which appears to be incorrect:
>> <s:element name="AdminAuthHeader" type="s0:AdminAuthHeader"/>
>> <s:complexType name="AdminAuthHeader">
>> <s:sequence>
>> <s:element maxOccurs="1" minOccurs="0"
>>name="sAdminLogin" type="s:string"/>
>> <s:element maxOccurs="1" minOccurs="0"
>>name="sPassword" type="s:string"/>
>> <s:element maxOccurs="1" minOccurs="1"
>>name="nExSysID" type="s:int"/>
>> <s:element maxOccurs="1" minOccurs="1"
>>name="nMajorVersion" type="s:int"/>
>> <s:element maxOccurs="1" minOccurs="1"
>>name="nMinorVersion" type="s:int"/>
>> </s:sequence>
>> </s:complexType>
>>
>> a) Shouldn't this have an end </s:element> tag and not have
>>the "/" in the leading element tag before the <s:complexType> tag?
>
>
> No.
>
>
>> b) Shouldn't minOccurs="1" indicate a required parameter?
>
>
> Yes.
>
>
>> 3) Fragment of existing wsdl:
>> <definitions
>> targetNamespace="http://yyy.ourname.xxx/webservices/"
>> xmlns="http://schemas.xmlsoap.org/wsdl/"
>> xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
>> xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
>> xmlns:s="http://www.w3.org/2001/XMLSchema"
>> xmlns:s0="http://yyy.ourname.xxx/webservices/"
>> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
>> xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/">
>>
>> a) Wouldn't it be better to import the additional namespaces
>>using the <import> tag?
>
>
> No. These are namespace declarations, not imports. In order to
> reference an element in one of these namespaces, you must declare the
> namespace. You only use the <wsdl:import> element to import other WSDL
> documents. Even if you do import another WSDL document, you still need
> to declare the namespace using a namespace declaration.
>
>
>> b) Shouldn't the "s" namespace designated above be "xsd"
>
>
> No. The string used for the prefix ("s" versus "xsd") isn't
> significant. All that matters is that it's used consistently within
> the document.
>
>
>>and
>>point to "http://www.w3.org/2001/10/XMLSchema"?
>
>
> No. Per the XML Schema specification, the XML Schema namespace is
> "http://www.w3.org/2001/XMLSchema"
>
>
>> c) Shouldn't the "soapenc" namespace be "SOAP-ENC"?
>
>
> No. As I said before, the prefix string is insignificant.
>
>
>>I've been told that wsdl is generated automatically, but if it is
>>the tool seems inadequte. (NOT Axis!)
>>
>>Final question for this:
>>
>> 4) Am I on the right track with the wsdl?
>
>
> It seems to me that you first need to learn a little more about XML
> Schema and XML namespaces. Once you've done that, I recommend that you
> study the WS-I Basic Profile. (see http://www.ws-i.org).
>
>>REALLY APPRECIATE the input,
>>Elaine
>
>
> Any time.
> - Anne
>
<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Computers are useless. They can only give you answers.
| -- Pablo Picasso --
<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Re: wsdl/soap question
Posted by Anne Thomas Manes <at...@gmail.com>.
See responses inline ...
On Wed, 09 Mar 2005 08:43:45 -0900, Elaine Nance
<el...@commerce.state.ak.us> wrote:
> TIA for considering these questions.
>
> I am working through the note at
> <!--http://www.w3.org/TR/2001/NOTE-wsdl-20010315-->, but mapping
> it to my understanding of what I'm seeing gives rise to questions
> (and frustrations).
>
> 1) How does a wsdl indicate that headers are required?
Required headers can be specified in the <binding> element, although
most people don't specify headers in WSDL. In the long run, I expect
people to specify header requirements using WS-Policy (or some other
as yet undefined policy language).
>
> 2) Fragment of existing wsdl which appears to be incorrect:
> <s:element name="AdminAuthHeader" type="s0:AdminAuthHeader"/>
> <s:complexType name="AdminAuthHeader">
> <s:sequence>
> <s:element maxOccurs="1" minOccurs="0"
> name="sAdminLogin" type="s:string"/>
> <s:element maxOccurs="1" minOccurs="0"
> name="sPassword" type="s:string"/>
> <s:element maxOccurs="1" minOccurs="1"
> name="nExSysID" type="s:int"/>
> <s:element maxOccurs="1" minOccurs="1"
> name="nMajorVersion" type="s:int"/>
> <s:element maxOccurs="1" minOccurs="1"
> name="nMinorVersion" type="s:int"/>
> </s:sequence>
> </s:complexType>
>
> a) Shouldn't this have an end </s:element> tag and not have
> the "/" in the leading element tag before the <s:complexType> tag?
No.
> b) Shouldn't minOccurs="1" indicate a required parameter?
Yes.
>
> 3) Fragment of existing wsdl:
> <definitions
> targetNamespace="http://yyy.ourname.xxx/webservices/"
> xmlns="http://schemas.xmlsoap.org/wsdl/"
> xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
> xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
> xmlns:s="http://www.w3.org/2001/XMLSchema"
> xmlns:s0="http://yyy.ourname.xxx/webservices/"
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/">
>
> a) Wouldn't it be better to import the additional namespaces
> using the <import> tag?
No. These are namespace declarations, not imports. In order to
reference an element in one of these namespaces, you must declare the
namespace. You only use the <wsdl:import> element to import other WSDL
documents. Even if you do import another WSDL document, you still need
to declare the namespace using a namespace declaration.
> b) Shouldn't the "s" namespace designated above be "xsd"
No. The string used for the prefix ("s" versus "xsd") isn't
significant. All that matters is that it's used consistently within
the document.
> and
> point to "http://www.w3.org/2001/10/XMLSchema"?
No. Per the XML Schema specification, the XML Schema namespace is
"http://www.w3.org/2001/XMLSchema"
> c) Shouldn't the "soapenc" namespace be "SOAP-ENC"?
No. As I said before, the prefix string is insignificant.
>
> I've been told that wsdl is generated automatically, but if it is
> the tool seems inadequte. (NOT Axis!)
>
> Final question for this:
>
> 4) Am I on the right track with the wsdl?
It seems to me that you first need to learn a little more about XML
Schema and XML namespaces. Once you've done that, I recommend that you
study the WS-I Basic Profile. (see http://www.ws-i.org).
>
> REALLY APPRECIATE the input,
> Elaine
Any time.
- Anne
>
> <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> | Computers are useless. They can only give you answers.
> | -- Pablo Picasso --
> <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>