java webservice多值返回
我可以帮我解决这个问题吗? 我必须用java开发一个网络服务。那必须返回下面的xml。 我不知道如何像java中那样返回多个值
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Response xmlns="http://tempuri.org/">
<Result>int</Result>
<strReturn>string</strReturn>
</Response>
</soap:Body>
</soap:Envelope>
Can i help me solve this problem ?
I have to develop a web service in java. That have to return a xml below.
I dont know how to return multiple value like that in java
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Response xmlns="http://tempuri.org/">
<Result>int</Result>
<strReturn>string</strReturn>
</Response>
</soap:Body>
</soap:Envelope>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定您对网络服务了解多少。您发布的 XML 是 XML Web 服务(soap Web 服务)。
请参阅此处的介绍: http://download.oracle.com/javaee/ 6/tutorial/doc/gijti.html
正如教程中所述,您可以使用 Java API for XML Web Services (JAX-WS) 来开发 Web 服务。
I am not sure how much you know about web service. The XML you posted is a XML web service (soap web service).
See here for introduction: http://download.oracle.com/javaee/6/tutorial/doc/gijti.html
As stated in the tutorial, you can use the Java API for XML Web Services (JAX-WS) to develop the web service.