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 Robert Koberg <ro...@koberg.com> on 2004/02/04 00:55:42 UTC
problems with wsdl understanding
Hi, [apologies for the length]
I have read through the docs and spec but I am still unclear on a few
things. The samples all work and all is well.
I have created a wsdl file and use the ant task to generate java files,
then compile and deploy -- everything works so far. I must be building
the wsdl (pasted at the bottom) incorrectly and I don't know enough to
see the error (any suggestions on books, websites are greatly appreciated).
In looking at the code I must be doing something wrong with the
//message/part element. Am I right to think I can put an element
reference there? An example of the request - GetHeadRequest (coming from
a .NET client) looks like:
<?xml version="1.0" encoding="ISO-8859-1"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Body>
<wd:head xmlns:wd="http://xstandard.com/2002/webdir">
<wd:lang>en</wd:lang>
</wd:head>
</env:Body>
</env:Envelope>
and the response - GetHeadResponse looks like:
<?xml version="1.0" encoding="UTF-16"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Body>
<wd:filesystem xmlns:wd="http://xstandard.com/2002/webdir">
<wd:parent></wd:parent>
<wd:name>Library Of Images & Attachments</wd:name>
<wd:description></wd:description>
</wd:filesystem>
</env:Body>
</env:Envelope>
I go the AxisServlet and list available service -- the new service is
there. But when I hit the wsdl to see a 'roundtrip' of the schema I get
the following error:
AXIS error
Sorry, something seems to have gone wrong... here are the details:
Fault - makeTypeElement() was told to create a type
"{http://xstandard.com/2002/webdir}>filesystem>file", with no containing
element
AxisFault
faultCode:
{http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
faultSubcode:
faultString: makeTypeElement() was told to create a type
"{http://xstandard.com/2002/webdir}>filesystem>file", with no containing
element
faultActor:
faultNode:
faultDetail:
-------------------------
The wsdl is:
<?xml version="1.0" encoding="utf-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:wd="http://xstandard.com/2002/webdir"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:y="http://new.webservice.namespace"
targetNamespace="http://xstandard.com/2002/webdir" name="WebDir">
<types>
<xs:schema targetNamespace="http://xstandard.com/2002/webdir">
<!--
-->
<xs:element name="filesystem">
<xs:complexType>
<xs:sequence>
<xs:element name="parent"/>
<xs:element ref="wd:name"/>
<xs:element name="description"/>
<xs:element name="folder" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element ref="wd:name"/>
<xs:element ref="wd:path"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="file" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="gif" type="wd:ImageFile"/>
<xs:element name="jpg" type="wd:ImageFile"/>
<xs:element name="png" type="wd:ImageFile"/>
<xs:element name="bmp" type="wd:ImageFile"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<!--
-->
<xs:element name="name"/>
<xs:element name="path"/>
<xs:element name="lang"/>
<!--
-->
<xs:complexType name="GenericFile">
<xs:sequence>
<xs:element ref="wd:name"/>
<xs:element name="title"/>
<xs:element ref="wd:path"/>
<xs:element name="dlm"/>
</xs:sequence>
</xs:complexType>
<!--
-->
<xs:complexType name="ImageFile">
<xs:complexContent>
<xs:extension base="wd:GenericFile">
<xs:sequence>
<xs:element name="width"/>
<xs:element name="height"/>
<xs:element name="alt"/>
<xs:element name="longdesc"/>
<xs:element name="decorative"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!--
-->
<xs:element name="head" type="wd:SoapRequest"/>
<!--
-->
<xs:element name="dir" type="wd:SoapRequest"/>
<!--
-->
<xs:complexType name="SoapRequest">
<xs:sequence>
<xs:element ref="wd:lang"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</types>
<!--
-->
<message name="GetHeadRequest">
<part name="body" element="wd:head"/>
</message>
<message name="GetHeadResponse">
<part name="body" element="wd:filesystem"/>
</message>
<!--
-->
<message name="GetDirRequest">
<part name="body" element="wd:dir"/>
</message>
<message name="GetDirResponse">
<part name="body" element="wd:filesystem"/>
</message>
<!--
-->
<portType name="WebDirPortType">
<operation name="GetHead">
<input message="wd:GetHeadRequest" name="GetHeadRequest"/>
<output message="wd:GetHeadResponse" name="GetHeadResponse"/>
</operation>
<operation name="GetDir">
<input message="wd:GetDirRequest" name="GetDirRequest"/>
<output message="wd:GetDirResponse" name="GetDirResponse"/>
</operation>
</portType>
<!--
-->
<binding name="WebDirSoapBinding" type="wd:WebDirPortType">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="GetHead">
<soap:operation soapAction="http://localhost:8080/services/GetHead"/>
<input name="GetHeadRequest">
<soap:body use="literal"/>
</input>
<output name="GetHeadResponse">
<soap:body use="literal"/>
</output>
</operation>
<operation name="GetDir">
<soap:operation
soapAction="http://localhost:8080/lsb/services/GetDir"/>
<input name="GetDirRequest">
<soap:body use="literal"/>
</input>
<output name="GetDirResponse">
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="WebDirPortTypeService">
<documentation>A service to show file system assets.</documentation>
<port name="WebDirPortType" binding="wd:WebDirSoapBinding">
<soap:address
location="http://localhost:8080/lsb/services/WebDirPortType"/>
</port>
</service>
</definitions>
Re: problems with wsdl understanding
Posted by Robert Koberg <ro...@koberg.com>.
Feng Yuan wrote:
> Hi Robert,
> I met the same problem several times. I do not really remember how to solve
> it now. But you may try the
> webapps\axis\WEB-INF\server-config.wsdd to check if you can find something
> useful there.
Thanks. I have pasted the relevent portion of the server-config.wsdd below.
I should also mention that when calling the methods, it does return what
I would expect. I am just curious why I get the failure. I realize I
have a lot yet to learn -- just starting with web services :(
Here is what I get when calling the getDir method:
<?xml version="1.0" encoding="UTF-8" ?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<filesystem xsi:nil="true"
xmlns="http://xstandard.com/2002/webdir" />
</soapenv:Body>
</soapenv:Envelope>
The plugin sending the request has hardcoded the namespace prefix
(argghh) for tags in their namespace. How would I ensure the the file
element tags are prefixed with 'wd'?
Also, is it best to extend the generated files to build children for
something like the filesystem element above? Are there some examples of
this (using the wsdl2java generated java)? (As you might guess this is a
service that returns a directory structure of images from the server)
thanks for any help,
-Rob
from the server-config.wsdd:
<service name="WebDirPortType" provider="java:RPC" style="document"
use="literal">
<requestFlow>
<handler type="soapmonitor"/>
</requestFlow>
<responseFlow>
<handler type="soapmonitor"/>
</responseFlow>
<parameter name="allowedMethods" value="*"/>
<parameter name="wsdlPortType" value="WebDirPortType"/>
<parameter name="className"
value="com.xstandard._2002.webdir.WebDirSoapBindingSkeleton"/>
<parameter name="wsdlServicePort" value="WebDirPortType"/>
<parameter name="wsdlTargetNamespace"
value="http://xstandard.com/2002/webdir"/>
<parameter name="wsdlServiceElement" value="WebDirService"/>
<typeMapping
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
encodingStyle="" qname="ns1:ImageFile"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
type="java:com.xstandard._2002.webdir.ImageFile"
xmlns:ns1="http://xstandard.com/2002/webdir"/>
<typeMapping
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
encodingStyle="" qname="ns2:>filesystem>file"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
type="java:com.xstandard._2002.webdir._filesystem_file"
xmlns:ns2="http://xstandard.com/2002/webdir"/>
<typeMapping
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
encodingStyle="" qname="ns3:>filesystem>folder"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
type="java:com.xstandard._2002.webdir._filesystem_folder"
xmlns:ns3="http://xstandard.com/2002/webdir"/>
<typeMapping
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
encodingStyle="" qname="ns4:GenericFile"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
type="java:com.xstandard._2002.webdir.GenericFile"
xmlns:ns4="http://xstandard.com/2002/webdir"/>
<typeMapping
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
encodingStyle="" qname="ns5:SoapRequest"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
type="java:com.xstandard._2002.webdir.SoapRequest"
xmlns:ns5="http://xstandard.com/2002/webdir"/>
<typeMapping
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
encodingStyle="" qname="ns6:>filesystem"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
type="java:com.xstandard._2002.webdir._filesystem"
xmlns:ns6="http://xstandard.com/2002/webdir"/>
</service>
>
> Cheers,
> Feng
Re: problems with wsdl understanding
Posted by Feng Yuan <fe...@comp.nus.edu.sg>.
Hi Robert,
I met the same problem several times. I do not really remember how to solve
it now. But you may try the
webapps\axis\WEB-INF\server-config.wsdd to check if you can find something
useful there.
Cheers,
Feng
----- Original Message -----
From: "Robert Koberg" <ro...@koberg.com>
To: <ax...@ws.apache.org>
Sent: 2004?2?4? 7:55
Subject: problems with wsdl understanding
> Hi, [apologies for the length]
>
> I have read through the docs and spec but I am still unclear on a few
> things. The samples all work and all is well.
>
> I have created a wsdl file and use the ant task to generate java files,
> then compile and deploy -- everything works so far. I must be building
> the wsdl (pasted at the bottom) incorrectly and I don't know enough to
> see the error (any suggestions on books, websites are greatly
appreciated).
>
> In looking at the code I must be doing something wrong with the
> //message/part element. Am I right to think I can put an element
> reference there? An example of the request - GetHeadRequest (coming from
> a .NET client) looks like:
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
> <env:Body>
> <wd:head xmlns:wd="http://xstandard.com/2002/webdir">
> <wd:lang>en</wd:lang>
> </wd:head>
> </env:Body>
> </env:Envelope>
>
> and the response - GetHeadResponse looks like:
> <?xml version="1.0" encoding="UTF-16"?>
> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
> <env:Body>
> <wd:filesystem xmlns:wd="http://xstandard.com/2002/webdir">
> <wd:parent></wd:parent>
> <wd:name>Library Of Images & Attachments</wd:name>
> <wd:description></wd:description>
> </wd:filesystem>
> </env:Body>
> </env:Envelope>
>
> I go the AxisServlet and list available service -- the new service is
> there. But when I hit the wsdl to see a 'roundtrip' of the schema I get
> the following error:
>
> AXIS error
>
> Sorry, something seems to have gone wrong... here are the details:
>
>
>
> Fault - makeTypeElement() was told to create a type
> "{http://xstandard.com/2002/webdir}>filesystem>file", with no containing
> element
>
> AxisFault
>
> faultCode:
> {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
>
> faultSubcode:
>
> faultString: makeTypeElement() was told to create a type
> "{http://xstandard.com/2002/webdir}>filesystem>file", with no containing
> element
>
> faultActor:
>
> faultNode:
>
> faultDetail:
>
>
>
> -------------------------
>
> The wsdl is:
>
>
>
>
>
> <?xml version="1.0" encoding="utf-8"?>
>
> <definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:wd="http://xstandard.com/2002/webdir"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
> xmlns:y="http://new.webservice.namespace"
> targetNamespace="http://xstandard.com/2002/webdir" name="WebDir">
>
> <types>
>
> <xs:schema targetNamespace="http://xstandard.com/2002/webdir">
>
> <!--
>
> -->
>
> <xs:element name="filesystem">
>
> <xs:complexType>
>
> <xs:sequence>
>
> <xs:element name="parent"/>
>
> <xs:element ref="wd:name"/>
>
> <xs:element name="description"/>
>
> <xs:element name="folder" minOccurs="0"
maxOccurs="unbounded">
>
> <xs:complexType>
>
> <xs:sequence>
>
> <xs:element ref="wd:name"/>
>
> <xs:element ref="wd:path"/>
>
> </xs:sequence>
>
> </xs:complexType>
>
> </xs:element>
>
> <xs:element name="file" minOccurs="0" maxOccurs="unbounded">
>
> <xs:complexType>
>
> <xs:sequence>
>
> <xs:element name="gif" type="wd:ImageFile"/>
>
> <xs:element name="jpg" type="wd:ImageFile"/>
>
> <xs:element name="png" type="wd:ImageFile"/>
>
> <xs:element name="bmp" type="wd:ImageFile"/>
>
> </xs:sequence>
>
> </xs:complexType>
>
> </xs:element>
>
> </xs:sequence>
>
> </xs:complexType>
>
> </xs:element>
>
> <!--
>
> -->
>
> <xs:element name="name"/>
>
> <xs:element name="path"/>
>
> <xs:element name="lang"/>
>
> <!--
>
> -->
>
>
>
> <xs:complexType name="GenericFile">
>
> <xs:sequence>
>
> <xs:element ref="wd:name"/>
>
> <xs:element name="title"/>
>
> <xs:element ref="wd:path"/>
>
> <xs:element name="dlm"/>
>
> </xs:sequence>
>
> </xs:complexType>
>
> <!--
>
> -->
>
> <xs:complexType name="ImageFile">
>
> <xs:complexContent>
>
> <xs:extension base="wd:GenericFile">
>
> <xs:sequence>
>
> <xs:element name="width"/>
>
> <xs:element name="height"/>
>
> <xs:element name="alt"/>
>
> <xs:element name="longdesc"/>
>
> <xs:element name="decorative"/>
>
> </xs:sequence>
>
> </xs:extension>
>
> </xs:complexContent>
>
> </xs:complexType>
>
> <!--
>
> -->
>
> <xs:element name="head" type="wd:SoapRequest"/>
>
> <!--
>
> -->
>
> <xs:element name="dir" type="wd:SoapRequest"/>
>
> <!--
>
> -->
>
> <xs:complexType name="SoapRequest">
>
> <xs:sequence>
>
> <xs:element ref="wd:lang"/>
>
> </xs:sequence>
>
> </xs:complexType>
>
> </xs:schema>
>
> </types>
>
> <!--
>
>
>
> -->
>
> <message name="GetHeadRequest">
>
> <part name="body" element="wd:head"/>
>
> </message>
>
> <message name="GetHeadResponse">
>
> <part name="body" element="wd:filesystem"/>
>
> </message>
>
> <!--
>
> -->
>
> <message name="GetDirRequest">
>
> <part name="body" element="wd:dir"/>
>
> </message>
>
> <message name="GetDirResponse">
>
> <part name="body" element="wd:filesystem"/>
>
> </message>
>
> <!--
>
> -->
>
> <portType name="WebDirPortType">
>
> <operation name="GetHead">
>
> <input message="wd:GetHeadRequest" name="GetHeadRequest"/>
>
> <output message="wd:GetHeadResponse" name="GetHeadResponse"/>
>
> </operation>
>
> <operation name="GetDir">
>
> <input message="wd:GetDirRequest" name="GetDirRequest"/>
>
> <output message="wd:GetDirResponse" name="GetDirResponse"/>
>
> </operation>
>
> </portType>
>
> <!--
>
> -->
>
> <binding name="WebDirSoapBinding" type="wd:WebDirPortType">
>
> <soap:binding style="document"
> transport="http://schemas.xmlsoap.org/soap/http"/>
>
> <operation name="GetHead">
>
> <soap:operation
soapAction="http://localhost:8080/services/GetHead"/>
>
> <input name="GetHeadRequest">
>
> <soap:body use="literal"/>
>
> </input>
>
> <output name="GetHeadResponse">
>
> <soap:body use="literal"/>
>
> </output>
>
> </operation>
>
> <operation name="GetDir">
>
> <soap:operation
> soapAction="http://localhost:8080/lsb/services/GetDir"/>
>
> <input name="GetDirRequest">
>
> <soap:body use="literal"/>
>
> </input>
>
> <output name="GetDirResponse">
>
> <soap:body use="literal"/>
>
> </output>
>
> </operation>
>
> </binding>
>
> <service name="WebDirPortTypeService">
>
> <documentation>A service to show file system assets.</documentation>
>
> <port name="WebDirPortType" binding="wd:WebDirSoapBinding">
>
> <soap:address
> location="http://localhost:8080/lsb/services/WebDirPortType"/>
>
> </port>
>
> </service>
>
> </definitions>
>
>
bay area consultant needed
Posted by Robert Koberg <ro...@koberg.com>.
Hi,
I need to implement some web services for a new web client app (activeX
plugin - http://xstandard.com - XStandard Pro) we want to use in our CMS
as an alternative XHTML editor.
I have been playing around with Axis for the last two days, but I don't
have time to come fully up to speed.
Are there any excellent developers available for what I believe to be a
relatively short contract (preferably in the San Francisco bay area).
XStandard has a Windows implementation of the server side web services,
but we run on linux using java (1.4.2 and Caucho's Resin). They have
good specs to work from. The services I need include:
- provide a response that shows a listing of images to populate a dialog
for choosing images
- accept a request that is used to upload an images/binaries that is
encoded as a string base64. This request has multiple soap messages that
are about 100k in size.
...and a couple of other services.
If this sounds interesting, please email me back.
This is an immediate need.
best,
-Rob Koberg
liveSTORYBOARD Inc.
2 Clarence Place #5
San Francisco, CA 94107
415-615-9079