简体   繁体   English

java:如何查看易于理解的Web服务描述而不是WSDL?

[英]java : How to see web service description which is easy to understand not WSDL?

I wrote a web service in .Net and called it fom my Android application. 我在.Net中编写了一个Web服务,并将其称为我的Android应用程序。 Below is its description which is easy to understand and provides all necessary information to call service from Android specially eg SOAPACTION, content-type etc etc I could see its content by the link seems like this, Actually .Net interface provices this 下面是它易于理解的描述,并提供从Android调用服务的所有必要信息,例如SOAPACTION,内容类型等等我可以看到它的内容通过链接看起来像这样,实际上.Net接口提示这个

http://192.168.4.47:88/MRMSGlobalService.asmx?op=EstimateTripCost http://192.168.4.47:88/MRMSGlobalService.asmx?op=EstimateTripCost

Now I have another web service written in Java whose description is given below this .net service. 现在我有另一个用Java编写的Web服务,其描述在这个.net服务下面。 I could open its description by the link like 我可以通过链接打开它的描述

http://localhost:8080/MusicAppService/MusicAppDataService?WSDL HTTP://本地主机:8080 / MusicAppService / MusicAppDataService WSDL

Its description is not so friendly to understand like .Net one, and very very hard to understand, Actually its WSDL but I want the one like .Net interface. 它的描述并不像.Net那样易于理解,而且非常难以理解,实际上它的WSDL但我想要像.Net接口那样。 its written in NetBeans. 它用NetBeans编写。

I think there could be the way from where we could see the same description like the .net service. 我认为可以从我们看到像.net服务这样的描述的方式。 As see to this I could not understand how to manipulate the data. 如此,我无法理解如何操纵数据。

I have to call function getMusicFileData but its so so hard to understand what are the parameters and what could be the return data. 我必须调用函数getMusicFileData,但它很难理解什么是参数,什么可能是返回数据。

Please help. 请帮忙。 I want the same description of java web service like .net one, which is easy to understand. 我想要像.net one这样的java web服务的相同描述,这很容易理解。 There should be something in URL; URL中应该有一些东西; what, this is to find. 什么,这是找到的。

.Net web service .Net网络服务

POST /SDApp/MRMSGlobalService.asmx HTTP/1.1
Host: 192.168.4.47
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://Itcurves.net/EstimateTripCost"

<?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>
    <EstimateTripCost xmlns="http://Itcurves.net/">
      <NoOfPassengers>int</NoOfPassengers>
      <NoOfWheelChairs>int</NoOfWheelChairs>
      <Distance>double</Distance>
      <Duration>double</Duration>
    </EstimateTripCost>
  </soap:Body>
</soap:Envelope>

Java Webservice Java Webservice

This document had no style information.
<!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Metro/2.2-b13 (branches/2.2-6964; 2012-01-09T18:04:18+0000) JAXWS-RI/2.2.6-promoted-b20 JAXWS/2.2 svn-revision#unknown. -->
<!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Metro/2.2-b13 (branches/2.2-6964; 2012-01-09T18:04:18+0000) JAXWS-RI/2.2.6-promoted-b20 JAXWS/2.2 svn-revision#unknown. -->
<definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://Musicpackage/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://Musicpackage/" name="MusicAppDataService">
<wsp:Policy xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702" xmlns:ssp="http://schemas.sun.com/2006/03/wss/server" xmlns:sunwsp="http://java.sun.com/xml/ns/wsit/policy" wsu:Id="MusicAppDataPortBindingPolicy">
<sp:SymmetricBinding>
<wsp:Policy>
<sp:AlgorithmSuite>
<wsp:Policy>
<sp:Basic128/>
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:IncludeTimestamp/>
<sp:Layout>
<wsp:Policy>
<sp:Strict/>
</wsp:Policy>
</sp:Layout>
<sp:OnlySignEntireHeadersAndBody/>
<sp:ProtectionToken>
<wsp:Policy>
<sp:SecureConversationToken sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
<wsp:Policy>
<sp:BootstrapPolicy>
<wsp:Policy>
<sp:AsymmetricBinding>
<wsp:Policy>
<sp:AlgorithmSuite>
<wsp:Policy>
<sp:Basic128/>
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:IncludeTimestamp/>
<sp:InitiatorToken>
<wsp:Policy>
<sp:X509Token sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
<wsp:Policy>
<sp:WssX509V3Token10/>
</wsp:Policy>
</sp:X509Token>
</wsp:Policy>
</sp:InitiatorToken>
<sp:Layout>
<wsp:Policy>
<sp:Strict/>
</wsp:Policy>
</sp:Layout>
<sp:OnlySignEntireHeadersAndBody/>
<sp:RecipientToken>
<wsp:Policy>
<sp:X509Token sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Never">
<wsp:Policy>
<sp:RequireIssuerSerialReference/>
<sp:WssX509V3Token10/>
</wsp:Policy>
</sp:X509Token>
</wsp:Policy>
</sp:RecipientToken>
</wsp:Policy>
</sp:AsymmetricBinding>
<sp:EncryptedParts>
<sp:Body/>
</sp:EncryptedParts>
<sp:SignedParts>
<sp:Body/>
<sp:Header Namespace="http://www.w3.org/2005/08/addressing" Name="ReplyTo"/>
<sp:Header Namespace="http://www.w3.org/2005/08/addressing" Name="To"/>
<sp:Header Namespace="http://www.w3.org/2005/08/addressing" Name="From"/>
<sp:Header Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" Name="AckRequested"/>
<sp:Header Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" Name="CreateSequence"/>
<sp:Header Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" Name="Sequence"/>
<sp:Header Namespace="http://www.w3.org/2005/08/addressing" Name="MessageID"/>
<sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing"/>
<sp:Header Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" Name="SequenceAcknowledgement"/>
<sp:Header Namespace="http://www.w3.org/2005/08/addressing" Name="Action"/>
<sp:Header Namespace="http://www.w3.org/2005/08/addressing" Name="RelatesTo"/>
</sp:SignedParts>
<sp:Wss10>
<wsp:Policy>
<sp:MustSupportRefIssuerSerial/>
</wsp:Policy>
</sp:Wss10>
</wsp:Policy>
</sp:BootstrapPolicy>
<sp:RequireDerivedKeys/>
</wsp:Policy>
</sp:SecureConversationToken>
</wsp:Policy>
</sp:ProtectionToken>
</wsp:Policy>
</sp:SymmetricBinding>
<sp:Trust13>
<wsp:Policy>
<sp:MustSupportIssuedTokens/>
<sp:RequireClientEntropy/>
<sp:RequireServerEntropy/>
</wsp:Policy>
</sp:Trust13>
<sp:Wss11>
<wsp:Policy>
<sp:MustSupportRefEncryptedKey/>
<sp:MustSupportRefIssuerSerial/>
<sp:MustSupportRefThumbprint/>
</wsp:Policy>
</sp:Wss11>
<wsam:Addressing/>
</wsp:Policy>
<wsp:Policy xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702" wsu:Id="MusicAppDataPortBinding_getMusicFileData_Input_Policy">
<sp:EncryptedParts>
<sp:Body/>
</sp:EncryptedParts>
<sp:SignedParts>
<sp:Body/>
<sp:Header Namespace="http://www.w3.org/2005/08/addressing" Name="ReplyTo"/>
<sp:Header Namespace="http://www.w3.org/2005/08/addressing" Name="To"/>
<sp:Header Namespace="http://www.w3.org/2005/08/addressing" Name="From"/>
<sp:Header Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" Name="AckRequested"/>
<sp:Header Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" Name="CreateSequence"/>
<sp:Header Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" Name="Sequence"/>
<sp:Header Namespace="http://www.w3.org/2005/08/addressing" Name="MessageID"/>
<sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing"/>
<sp:Header Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" Name="SequenceAcknowledgement"/>
<sp:Header Namespace="http://www.w3.org/2005/08/addressing" Name="Action"/>
<sp:Header Namespace="http://www.w3.org/2005/08/addressing" Name="RelatesTo"/>
</sp:SignedParts>
</wsp:Policy>
<wsp:Policy xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702" wsu:Id="MusicAppDataPortBinding_getMusicFileData_Output_Policy">
<sp:EncryptedParts>
<sp:Body/>
</sp:EncryptedParts>
<sp:SignedParts>
<sp:Body/>
<sp:Header Namespace="http://www.w3.org/2005/08/addressing" Name="ReplyTo"/>
<sp:Header Namespace="http://www.w3.org/2005/08/addressing" Name="To"/>
<sp:Header Namespace="http://www.w3.org/2005/08/addressing" Name="From"/>
<sp:Header Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" Name="AckRequested"/>
<sp:Header Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" Name="CreateSequence"/>
<sp:Header Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" Name="Sequence"/>
<sp:Header Namespace="http://www.w3.org/2005/08/addressing" Name="MessageID"/>
<sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing"/>
<sp:Header Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" Name="SequenceAcknowledgement"/>
<sp:Header Namespace="http://www.w3.org/2005/08/addressing" Name="Action"/>
<sp:Header Namespace="http://www.w3.org/2005/08/addressing" Name="RelatesTo"/>
</sp:SignedParts>
</wsp:Policy>
<types>
<xsd:schema>
<xsd:import namespace="http://Musicpackage/" schemaLocation="http://localhost:8080/MusicAppService/MusicAppDataService?xsd=1"/>
</xsd:schema>
</types>
<message name="getMusicFileData">
<part name="parameters" element="tns:getMusicFileData"/>
</message>
<message name="getMusicFileDataResponse">
<part name="parameters" element="tns:getMusicFileDataResponse"/>
</message>
<portType name="MusicAppData">
<operation name="getMusicFileData">
<input wsam:Action="http://Musicpackage/MusicAppData/getMusicFileDataRequest" message="tns:getMusicFileData"/>
<output wsam:Action="http://Musicpackage/MusicAppData/getMusicFileDataResponse" message="tns:getMusicFileDataResponse"/>
</operation>
</portType>
<binding name="MusicAppDataPortBinding" type="tns:MusicAppData">
<wsp:PolicyReference URI="#MusicAppDataPortBindingPolicy"/>
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="getMusicFileData">
<soap:operation soapAction=""/>
<input>
<wsp:PolicyReference URI="#MusicAppDataPortBinding_getMusicFileData_Input_Policy"/>
<soap:body use="literal"/>
</input>
<output>
<wsp:PolicyReference URI="#MusicAppDataPortBinding_getMusicFileData_Output_Policy"/>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="MusicAppDataService">
<port name="MusicAppDataPort" binding="tns:MusicAppDataPortBinding">
<soap:address location="http://localhost:8080/MusicAppService/MusicAppDataService"/>
</port>
</service>
</definitions>**strong text****strong text**

You must have checked (or you did not unchecked) "use WS-Security" checkbox in NetBeans web services generator. 您必须已在NetBeans Web服务生成器中选中(或未取消选中)“使用​​WS-Security”复选框。 This additional stuff you see in Java web service SOAP envelope is connected with WS-Security information. 您在Java Web服务SOAP信封中看到的这些附加内容与WS-Security信息相关联。

From the Projects View, right-click the Web Application -> Web Services -> WebServiceNode 在Projects视图中,右键单击Web Application - > Web Services - > WebServiceNode

and

select "Edit Web Service Attributes" from list 从列表中选择“编辑Web服务属性”

UnCheck Secure Service checkBox 取消检查安全服务复选框

Click Ok and it Should work. 单击确定,它应该工作。

Check Glen Mazza's Weblog 查看Glen Mazza的博客

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android Java wsdl 网络服务 - Android Java wsdl web service 哪个Web服务堆栈允许将wsdl第一个Web服务绑定到Java中的现有类? - Which web service stack allows binding wsdl first web service to existing classes in Java? Android ksoap2 Web服务让我获得WSDL的XML描述? - Android ksoap2 web service gets me the XML description of WSDL? 如何从 Java 调用 Web 服务(由 wsdl 描述) - How to call a web service (described by a wsdl) from java 如何确定将为给定的Java Web Service发出的WSDL? - How to Determine the WSDL that will be Emitted for a Given Java Web Service? 使用DoTNET与JAVA wsdl的Web服务的客户端会有什么不同? - How will the client of a Web Service consuming a DoTNET vs JAVA wsdl differ? 如何在CSharp,Java或Python中使用带有本地WSDL的SOAP Web服务? - How to Consume a SOAP Web Service with a local WSDL in CSharp, Java or Python? 您如何在 Java 中调用 web 服务,只有 XSD 和 NO ZE7F674EE60F6AB14C35F6CEB5Z? - How do you call a web service in Java with only XSD and NO WSDL? 如何使用Eclipse在Core Java中使用WSDL文件(WSDL文件使用SOAP)创建Web服务? - How to create Web Service using WSDL file (WSDL file is using SOAP) in Core Java using Eclipse? java-哪种方式易于实现而且安全,适用于Web应用程序/ Web服务中的最终用户身份验证 - java- which way is easy to implement yet secure, for end user authentication in a web app/web service
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM