package com.meiinfo.platform;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebParam.Mode;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
import javax.xml.ws.Endpoint;
@WebService
@SOAPBinding(style = Style.RPC)
public class HISToPlatformService {
@WebMethod(action="http://temp.org/DoBusiness")
@WebResult(name="ehrXml")
public String DoBusiness(String header,String body,String ehrXml) {
System.out.print("请求头文件:"+header);
System.out.print("请求主体文件:"+body);
try {
ehrXml= QueryKesheXX(header,body);
} catch (Exception e) {
ehrXml = e.getMessage();
}
return ehrXml;
}
public static void main(String[] args) {
Endpoint.publish("http://localhost:9002/platform/HISToPlatformService",
new HISToPlatformService());
System.out.println("service success");
}
使用POST的方式请求这个服务的时候发现
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<DoBusiness xmlns="http://platform.meiinfo.com/">
<arg0 xmlns="">12121</arg0>
<arg1 xmlns="">2121</arg1>
<arg2 xmlns="" />
</DoBusiness>
</soap:Body>
</soap:Envelope>
参数之后都带了一个空的命名空间
有某有办法去掉