现在要做一个短信彩信发送接收的平台,主要是连接自己旗下网站和第三方短信平台。
现在首要的一个问题是:我连接第三方平台怎么连???他们文档里说用webservice,怎么调用呢?为什么还要解析xml???

解决方案 »

  1.   

    http://blog.csdn.net/hymer2011/article/details/6605413
    就是调用webservice就行了
      

  2.   

    webservice要用xml格式传递数据,写几个试下就没啥问题了
      

  3.   

    webservice就是用了SOAP协议,这个协议是基于xml的。
      

  4.   

    在当前项目点右键-new-Other-找到web Sercices然后选择Web Service Client 输入你的webservice远程地址,然后就可以生存客户端代码了,怎么用应该会吧?
      

  5.   

    能够连接webservice ,解析到数据就可以了
      

  6.   

    知道webservice的地址,然后用ECLIPSE生成客户端类,就可以了!
    不生成客户端类的话,也可以自己写!    Service service = new Service();
       Call call = (Call)service.createCall();
       call.setTargetEndpointAddress(new java.net.URL((String)SysConfig.application.getAttribute("WEBSERVICECLIENT_SMS")));//设置目标地址
       
       call.setUseSOAPAction(true);
       call.setSOAPActionURI("http://Huamai.com/PostSms");//
       call.setOperationName(new QName("http://Huamai.com/","PostSms"));//操作的方法
       //增加相应参数
       //注意:要以new QName(namespace,paratmeter1)的方式,否则服务端接收到的数据为空
       call.addParameter(new QName("http://Huamai.com/","SenderMobile"), org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);//发送人手机号
       call.addParameter(new QName("http://Huamai.com/","ReceiverMobile"), org.apache.axis.encoding.XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN);//接收人手机号
       call.addParameter(new QName("http://Huamai.com/","Message"), org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);//短信内容
       call.setReturnType(org.apache.axis.encoding.XMLType.XSD_INT);//返回值类型
       
       Integer result = (Integer) call.invoke(new Object[]{"",po.getStrMobile(),"您有一条关于收文流程-标题为\""+recDocMain.getStrDocTitle()+"\"的任务即将于"+recDocMain.getStrCopyReportUnit()+" 结束,请及时处理!"});
    可以做参考!!!!
      

  7.   

    http://blog.csdn.net/luohuijun619/article/details/5956484