Announcement Announcement Module
Collapse
No announcement yet.
Using attachments Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using attachments

    Hi,

    I am developing a web service using Spring to handle the upload of relatively small documents (usually in XML format).

    I have looked at the options available to me and read numerous posts on this forum related to the subject of attachments but I am still unclear about the following.

    If an incoming request contains an attachment, I am able to pick this file up in an EndpointInterceptor class using a AOP proxy object which allows me to get at the file in the Endpoint code.

    Having done this, it appears to me that I don't require a separate xsd:element in my web service XSD which references the attached file. Is this indeed the case?

    My WSDL looks like this (some of this is hidden by XXX):

    Code:
      <?xml version="1.0" encoding="UTF-8" standalone="no" ?> 
     <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:sch="XXX" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="XXX" targetNamespace="XXX">
     <wsdl:types>
     <xs:schema xmlns:cr="XXX" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="XXX">
      <xs:element name="CreateTemplateRequest" type="cr:CreateTemplateRequestStructure" /> 
     <xs:complexType name="CreateTemplateRequestStructure">
     <xs:sequence>
      <xs:element name="TemplateId" type="xs:integer" /> 
      <xs:element minOccurs="0" name="TemplateFile" type="xs:base64Binary" xmime:expectedContentTypes="*/*" /> 
      </xs:sequence>
      </xs:complexType>
      <xs:element name="CreateTemplateResponse" type="cr:CreateTemplateResponseStructure" /> 
     <xs:complexType name="CreateTemplateResponseStructure">
     <xs:sequence>
      <xs:element name="TemplateId" type="xs:integer" /> 
      </xs:sequence>
      </xs:complexType>
      </xs:schema>
      </wsdl:types>
     <wsdl:message name="CreateTemplateRequest">
      <wsdl:part element="tns:CreateTemplateRequest" name="CreateTemplateRequest" /> 
      </wsdl:message>
     <wsdl:message name="CreateTemplateResponse">
      <wsdl:part element="tns:CreateTemplateResponse" name="CreateTemplateResponse" /> 
      </wsdl:message>
     <wsdl:portType name="XXX">
     <wsdl:operation name="CreateTemplate">
      <wsdl:input message="tns:CreateTemplateRequest" name="CreateTemplateRequest" /> 
      <wsdl:output message="tns:CreateTemplateResponse" name="CreateTemplateResponse" /> 
      </wsdl:operation>
      </wsdl:portType>
     <wsdl:binding name="XXXSoap11" type="tns:XXX">
      <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> 
     <wsdl:operation name="CreateTemplate">
      <soap:operation soapAction="" /> 
     <wsdl:input name="CreateTemplateRequest">
      <soap:body use="literal" /> 
      </wsdl:input>
     <wsdl:output name="CreateTemplateResponse">
      <soap:body use="literal" /> 
      </wsdl:output>
      </wsdl:operation>
      </wsdl:binding>
     <wsdl:service name="XXXService">
     <wsdl:port binding="tns:XXXSoap11" name="XXXSoap11">
      <soap:address location="http://localhost:7001/XXX/" /> 
      </wsdl:port>
      </wsdl:service>
      </wsdl:definitions>
    So my question is do I need

    Code:
    <xs:element minOccurs="0" name="TemplateFile" type="xs:base64Binary" xmime:expectedContentTypes="*/*" />
    Is it advisable to bind this element to the attachment and if so, can someone help me with this?

    Thanks in advance
    Last edited by boz0413; Sep 10th, 2009, 07:54 AM.
Working...
X