Hi all,

I am trying to generate an "MTOM request" like the ones shown as examples in the "Attachments Profile 1.0".

I want to generate a request like the following:

------=_Part_0_24763620.1148379760140
Content-Type: application/xop+xml; charset=utf-8; type="text/xml; charset=utf-8"
Content-Id: <1214EF60AA198A197784D42933A320AF>
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/";
              xmlns:xsd="http://www.w3.org/2001/XMLSchema";
              xmlns:xop="http://www.w3.org/2004/08/xop/include";
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
  <env:Body>
    <upload xmlns="http://www.example.org/test/";>
      <uploadRequest>
        <name>test.txt</name>
        <content>cid:5ABC2608829F6B1D0204C075AD19305F</content>
      </uploadRequest>
    </upload>
  </env:Body>
</env:Envelope>
------=_Part_0_24763620.1148379760140
Content-Type: content/unknown
Content-Transfer-Encoding:
binaryContent-Id: <5ABC2608829F6B1D0204C075AD19305F>
Lorem ipsum ...
------=_Part_0_24763620.1148379760140--


But instead of this, I get this other envelope:

...
  <env:Body>
    <upload xmlns="http://www.example.org/test/";>
      <uploadRequest>
        <name>test.txt</name>
        <content></content>
      </uploadRequest>
      <content xmlns="">
        <xop:Include href="cid:5ABC2608829F6B1D0204C075AD19305F" />
      </content>
    </upload>
  </env:Body>
...


Is there any way to make the attachment reference to appear into the request "content" field?

My original service had no WSDL. It was RPC/encoded and had a signature like:

void upload(String name, DataHandler handler);


But now, the generated code translates the swaRef field into an URI parameter, and the upload() method forces me to pass an UploadRequest instance, and a separated DataHandler instance. I have found no way to link the URI within UploadRequest with the DataHandler passed to the method.

Would it be possible to get a syntax like the following?

DataHandler handler = new DataHandler("file:/test.txt");
UploadRequest request = new UploadRequest("test.txt", handler);
service.upload(request);

I attach a simplified version of my current WSDL.

Thanks in advance,
Rodrigo Ruiz
--
-------------------------------------------------------------------
GRIDSYSTEMS                    Rodrigo Ruiz Aguayo
Parc Bit - Son Espanyol
07120 Palma de Mallorca        mailto:[EMAIL PROTECTED]
Baleares - EspaƱa              Tel:+34-971435085 Fax:+34-971435082
http://www.gridsystems.com
-------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="Test"
  xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/";
  xmlns:ref="http://ws-i.org/profiles/basic/1.1/xsd";
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
  xmlns:test="http://www.example.org/test/";
  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
  xmlns:xsd="http://www.w3.org/2001/XMLSchema";
  targetNamespace="http://www.example.org/test/";>
  <wsdl:types>
    <xsd:schema targetNamespace="http://www.example.org/test/";
                elementFormDefault="qualified">

      <xsd:import namespace="http://ws-i.org/profiles/basic/1.1/xsd";
                  schemaLocation="http://ws-i.org/profiles/basic/1.1/swaref.xsd"; />

      <xsd:element name="Void">
        <xsd:complexType />
      </xsd:element>

      <xsd:element name="uploadRequest">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="name" type="xsd:string" />
            <xsd:element name="content" type="ref:swaRef" />
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>

    </xsd:schema>
  </wsdl:types>

  <wsdl:message name="uploadRequest">
    <wsdl:part name="request" element="test:uploadRequest" />
    <!--
    <wsdl:part name="content" type="xsd:base64Binary" />
     -->
  </wsdl:message>
  <wsdl:message name="uploadResponse">
    <wsdl:part name="response" element="test:Void" />
  </wsdl:message>

  <wsdl:portType name="Test">
    <wsdl:operation name="upload">
      <wsdl:input message="test:uploadRequest" />
      <wsdl:output message="test:uploadResponse" />
    </wsdl:operation>
  </wsdl:portType>

  <wsdl:binding name="TestSOAPBinding" type="test:Test">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"; />
    <wsdl:operation name="upload">
      <soap:operation soapAction="http://www.example.org/test/upload"; />
      <wsdl:input>
        <mime:multipartRelated>
          <mime:part>
            <soap:body parts="request" use="literal" namespace="http://www.example.org/test/"/>
          </mime:part>
          <!--
          <mime:part>
            <mime:content part="content" type="*/*" />
          </mime:part>
           -->
        </mime:multipartRelated>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>

  <wsdl:service name="TestService">
    <wsdl:port binding="test:TestSOAPBinding" name="Test">
      <soap:address location="http://www.example.org/"; />
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.7.0/345 - Release Date: 22/05/2006

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to