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 bethana kumar <be...@yahoo.com> on 2004/01/29 14:30:29 UTC
Re: soap with attachments help?????
Hi Group
I would like to write some soap service ..which should server image(s) for client over SOAP/HTTP ...does any body have some examples....
I tried like this but i am getting some problem ...
Interface
----------------------------------------------------------------------------------------
package samples.userguide.example7;
import javax.activation.DataHandler;
public interface AttachmentService
{
public DataHandler getFileAsAttachment();
}
------------------------------------------------------------------------------------------------
Then my WSDL file which i have generated by using Java2WSDL tool ....then i have added mime
------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="urn:Example7" xmlns:impl="urn:Example7" xmlns:intf="urn:Example7" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/">
<wsdl:message name="getFileAsAttachmentRequest">
</wsdl:message>
<wsdl:message name="getFileAsAttachmentResponse">
<wsdl:part name="getFileAsAttachmentReturn" type="apachesoap:DataHandler"/>
</wsdl:message>
<wsdl:portType name="AttachmentService">
<wsdl:operation name="getFileAsAttachment">
<wsdl:input name="getFileAsAttachmentRequest" message="impl:getFileAsAttachmentRequest"/>
<wsdl:output name="getFileAsAttachmentResponse" message="impl:getFileAsAttachmentResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="AttachmentServiceSoapBinding" type="impl:AttachmentService">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getFileAsAttachment">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getFileAsAttachmentRequest">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:Example7"/>
</wsdl:input>
<wsdl:output name="getFileAsAttachmentResponse">
<mime:multipartRelated>
<mime:part name="part1">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:Example7"/>
</mime:part>
<mime:part name="part2">
<mime:content part="output" type="text/plain"/>
</mime:part>
</mime:multipartRelated>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="AttachmentServiceService">
<wsdl:port name="AttachmentService" binding="impl:AttachmentServiceSoapBinding">
<wsdlsoap:address location="http://localhost:8080/axis/services/AttachmentService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
----------------------------------------------------------------------------------
If i am generating Stubs,Skeltons etc.....using WSDL2Java then i am getting following error.
org.xml.sax.SAXException: Error: URI=file:/E:/axis/axis-1_1/samples/userguide/ex
ample7/as.wsdl Line=41: Undeclared prefix in name: "mime:multipartRelated".
at org.apache.axis.utils.XMLUtils$ParserErrorHandler.error(XMLUtils.java
:619)
at org.apache.crimson.parser.Parser2.error(Parser2.java:3165)
at org.apache.crimson.parser.Parser2.processName(Parser2.java:1660)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1487)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1779)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1779)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1779)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1779)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
at org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl
.java:185)
at org.apache.axis.utils.XMLUtils.newDocument(XMLUtils.java:322)
at org.apache.axis.utils.XMLUtils.newDocument(XMLUtils.java:367)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav
a:384)
at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:245)
at java.lang.Thread.run(Thread.java:536)
Does anybody help me in this.....
Thanks In Advance
---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!