|
Hello. I’m trying to build a simple service with
attachment, and it seems a bit more difficult than I thought ! The first problem is not directly about axis but
eclipse WTP wsdl validator that rejects the multipartRelated section of my wsdl,
pretending that the <soap:body> is unexpected in the <mime:part> : <wsdl:input name="attach-thing_input"> <mime:multipartRelated> <mime:part name="attach-thing-input_body-part"> <soap:body parts="description"
use="literal" /> </mime:part> <mime:part name="attach-thing-input_data-part"> <mime:content part="data" type="X/Y"
/> </mime:part> </mime:multipartRelated> </wsdl:input> The exact message of eclipse is : WTP 1.0 -> “cvc-complex-type.2.4.a: Invalid
content was found starting with element 'mime:part'. One of '{part}' is
expected.” WTP 1.5 -> cvc-complex-type.2.4.a: Invalid content
was found starting with element 'soap:body'. One of
'{WC["http://schemas.xmlsoap.org/wsdl/mime/"]}' is expected. I’ve checked the namespaces, as the given ‘mime:part’
seems different from the expected ‘part’, but nothing… I’ve had a look at several googled examples,
and all use the same construct with 2 or more parts : one for the soap body and
one or more for attachment as mime contents… Many seem to use rpc/literal
style, while mine uses document/literal. Is it a problem ? An idea ? Is it an eclipse wsdl validator error. I
have the same problem with WTP 1.0 and WTP 1.5 (eclipse 3.2 Callisto)… The axis tool wsdl2java doesn’t express any
problem with my wsdl, but at runtime, with or without data as attachment, the axis
server always rejects the request with the following message : Invalid
element in my.attacher.service.ThingDescriptionType - thing-description The request dump : POST /axis-tests-2/services/AttacherWebServicePort
HTTP/1.0 Content-Type: text/xml; charset=utf-8 Accept: application/soap+xml, application/dime,
multipart/related, text/* User-Agent: Axis/1.4 Host: 127.0.0.1:9999 Cache-Control: no-cache Pragma: no-cache SOAPAction: "" Content-Length: 484 <?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>
<attach-thing xmlns="">
<ns1:thing-description xmlns:ns1="urn:my-attacher/service">
<ns1:thing-name>Test-Un</ns1:thing-name>
<ns1:thing-number>123</ns1:thing-number>
</ns1:thing-description>
<data xsi:nil="true"/>
</attach-thing> </soapenv:Body> </soapenv:Envelope> And the response : HTTP/1.1 500 Erreur Interne de Servlet Server: Apache-Coyote/1.1 Content-Type: text/xml;charset=utf-8 Date: Fri, 28 Jul 2006 08:34:12 GMT Connection: close <?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>
<soapenv:Fault>
<faultcode>soapenv:Server.userException</faultcode>
<faultstring>org.xml.sax.SAXException: Invalid element in
my.attacher.service.ThingDescriptionType -
thing-description</faultstring>
<detail>
<ns1:hostname
xmlns:ns1="http://xml.apache.org/axis/">MASERES-P</ns1:hostname>
</detail>
</soapenv:Fault> </soapenv:Body> </soapenv:Envelope> Could somebody confirm the wsdl is correct ? I’ve
tried to comment all about the attachment, and all is perfect ! The problem seems
to appear only with the attachment parts. A similar example should be welcome ! Thanks ! -- Ephemeris Lappis |
AttachmentService.wsdl
Description: application/xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="Tests-AXIS-Attachment-1-Server_from-wsdl"
default="server-from-wsdl">
<property name="axis.home" location="C:\Java\Apache\axis-1_4" />
<path id="classpath.activation-and-mail">
<pathelement location="C:\Java\Varios\jaf-1.0.2\activation.jar" />
<pathelement location="C:\Java\Varios\javamail-1.3.3_01\mail.jar" />
</path>
<target name="server-from-wsdl">
<taskdef name="wsdl2java"
classname="org.apache.axis.tools.ant.wsdl.Wsdl2javaAntTask">
<classpath>
<fileset dir="${axis.home}/lib" includes="*.jar" />
<path refid="classpath.activation-and-mail" />
</classpath>
</taskdef>
<delete includeEmptyDirs="true">
<fileset dir="./Java-from-WSDL" includes="**/*" />
</delete>
<wsdl2java output="./Java-from-WSDL"
url="AttachmentService.wsdl"
deployscope="request"
serverside="true"
implementationClassName="my.attacher.servant.Servant">
<!-- NB : supprimer la implementationClassName generee, sauf la premiere fois ! -->
<classpath>
<pathelement location="Classes" />
</classpath>
<mapping namespace="urn:my-attacher/service"
package="my.attacher.service" />
</wsdl2java>
<!-- NB : supprimer la implementationClassName generee, sauf la premiere fois ! -->
<delete includeEmptyDirs="true">
<fileset dir="./Java-from-WSDL" includes="my/attacher/servant/**" />
</delete>
</target>
</project>
deploy.wsdd
Description: Binary data
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
