users@jax-rpc.java.net

WSDL and Schema question for attachments

From: Sam <bytecode_at_Phreaker.net>
Date: Mon, 29 Apr 2002 23:00:09 -0400

I have a SOAP request and the WSDL file that I m trying to
write (see attached)


Basically in the request one element points to the attachment as shown
below. I call this the content element.

===========================================================
// other stuff here
<attachment xsi:type="ns1:DocumentInfo">
<formname xsi:type="xsd:string" xsi:null="true"/>

<content href ="cid:2544881.1020124717293.apache-soap.BYTECODE"/>

</attachment>

// other stuff here

------=_Part_0_4703740.1020124717293
Content-Type: image/jpeg
Content-Transfer-Encoding: 8bit
Content-ID: <2544881.1020124717293.apache-soap.BYTECODE>
Content-Length: 70939

ÿØÿà


===========================================================


How do I describe this element in the WSDL ? Is the attached WSDL
correct. ?

Some examples seem to use the
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/
to point to the attachment...(as in the IBM toolkit). Is this a better
approach ??

Is there an attachment example for JAX-RPC ?


Thanks
./s


<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<ns1:storeDocument xmlns:ns1="urn:ServiceInterfaceImpl" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

<userinfo xsi:type="ns1:User">
<requestorid xsi:type="xsd:string">asdasd</requestorid>
<requestorsignature xsi:type="xsd:string" xsi:null="true"/>
</userinfo>

<attachment xsi:type="ns1:DocumentInfo">
<formname xsi:type="xsd:string" xsi:null="true"/>
<folderid xsi:type="xsd:string">asdasdads123123123123</folderid>

<!-- This part refers to the attachment -->

<content href ="cid:2544881.1020124717293.apache-soap.BYTECODE"/>

</attachment>
</ns1:storeDocument>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

------=_Part_0_4703740.1020124717293
Content-Type: image/jpeg
Content-Transfer-Encoding: 8bit
Content-ID: <2544881.1020124717293.apache-soap.BYTECODE>
Content-Length: 70939

ÿØÿà

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://highlevel"
                 xmlns="http://schemas.xmlsoap.org/wsdl/"
                 xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
                 xmlns:impl="http://highlevel-impl"
                 xmlns:intf="http://highlevel"
                 xmlns:tns2="http://activation.javax"
                 xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                 xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
                 xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <types>
<xs:schema targetNamespace="http://highlevel" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:intf="http://highlevel">
        <xs:complexType name="User">
                <xs:sequence>
                        <xs:element name="requestorid" type="xsd:string" nillable="false"/>
                        <xs:element name="requestorsignature" type="xsd:string" nillable="false"/>
                </xs:sequence>
        </xs:complexType>
        <xs:element name="User" type="intf:User" nillable="false"/>
        <xs:complexType name="StoreRequest">
                <xs:sequence>
                        <xs:element name="description" type="xsd:string" nillable="false"/>
                        <xs:element name="reuesttype" type="xsd:string" nillable="false"/>
                        <xs:element name="requestid" type="xsd:string" nillable="false"/>
                </xs:sequence>
        </xs:complexType>
        <xs:element name="StoreRequest" type="intf:StoreRequest" nillable="false"/>
        <xs:complexType name="DocumentInfo">
                <xs:sequence>
                        <xs:element name="formname" type="xsd:string" nillable="false"/>
                        <xs:element name="folderid" type="xsd:string" nillable="false"/>
                        <xs:element name="foldertype" type="xsd:string" nillable="false"/>
                        <xs:element name="ocrflag" type="xsd:boolean"/>
                        <xs:element name="workflowvariblename" type="xsd:string" nillable="false"/>
                        <xs:element name="workflowvariablevalue" type="xsd:string" nillable="false"/>
<!-- is there something wrong here ? Should content be declared as a complext type in itslef... ? How do you
        reference the attachment in the schema ? -->

                        <xs:element name="content">
                                <xs:complexType>
                                        <xs:attribute name="href" type="xs:anyURI" use="required"/>
                                </xs:complexType>
                        </xs:element>
                </xs:sequence>
        </xs:complexType>
        <xs:element name="DocumentInfo" type="intf:DocumentInfo" nillable="false"/>
        <xs:complexType name="StoreResponse">
                <xs:sequence>
                        <xs:element name="status" type="xsd:string" nillable="false"/>
                        <xs:element name="documentID" type="xsd:string" nillable="false"/>
                </xs:sequence>
        </xs:complexType>
        <xs:element name="StoreResponse" type="intf:StoreResponse" nillable="false"/>
</xs:schema>
 </types>

   <wsdl:message name="storeDocumentRequest">
      <wsdl:part name="userinfo" type="intf:User"/>
      <wsdl:part name="request" type="intf:StoreRequest"/>
      <wsdl:part name="attachment" type="intf:DocumentInfo"/>
   </wsdl:message>

   <wsdl:message name="storeDocumentResponse">
      <wsdl:part name="return" type="intf:StoreResponse"/>
   </wsdl:message>

   <wsdl:portType name="ServiceInterfaceImpl">
      <wsdl:operation name="storeDocument" parameterOrder="userinfo request attachment">
         <wsdl:input message="intf:storeDocumentRequest"/>
         <wsdl:output message="intf:storeDocumentResponse"/>
      </wsdl:operation>
   </wsdl:portType>

   <wsdl:binding name="ServiceInterfaceImplSoapBinding" type="intf:ServiceInterfaceImpl">
      <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
      <wsdl:operation name="storeDocument">
         <wsdlsoap:operation soapAction=""/>
         <wsdl:input>
            <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://highlevel" use="encoded"/>
         </wsdl:input>
         <wsdl:output>
            <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://highlevel" use="encoded"/>
         </wsdl:output>
      </wsdl:operation>
   </wsdl:binding>

   <wsdl:service name="ServiceInterfaceImplService">
      <wsdl:port binding="intf:ServiceInterfaceImplSoapBinding" name="ServiceInterfaceImpl">
         <wsdlsoap:address location="http://xxx.xxx/" />
      </wsdl:port>
   </wsdl:service>

</wsdl:definitions>