金蝶调用 webservice 接口 SOAP 实现
String ns = "hp://ws.sitech.com";
String wsdlUrl = "hp://ip:port/esbWS/services/sResAdd_FH?wsdl";
//创建服务 service
URL url = new URL(wsdlUrl);
QName sname= new QName(ns,"sResAdd_FH");
Service service =Service.create(url,sname);
//创建 DIspatch
Dispatch<SOAPMessage> dispatch=service.createDispatch(new
QName(ns,"sResAdd_FHHpSoap11Endpoint"),SOAPMessage.class, Service.Mode.MESSAGE);
//创建 SOAPMessage
SOAPMessage msg=MessageFactory.newInstance().createMessage();
SOAPEnvelope envelope =msg.getSOAPPart().getEnvelope();
SOAPBody body=envelope.getBody();
//创建 QName 来指定消息中传递数据
SOAPBodyElement el=body.addBodyElement(new QName(ns,"callService","ws"));
//封装数据
SOAPBodyElement ele=body.addBodyElement(new QName(ns,"pin","ws"));
StringBu7er sb = new StringBu7er();
sb.append("{'ROOT':{");
//设备类型
sb.append("'ResType':'"+bosInfo.getResType()+"',");
//设备编号
sb.append("'SerialNo':'"+bosInfo.getSerialNo()+"',");
//设备状态
sb.append("'ResStatus':'"+bosInfo.getResStatus()+"',");
//设备归属
sb.append("'GroupID':'"+bosInfo.getGroupID()+"',");
//操作时间
sb.append("'OpTime':'"+bosInfo.getOpTime()+"',");
//操作流水
sb.append("'LoginAccept':'"+bosInfo.getLoginAccept()+"',");
//状态
sb.append("'OpType':'"+bosInfo.getOpType()+"',");
//入库价格
sb.append("'InPrice':'"+bosInfo.getInPrice()+"',");