Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/359.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
用Java生成MM7SOAP请求_Java_Xml_Mms_Smil_Mm7 - Fatal编程技术网

用Java生成MM7SOAP请求

用Java生成MM7SOAP请求,java,xml,mms,smil,mm7,Java,Xml,Mms,Smil,Mm7,我需要生成一个MM7SOAP消息,就像下面的一样。我可以生成MM7SOAP,但SMIL消息部分和图像/文本附件存在问题。 有人知道如何生成这些零件吗 <?xml version="1.0" encoding="UTF-8"?> <P:Envelope xmlns:P="http://schemas.xmlsoap.org/soap/envelope/"> <P:Header> <mm7:TransactionID xmlns:mm7="http://

我需要生成一个MM7SOAP消息,就像下面的一样。我可以生成MM7SOAP,但SMIL消息部分和图像/文本附件存在问题。 有人知道如何生成这些零件吗

<?xml version="1.0" encoding="UTF-8"?>
<P:Envelope xmlns:P="http://schemas.xmlsoap.org/soap/envelope/">
<P:Header>
<mm7:TransactionID   xmlns:mm7="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-6-MM7-1-0" P:mustUnderstand="1" >1343706064118205</mm7:TransactionID>
</P:Header>
<P:Body>
<mm7:SubmitReq xmlns:mm7="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-6-MM7-1-0">
<mm7:MM7Version>6.3.0</mm7:MM7Version>
<mm7:SenderIdentification>
<mm7:VASPID>1000</mm7:VASPID>
<mm7:VASID>0005</mm7:VASID>
<mm7:SenderAddress>
<mm7:Number>Dialog MMS</mm7:Number>
</mm7:SenderAddress>
</mm7:SenderIdentification>
<mm7:Recipients>
<mm7:Bcc>
<mm7:Number>94773087654/TYPE=PLMN</mm7:Number>
</mm7:Bcc>
</mm7:Recipients>
<mm7:ServiceCode>105</mm7:ServiceCode>
<mm7:DeliveryReport>true</mm7:DeliveryReport>
<mm7:Subject>DailyMirror News Service</mm7:Subject>
<mm7:ChargedParty>Neither</mm7:ChargedParty>
<mm7:ChargedPartyID></mm7:ChargedPartyID>
</mm7:SubmitReq></P:Body></P:Envelope>

1343706064118205
6.3.0
1000
0005
对话彩信
94773087654/类型=PLMN
105
真的
每日镜报新闻社
也不
--=======FBS6FTL4PDKIMRJINCAAIDYTDJ9ULM内容传输编码:8比特内容类型:多部分/相关;type=“应用程序/smil”;start=“”;boundary=481bf3d684924bbee13179cd4576eda8--481bf3d684924bbee13179cd4576eda8内容传输编码:8bitContent ID:内容类型:文本/普通;name=“35_1.txt”内容配置:附件;filename=“35_1.txt”1.ABC 2.XYZ
--481bf3d684924bbee13179cd4576eda8
内容传输编码:8bitContent ID:内容类型:图像/jpeg;name=“35_2.jpg”内容配置:附件;filename=“35_2.jpg”…Exif..II*..Ducky……最终请求应该与此类似,注意mime边界部分

--mime-boundary-boundary1
Content-Type: text/xml; charset=utf-8
Content-ID: <mm7_msg>

<?xml version='1.0' ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<mm7:TransactionID xmlns:mm7="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-2" soap:mustUnderstand="1">
1348056868070-1-
</mm7:TransactionID>
</soap:Header>
<soap:Body>
<SubmitReq xmlns="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-2">
<MM7Version>5.3.0</MM7Version>
<SenderIdentification>
<VASPID>Ejada</VASPID>
<VASID>Ejada</VASID>
</SenderIdentification>
<Recipients>
<To>
<Number>1111</Number>
</To>
</Recipients>
<DeliveryReport>true</DeliveryReport>
<Subject>Allah Akbar</Subject>
<Content href="cid:mms_cid" />
</SubmitReq>
</soap:Body>
</soap:Envelope>

--mime-boundary-boundary1
Content-Type: multipart/mixed; boundary="mime-boundary-boundary2"
Content-ID: <mms_cid1>

--mime-boundary-boundary2
Content-Type: text/plain
Content-ID: <contentId1.txt>
Content-location: contentlocation1.txt

test from jmeter, hello world!

--mime-boundary-boundary2
Content-Type: image/jpeg
Content-location: Ejada.jpg

(=================binary data for the image goes here)

--mime-boundary-boundary2
Content-Type: application/smil
Content-ID: <smil file>
Content-location: smil file

<smil>
    <head>
        <layout>
            <root-layout height="80" width="101"/>
            <region fit="hidden" height="50%" id="Text" left="0%" top="0%" width="100%"/>
            <region fit="hidden" height="50%" id="Image" left="0%" top="50%" width="100%"/>
        </layout>
    </head>
    <body>
      <par dur="5000ms">
        <img region="Image" src="Ejada.jpg"/>
        <text region="Text" src="sample.txt"/>
      </par>
    </body>
</smil>

----mime-boundary-boundary1
--mime-boundary-boundary1
内容类型:text/xml;字符集=utf-8
内容ID:
1348056868070-1-
5.3.0
内贾达
内贾达
1111
真的
真主至大
--mime-boundary-boundary1
内容类型:多部分/混合;boundary=“mime-boundary-boundary2”
内容ID:
--mime-boundary-boundary2
内容类型:文本/纯文本
内容ID:
内容位置:contentlocation1.txt
来自jmeter的测试,你好,世界!
--mime-boundary-boundary2
内容类型:图像/jpeg
内容位置:Ejada.jpg
(======================图像的二进制数据在此显示)
--mime-boundary-boundary2
内容类型:应用程序/smil
内容ID:
内容位置:smil文件
----mime-boundary-boundary1

使用InstantCom的MM7 java库(无耻的披露,我是维护者),您可以生成与以下内容大致相同的请求:

    SubmitReq sr = new SubmitReq();
    sr.setNamespace("http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-2");
    sr.setMm7Version("5.3.0");
    sr.setVaspId("Ejada");
    sr.setVasId("Ejada");
    sr.setSubject("Allah Akbar");
    sr.setDeliveryReport(true);
    sr.addRecipient(new Address("1111", RecipientType.TO));
    sr.setTransactionId("1348056868070-1-");

    // Attach a SMIL presentation
    BinaryContent smil = new BinaryContent("application/smil", load("smil-sample2.xml"));
    smil.setContentId("smil");

    // Attach a picture
    BinaryContent image = new BinaryContent("image/jpeg", load("lorena.jpg"));
    image.setContentId("image");

    // Attach a text
    TextContent text = new TextContent("Lorena sends a lots of hugs!");
    text.setContentId("text");

    // Pack it all up
    sr.setContent(new BasicContent(smil, image, text));

    MM7Message.save(sr, System.out, new MM7Context());
产出将是:

--==MM7-SOAP==5474f579-afe1-4b23-b8e2-0b162f89fd94
Content-Type: text/xml; charset="utf-8"
Content-ID: <mm7-soap>

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
  <env:Header>
    <mm7:TransactionID xmlns:mm7="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-2" env:mustUnderstand="1">1348056868070-1-</mm7:TransactionID>
  </env:Header>
  <env:Body>
    <mm7:SubmitReq xmlns:mm7="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-2">
      <mm7:MM7Version>5.3.0</mm7:MM7Version>
      <mm7:SenderIdentification>
        <mm7:VASPID>Ejada</mm7:VASPID>
        <mm7:VASID>Ejada</mm7:VASID>
      </mm7:SenderIdentification>
      <mm7:Recipients>
        <mm7:To>
          <mm7:Number>1111</mm7:Number>
        </mm7:To>
      </mm7:Recipients>
      <mm7:MessageClass>INFORMATIONAL</mm7:MessageClass>
      <mm7:DeliveryReport>true</mm7:DeliveryReport>
      <mm7:Subject>Allah Akbar</mm7:Subject>
      <mm7:Content href="cid:mm7-content" />
    </mm7:SubmitReq>
  </env:Body>
</env:Envelope>
--==MM7-SOAP==5474f579-afe1-4b23-b8e2-0b162f89fd94
Content-Type: multipart/related; start="<smil>"; type="application/smil"; boundary="==Multipart==7f92313b-8941-4e9e-8ea6-a0838d80e63b"
Content-ID: <mm7-content>

--==Multipart==7f92313b-8941-4e9e-8ea6-a0838d80e63b
Content-Type: application/smil
Content-ID: <smil>
Content-Transfer-Encoding: 7bit

<smil>
    <head>
        <layout>
            <root-layout height="80" width="101"/>
            <region fit="hidden" height="50%" id="Text" left="0%" top="0%" width="100%"/>
            <region fit="hidden" height="50%" id="Image" left="0%" top="50%" width="100%"/>
        </layout>
    </head>
    <body>
      <par dur="5000ms">
        <img region="Image" src="cid:image"/>
        <text region="Text" src="cid:text"/>
      </par>
    </body>
</smil>
--==Multipart==7f92313b-8941-4e9e-8ea6-a0838d80e63b
Content-Type: image/jpeg
Content-ID: <image>
Content-Transfer-Encoding: 8bit

<skipped binary content>
--==Multipart==7f92313b-8941-4e9e-8ea6-a0838d80e63b--
--==MM7-SOAP==5474f579-afe1-4b23-b8e2-0b162f89fd94--
-->MM7-SOAP==5474f579-afe1-4b23-b8e2-0b162f89fd94
内容类型:text/xml;charset=“utf-8”
内容ID:
1348056868070-1-
5.3.0
内贾达
内贾达
1111
信息的
真的
真主至大
--==MM7-SOAP==5474f579-afe1-4b23-b8e2-0b162f89fd94
内容类型:多部分/相关;start=“”;type=“应用程序/smil”;边界=“==多部分==7f92313b-8941-4e9e-8ea6-a0838d80e63b”
内容ID:
--==多部件==7f92313b-8941-4e9e-8ea6-a0838d80e63b
内容类型:应用程序/smil
内容ID:
内容传输编码:7bit
--==多部件==7f92313b-8941-4e9e-8ea6-a0838d80e63b
内容类型:图像/jpeg
内容ID:
内容传输编码:8比特
--==多部件==7f92313b-8941-4e9e-8ea6-a0838d80e63b--
--==MM7-SOAP==5474f579-afe1-4b23-b8e2-0b162f89fd94--
--==MM7-SOAP==5474f579-afe1-4b23-b8e2-0b162f89fd94
Content-Type: text/xml; charset="utf-8"
Content-ID: <mm7-soap>

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
  <env:Header>
    <mm7:TransactionID xmlns:mm7="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-2" env:mustUnderstand="1">1348056868070-1-</mm7:TransactionID>
  </env:Header>
  <env:Body>
    <mm7:SubmitReq xmlns:mm7="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-2">
      <mm7:MM7Version>5.3.0</mm7:MM7Version>
      <mm7:SenderIdentification>
        <mm7:VASPID>Ejada</mm7:VASPID>
        <mm7:VASID>Ejada</mm7:VASID>
      </mm7:SenderIdentification>
      <mm7:Recipients>
        <mm7:To>
          <mm7:Number>1111</mm7:Number>
        </mm7:To>
      </mm7:Recipients>
      <mm7:MessageClass>INFORMATIONAL</mm7:MessageClass>
      <mm7:DeliveryReport>true</mm7:DeliveryReport>
      <mm7:Subject>Allah Akbar</mm7:Subject>
      <mm7:Content href="cid:mm7-content" />
    </mm7:SubmitReq>
  </env:Body>
</env:Envelope>
--==MM7-SOAP==5474f579-afe1-4b23-b8e2-0b162f89fd94
Content-Type: multipart/related; start="<smil>"; type="application/smil"; boundary="==Multipart==7f92313b-8941-4e9e-8ea6-a0838d80e63b"
Content-ID: <mm7-content>

--==Multipart==7f92313b-8941-4e9e-8ea6-a0838d80e63b
Content-Type: application/smil
Content-ID: <smil>
Content-Transfer-Encoding: 7bit

<smil>
    <head>
        <layout>
            <root-layout height="80" width="101"/>
            <region fit="hidden" height="50%" id="Text" left="0%" top="0%" width="100%"/>
            <region fit="hidden" height="50%" id="Image" left="0%" top="50%" width="100%"/>
        </layout>
    </head>
    <body>
      <par dur="5000ms">
        <img region="Image" src="cid:image"/>
        <text region="Text" src="cid:text"/>
      </par>
    </body>
</smil>
--==Multipart==7f92313b-8941-4e9e-8ea6-a0838d80e63b
Content-Type: image/jpeg
Content-ID: <image>
Content-Transfer-Encoding: 8bit

<skipped binary content>
--==Multipart==7f92313b-8941-4e9e-8ea6-a0838d80e63b--
--==MM7-SOAP==5474f579-afe1-4b23-b8e2-0b162f89fd94--