gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-29 06:00:52 25 4
gpt4 key购买 nike

我在 .Net 中编写了一个网络服务,并从我的 Android 应用程序中调用它。下面是它的描述,它很容易理解,并提供了从 Android 调用服务的所有必要信息,特别是例如SOAPACTION、内容类型等我可以通过链接看到它的内容似乎是这样的,实际上 .Net 接口(interface)提供了这个

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

现在我有另一个用 Java 编写的网络服务,其描述在这个 .net 服务下面给出。我可以通过链接打开它的描述

http://localhost:8080/MusicAppService/MusicAppDataService?WSDL

它的描述不像 .Net 那样容易理解,而且非常非常难理解,实际上它是 WSDL 但我想要一个像 .Net 的界面。它是用 NetBeans 编写的。

我认为我们可以通过某种方式看到与 .net 服务相同的描述。看到这里,我无法理解如何操作数据。

我必须调用函数 getMusicFileData 但很难理解参数是什么以及返回数据是什么。

请帮忙。我想要像 .net 一样的 java web 服务描述,这很容易理解。 URL 中应该有一些东西;什么,这是找。

.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 网络服务

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**

最佳答案

您必须在 NetBeans Web 服务生成器中选中(或未取消选中)“使用​​ WS-Security”复选框。您在 Java Web 服务 SOAP 信封中看到的这些额外内容与 WS-Security 信息相关。

关于java : How to see web service description which is easy to understand not WSDL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10135790/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com