关于web service得问题 可以用AXIS来调用。具体例子可以搜一下,好多的。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 直接可以用wsdl文件生成客户端,如果选择axis2:代码类似:public void testecho() throws java.lang.Exception { /** * OMNamespace omNs = fac.createOMNamespace( * "http://MyService.example3.userguide/", "flower"); OMElement method = * fac.createOMElement("reserve", omNs); * * OMElement id = fac.createOMElement("flowerid", omNs); * id.setText("1"); method.addChild(id); * * * * * */ OMFactory fac = OMAbstractFactory.getOMFactory(); String url = "http://localhost:8080/axis2/services/MyService/"; userguide.example3.myservice.MyServiceStub stub = new userguide.example3.myservice.MyServiceStub( url); // the default implementation should point to the right endpoint userguide.example3.myservice.types.Echo param14 = (userguide.example3.myservice.types.Echo) getTestObject(userguide.example3.myservice.types.Echo.class); OMNamespace omNs = fac.createOMNamespace( "http://MyService.example3.userguide", "flower"); OMElement resp = fac.createOMElement("", omNs); param14.setElement(resp); stub.echo(param14); // todo Fill in the param14 here assertNotNull(stub.echo(param14)); } Hibernate生成sql错误!!!! png转gif图片无法预览 如果面试的时候问你哪个项目最成功? 高分求救:jforum访问错误,访问论坛首页forums/list.page就出错,时好时坏,很头疼 50分求 j2ee编程指南 电子版 json转换问题 JBoss 下开发bmp 找不到数据源!请指点一二 各位大哥小弟刚接触java不久,帮忙指点一下好吗? 有关XML的简单问题 java.net.SocketException: 断开的管道错误 JBuilder2006开发问题,请求帮忙帮忙 SOA WebService 工作流 电子资料
public void testecho() throws java.lang.Exception { /**
* OMNamespace omNs = fac.createOMNamespace(
* "http://MyService.example3.userguide/", "flower"); OMElement method =
* fac.createOMElement("reserve", omNs);
*
* OMElement id = fac.createOMElement("flowerid", omNs);
* id.setText("1"); method.addChild(id);
*
*
*
*
*
*/
OMFactory fac = OMAbstractFactory.getOMFactory();
String url = "http://localhost:8080/axis2/services/MyService/";
userguide.example3.myservice.MyServiceStub stub = new userguide.example3.myservice.MyServiceStub(
url);
// the default implementation should point to the right endpoint userguide.example3.myservice.types.Echo param14 = (userguide.example3.myservice.types.Echo) getTestObject(userguide.example3.myservice.types.Echo.class);
OMNamespace omNs = fac.createOMNamespace(
"http://MyService.example3.userguide", "flower");
OMElement resp = fac.createOMElement("", omNs);
param14.setElement(resp);
stub.echo(param14);
// todo Fill in the param14 here
assertNotNull(stub.echo(param14));
}