views:

92

answers:

0

I send a soap message using MTOM by Axis2, and i monitor the soap get the message below:

--MIMEBoundaryurn_uuid_5C5747FDE5329B8CEB1280130156514
 Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
 Content-Transfer-Encoding: binary
 Content-ID: <0.urn:uuid:[email protected]>

 <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&gt;&lt;soapenv:Body&gt;&lt;ns1:EventMessage xmlns:ns1="http://www.iec.ch/TC57/2008/schema/message"&gt;&lt;ns1:Header&gt;&lt;ns1:Verb&gt;created&lt;/ns1:Verb&gt;&lt;ns1:Noun&gt;NetwordDataSet&lt;/ns1:Noun&gt;&lt;/ns1:Header&gt;&lt;ns1:Payload&gt;&lt;ns1:Compressed&gt;&lt;xop:Include href="cid:1.urn:uuid:[email protected]" xmlns:xop="http://www.w3.org/2004/08/xop/include" /></ns1:Compressed><ns1:format>RDF</ns1:format></ns1:Payload></ns1:EventMessage></soapenv:Body></soapenv:Envelope>
 --MIMEBoundaryurn_uuid_5C5747FDE5329B8CEB1280130156514
 Content-Type: text/plain
 Content-Transfer-Encoding: binary
 Content-ID: <1.urn:uuid:[email protected]>

 测试一把
 1
 2
 3
 4
 5








 --MIMEBoundaryurn_uuid_5C5747FDE5329B8CEB1280130156514--

In the server side i got the code using code generation tools, but the dataHandler is null. And the code like this:

 public void publishEvent
              (
              ch.iec.www.tc57._2008.schema.message.EventMessage eventMessage
              )
        throws FaultMessage{
            //TODO : fill this with the necessary business logic

                EventMessageType emt = eventMessage.getEventMessage();

                 PayloadType plt = emt.getPayload();

                 DataHandler dataHandler =  plt.getPayloadTypeChoice_type0().getCompressed();




                 if(dataHandler!=null){....}
              }

I fixed it.

It's about my XSD

       <xs:choice>
            <xs:any namespace="##other" processContents="skip" minOccurs="0" maxOccurs="unbounded">
                <xs:annotation>
                    <xs:documentation>For XML payloads</xs:documentation>
                </xs:annotation>
            </xs:any>
            <xs:element name="Compressed" type="xs:string" minOccurs="0">
                <xs:annotation>
                    <xs:documentation>For compressed and/or binary, uuencoded payloads</xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:choice>

When i delete , i can get the dataHandler. not supported?