简体   繁体   English

.NET 中的 SOAP 端点地址

[英]SOAP endpoint address in .NET

I am trying to format an endpoint in SOAP using .NET 4.7.2我正在尝试使用 .NET 4.7.2 格式化 SOAP 中的端点

If i run local via Visual Studio I get the right address format: http://localhost:52066/wsdl/IMyService/如果我通过 Visual Studio 在本地运行,我会得到正确的地址格式:http://localhost:52066/wsdl/IMyService/

But when I publish to a server, I end up with the address: http://MyServer:8080/但是当我发布到服务器时,我最终得到的地址是:http://MyServer:8080/

I have set the address in Web.config我已经在 Web.config 中设置了地址

<services>
  <service name="MyNamespace.MyService" 
           behaviorConfiguration="MyNamespace.behaviorServiceConfig">
    <endpoint address="" 
              binding="basicHttpBinding" 
              contract="MyNamespace.IMyService"/>
    <endpoint address="mex" 
              binding="mexHttpBinding" 
              contract="IMetadataExchange"/>
  </service>
</services>

In endpoint address="" have i also tried to add /wsdl/IMyService/在端点地址 =“”我也尝试添加 /wsdl/IMyService/

I have also removed the Service.svc file from the address with following code:我还使用以下代码从地址中删除了 Service.svc 文件:

<serviceHostingEnvironment
    aspNetCompatibilityEnabled="true" 
    multipleSiteBindingsEnabled="true" 
    minFreeMemoryPercentageToActivateService="0">
  
    <serviceActivations>
        <add factory="System.ServiceModel.Activation.ServiceHostFactory" 
             relativeAddress="./wsdl/MyService/Service.svc"
             service="MyNamespace.MyService" />
     </serviceActivations>

</serviceHostingEnvironment>

My goal is to get the published endpoint address shown as: http://MyServer:8080/wsdl?/IMyService/我的目标是让发布的端点地址显示为:http://MyServer:8080/wsdl?/IMyService/

Edit:编辑:

I am able to connect the client to the http://localhost:9999/wsdl but i need the path to be http://localhost:9999/wsdl?/IMyService/我可以将客户端连接到 http://localhost:9999/wsdl 但我需要的路径是 http://localhost:9999/wsdl?/IMyService/

<services>
        <service behaviorConfiguration="IMyService.MyServiceBehavior"
            name="IMyService.MyService">
            <endpoint address="soap" binding="basicHttpBinding" contract="IMyService.MyService" />
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
            <host>
                <baseAddresses>
                    <add baseAddress="http://localhost:9999" />
                </baseAddresses>
            </host>

I got it working by creating an self hosted WCF-service我通过创建一个自托管的 WCF 服务让它工作

I do have the wsdl at http://localhost:52066/wsdl/IMyService/ and the client can find the service, but when i tries to run the client, it tries and fails to connect to http://localhost:52066/soap/IMyService/我确实在 http://localhost:52066/wsdl/IMyService/ 有 wsdl,并且客户端可以找到该服务,但是当我尝试运行客户端时,它尝试连接到 http://localhost:52066/ 并失败肥皂/IMyService/

When adding the address, i get the error, that i only can have one http connection.添加地址时,我收到错误,我只能有一个 http 连接。

I have also tried to create an .asmx page, which i was not able to make it self-hosted, but there i was able to connect, maybe because i implemented the C# Web-service interface, so it was generated from the MyService-class我还尝试创建一个 .asmx 页面,我无法使其自托管,但我能够连接,可能是因为我实现了 C# Web 服务接口,所以它是从 MyService 生成的-班级

Can anyone give me an hint谁能给我一个提示

暂无
暂无

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

相关问题 在 net.tcp://url 上没有侦听端点可以接受消息。 这通常是由不正确的地址或 SOAP 操作引起的 - There was no endpoint listening at net.tcp://url that could accept the message. This is often caused by an incorrect address or SOAP action 获取没有端口.net的地址,并将地址+端口构造到端点 - Get Address without the port .net and construct address + port to an endpoint 没有端点监听GPService可以接受该消息。 这通常是由不正确的地址或SOAP操作引起的。 - There was no endpoint listening GPService that could accept the message. This is often caused by an incorrect address or SOAP action. 没有端点可以在https://…上侦听该消息。 这通常是由错误的地址或SOAP操作引起的 - There was no endpoint listening at https://… that could accept the message. This is often caused by an incorrect address or SOAP action 在 {0} 处没有侦听端点可以接受消息。 这通常是由不正确的地址或 SOAP 操作引起的。 (Xamarin 安卓) - There was no endpoint listening at {0} that could accept the message. This is often cause by an incorrect address or SOAP action. (Xamarin Android) 确定WCF net.tcp端点地址是否有效 - Determining if a WCF net.tcp endpoint address is valid 如何使用.Net套接字重用TCP端点地址 - How do I reuse a TCP endpoint address with .Net sockets 找不到与端点的scheme net.tcp匹配的基址 - Could not find a base address that matches scheme net.tcp for the endpoint 无法分派该消息,因为端点地址net.tcp:// localhost /上的服务不适用于该地址的协议 - The message could not be dispatched because the service at the endpoint address net.tcp://localhost/ is unavailable for the protocol of the address 从 Asp.net 应用程序使用 WCF SOAP 服务时出错(没有端点侦听) - Error (There was no endpoint listening at) while consuming the WCF SOAP Service from Asp.net Application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM