目前我们公司在做四川电信的项目,对接对方的isag网关,再实现彩信的时候遇到问题了,下行很正常,上行的时候,电信给我们发的数据包,axis不解析,认为是不合法的内容,此前电信给的是一个.net的范例,而我们是java,在这样的情况下,我决定手动解析对方传来的数据包,于是我重写了axis的axisservlet,但是在解析图片的时候的时候出现问题,我的处理过程如下 数据包(我得到的是个流)》》字符串》》》分割》》》获取图片内容》》转为流》》》写入文件》》文件打不开,请问各位达人能给点建议么?

解决方案 »

  1.   

    附收到的数据包POST /services/MMSMessageNotification HTTP/1.1Connection: closeCache-Control: no-cacheContent-Type: multipart/mixed; Type="text/xml"; start="<1.xml>"; boundary="Sub1--------------------------------------------=_NextPart_0_24856"Content-Length: 11958Accept: */*Host: 124.193.96.86:81SOAPAction: ""--Sub1--------------------------------------------=_NextPart_0_24856Content-Type: text/xml; charset="utf-8"Content-ID: <1.xml>Content-Transfer-Encoding: 8bit<?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:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Header><NotifySOAPHeader xmlns="http://www.chinatelecom.com.cn/schema/ctcc/common/v2_1"><spRevId>-1</spRevId><spRevpassword>-1</spRevpassword><spId>23129921</spId><SAN>1065960605003</SAN></NotifySOAPHeader></env:Header><env:Body><notifyMessageReception xmlns="http://www.chinatelecom.com.cn/schema/ctcc/multimedia_messaging/notification/v2_2/local"><registrationIdentifier></registrationIdentifier><message><messageServiceActivationNumber>1065960605003</messageServiceActivationNumber><senderAddress>tel:+8618980004148</senderAddress><subject></subject><priority>Normal</priority></message></notifyMessageReception></env:Body></env:Envelope>--Sub1--------------------------------------------=_NextPart_0_24856Content-Type: application/smilContent-ID: <start.smi>Content-Transfer-Encoding: 8bitContent-Location: start.smi<smil>.<head>..<meta name="author" content="USER"/>..<meta name="title" content="Hi"/>..<layout>...<root-layout background-color="#FFFFFF" width="172" height="156"/>...<region id="Image" width="96%" height="68%" left="2%" top="2%" fit="meet"/>      ..</layout>.</head>.<body>..<par dur="10000ms">...<img src="img000.gif" region="Image" begin="0ms" end="10000ms"/>    ..</par>.</body></smil>
      

  2.   

    --Sub1--------------------------------------------=_NextPart_0_24856Content-Type: image/gif; Name="img000.gif"Content-ID: <img000.gif>Content-Transfer-Encoding: 8bitContent-Location: img000.gif
      

  3.   

    自己去拆分soap消息是下下策,你应该多想想为什么axis会不解析电信发过来的包,能不能通过其它方式解决。
      

  4.   

    请问 重写了axis的axisservlet 是怎么做