You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rampart-dev@ws.apache.org by Martin Gainty <mg...@hotmail.com> on 2008/02/29 20:46:19 UTC

Re: MTOM with HTTP??

requesting clarification on the enableDoom boolean flag..

  org.apache.rampart.handler.WSDoAllReceiver.java
    private void processBasic(MessageContext msgContext, boolean useDoom,
RequestData reqData) {
.....
        try
        { //here we assume that useDoom true effectively states that we will
process ALL logic where condition useDoom is true..
            doc =
Axis2Util.getDocumentFromSOAPEnvelope(msgContext.getEnvelope(), useDoom);
        }
       catch (WSSecurityException wssEx)
       {
//Handle Exception
       }

//so one would assume that useDoom of true as last param in
getDocumentFromSOAPEnvelope will be set to enable 'enableDoom'
//conditions but take a look at..

//org.apache.rampart.util.Axis2Util.java notice the parameter here is now
called disableDoom ..what happened???
public static Document getDocumentFromSOAPEnvelope(SOAPEnvelope env, boolean
disableDoom) throws WSSecurityException
{
  try
 {
            if(env instanceof Element)
            {
                return ((Element)env).getOwnerDocument();
            }

            if(!disableDoom) {
       env.build();
//the bool flag is now disableDoom so if this value is true coming in the
envelope will NOT be built...

JIRA?
M--
----- Original Message -----
From: "Narayan Dhillon" <Na...@vocalink.com>
To: <ax...@ws.apache.org>
Sent: Friday, February 29, 2008 12:22 PM
Subject: RE: MTOM with HTTP??


Try following in your client to force MTOM with WS-Securty...
stub._getServiceClient().getOptions().setProperty(WSSHandlerConstants.US
E_DOOM, Constants.VALUE_TRUE);

-----Original Message-----
From: callagc4 [mailto:cathal.callaghan@fineos.com]
Sent: 29 February 2008 11:27
To: axis-user@ws.apache.org
Subject: MTOM with HTTP??



Hi,

I have created a sample service for uploading a binary document. This is
defined using the appropriate xsd:base64Binary type. I am using Axis2
version 1.3. I am using ADB data binding. I have enabled MTOM on the
client
by setting the Constants.Configuration.ENABLE_MTOM property to true.
When
the request is sent the mime boundaries and content type are present but
the
binary data is sent in the soap envolope instead of ouside as an
attachment.
Why is this happening? has anyone seen this behaviour? Example output
and
WSDL is below.

Thanks,
Cathal

Request output:

POST /axis2/services/DocProdServices HTTP/1.1
Content-Type: multipart/related;
boundary=MIMEBoundaryurn_uuid_4FD166D21C85599ED51204282413559;
type="application/xop+xml";
start="0.urn:uuid:4FD166D21C85599ED51204282413560@apache.org";
start-info="application/soap+xml"; action="urn:uploadFile"
User-Agent: Axis2
Host: 127.0.0.1:8087
Transfer-Encoding: chunked

20f1
--MIMEBoundaryurn_uuid_4FD166D21C85599ED51204282413559
Content-Type: application/xop+xml; charset=UTF-8;
type="application/soap+xml"
Content-Transfer-Encoding: binary
Content-ID: <0....@apache.org>

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Header>
<wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wsse
curity-secext-1.0.xsd"
soapenv:mustUnderstand="true"><wsse:UsernameToken
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssec
urity-utility-1.0.xsd"
wsu:Id="UsernameToken-22589165"><wsse:Username>OASIS</wsse:Username><wss
e:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-t
oken-profile-1.0#PasswordText">OASIS</wsse:Password></wsse:UsernameToken
></wsse:Security></soapenv:Header><soapenv:Body><ns1:uploadFile
xmlns:ns1="http://www.fineos.com/frontoffice/documentproduction/operatio
ntypes"><encodedFile>0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAA
AAAAAAAABAAAAIgAAAAAAAAAAEAAAJAAAAAEAAAD+////AAAAACEAAAD</encodedFile></
ns1:uploadFile></soapenv:Body></soapenv:Envelope>
3a

--MIMEBoundaryurn_uuid_4FD166D21C85599ED51204282413559--
0

Example WSDL:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
targetNamespace="http://www.fineos.com/frontoffice/documentproduction/op
erationtypes"
  xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
  xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
  xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
  xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"

xmlns:operationtypes="http://www.fineos.com/frontoffice/documentproducti
on/operationtypes"
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
  <wsdl:types>
    <xs:schema
targetNamespace="http://www.fineos.com/frontoffice/documentproduction/op
erationtypes">
     <xs:element name="uploadFile">
         <xs:complexType>
             <xs:sequence>
                 <xs:element minOccurs="0" name="encodedFile"
nillable="true" type="xs:base64Binary"/>
                 <xs:element minOccurs="0" name="parentDirName"
nillable="true" type="xs:string"/>
             </xs:sequence>
         </xs:complexType>
     </xs:element>
     <xs:element name="uploadFileResponse">
         <xs:complexType>
             <xs:sequence>
                 <xs:element minOccurs="0" name="return"
nillable="true"
type="xs:string"/>
             </xs:sequence>
         </xs:complexType>
     </xs:element>
</xs:schema>
  </wsdl:types>

  <wsdl:message name="uploadFileRequest">
    <wsdl:part name="parameters" element="operationtypes:uploadFile">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="uploadFileResponse">
    <wsdl:part name="parameters"
element="operationtypes:uploadFileResponse">
    </wsdl:part>
  </wsdl:message>

  <wsdl:portType name="DocProdServicesPortType">
    <wsdl:operation name="uploadFile">
      <wsdl:input message="operationtypes:uploadFileRequest"
wsaw:Action="urn:uploadFile">
    </wsdl:input>
      <wsdl:output message="operationtypes:uploadFileResponse"
wsaw:Action="urn:uploadFileResponse">
    </wsdl:output>
    </wsdl:operation>
  </wsdl:portType>

  <wsdl:binding name="DocProdServicesSOAP12Binding"
type="operationtypes:DocProdServicesPortType">
    <wsdl:operation name="uploadFile">
      <soap12:operation soapAction="urn:uploadFile" style="document"/>
      <wsdl:input>
        <soap12:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:binding name="DocProdServicesSOAP11Binding"
type="operationtypes:DocProdServicesPortType">
    <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="uploadFile">
      <soap:operation soapAction="urn:uploadFile" style="document"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:binding name="DocProdServicesHttpBinding"
type="operationtypes:DocProdServicesPortType">
    <http:binding verb="POST"/>
    <wsdl:operation name="uploadFile">
      <http:operation location="DocProdServices/uploadFile"/>
      <wsdl:input>
        <mime:content part="uploadFile" type="text/xml"/>
      </wsdl:input>
      <wsdl:output>
        <mime:content part="uploadFile" type="text/xml"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>

  <wsdl:service name="DocProdServices">
    <wsdl:port name="DocProdServicesSOAP11port_http"
binding="operationtypes:DocProdServicesSOAP11Binding">
      <soap:address
location="http://localhost:8080/axis2/service/DocProdServices"/>
    </wsdl:port>
    <wsdl:port name="DocProdServicesSOAP12port_http"
binding="operationtypes:DocProdServicesSOAP12Binding">
      <soap12:address
location="http://localhost:8080/axis2/service/DocProdServices"/>
    </wsdl:port>
    <wsdl:port name="DocProdServicesHttpport"
binding="operationtypes:DocProdServicesHttpBinding">
      <http:address
location="http://localhost:8080/axis2/service/DocProdServices"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>


--
View this message in context:
http://www.nabble.com/MTOM-with-HTTP---tp15756660p15756660.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


*****************************************************
This email is issued by a VocaLink group company. It is confidential and
intended for the exclusive use of the addressee only. You should not
disclose its contents to any other person. If you are not the addressee (or
responsible for delivery of the message to the addressee), please notify the
originator immediately by return message and destroy the original message.
The contents of this email will have no contractual effect unless it is
otherwise agreed between a specific VocaLink group company and the
recipient.

The VocaLink group companies include, among others: VocaLink Limited
(Company No 06119048, VAT No. 907 9619 87) which is registered in England
and Wales at registered office Drake House, Homestead Road, Rickmansworth,
WD3 1FX. United Kingdom, Voca Limited (Company no 1023742, VAT No. 907 9619
87) which is registered in England and Wales at registered office Drake
House, Three Rivers Court, Homestead Road, Rickmansworth, Hertfordshire. WD3
1FX. United Kingdom, LINK Interchange Network Limited (Company No 3565766,
VAT No. 907 9619 87) which is registered in England and Wales at registered
office Arundel House, 1 Liverpool Gardens, Worthing, West Sussex, BN11 1SL
and VocaLink Holdings Limited (Company No 06119036, VAT No. 907 9619 87)
which is registered in England and Wales at registered office Drake House,
Homestead Road, Rickmansworth, WD3 1FX. United Kingdom.

The views and opinions expressed in this email may not reflect those of any
member of the VocaLink group. This message and any attachments have been
scanned for viruses prior to leaving the VocaLink group network; however,
VocaLink does not guarantee the security of this message and will not be
responsible for any damages arising as a result of any virus being passed on
or arising from any alteration of this message by a third party. The
VocaLink group may monitor emails sent to and from the VocaLink group
network.

This message has been checked for all email viruses by MessageLabs.
*************************************************************

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org