Microsoft MVP성태의 닷넷 이야기
오류 유형: 13. WSE 3.0 서비스 관련 WSE101 오류 / Destination Unreachable [링크 복사], [링크+제목 복사],
조회: 16752
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 

WSE 3.0 을 로컬에서만 테스트 하다가, 머신을 분리하게 되면 겪게 되는 현상입니다. (이 현상은 로컬에서 조차도 발생하는 문제입니다.)

저도 아직 이 부분에 대한 뚜렷한 이유는 설명해드릴 수 없습니다. 웹에서도 해당 현상에 대해서 적절한 설명을 찾을 수가 없었는데, 혹시나 아시는 분 계시면 ^^ 댓글 좀 부탁드립니다.

따라서, 이 부분은 WSE 3.0 으로 프로그램하시면 반드시 지켜주셔야 하는데요.

서버 대기 주소와 클라이언트의 접속 주소를 "동일"하게 유지하라.

입니다. 감이 안 오실텐데요. ^^ 코드로 살펴보도록 하겠습니다.

우선, 서버측에서는 서비스를 대기하기 위해서 다음과 같이 작성하게 됩니다.

 Uri listenAddress = new Uri("soap.tcp://localhost/HelloService");
 SoapReceivers.Add(new EndpointReference(listenAddress), typeof(HelloService));

위와 같이 서비스를 작성했다면 원격 컴퓨터에 있는 클라이언트에서는 다음과 같이 서비스를 접근하려 할텐데요.

HelloService service = new HelloService();
service.Url = "soap.tcp://192.168.1.100/HelloService";

서버는 "localhost" 로 대기하고, 클라이언트는 "192.168.1.100" 으로 접근하고 있는데요. 바로 이와 같이 접속 주소가 다르게 되면 오류가 발생하게 됩니다. 따라서 이런 경우에는 서버측의 대기 주소를 다음과 같은 식으로 수정해 주셔야 합니다.

 Uri listenAddress = new Uri("soap.tcp://192.168.1.100/HelloService");

심지어, 같은 로컬 컴퓨터에서조차도 "localhost" 로 대기하고, "127.0.0.1" 로 접속해도 오류가 발생합니다.



다음의 2가지 오류 메시지는 위에서 설명한 것처럼 주소가 달라질때 발생하는 것들입니다.

[오류 메시지 1]

Unhandled Exception: Microsoft.Web.Services3.AsynchronousOperationException: 
WSE101: An asynchronous operation raised an exception. 
	---> System.Net.Sockets.SocketException: 
			No connection could be made because the target machine actively refused it

Server stack trace:
   at Microsoft.Web.Services3.Messaging.SoapTcpConnection.Connect()
   at Microsoft.Web.Services3.Messaging.SoapTcpConnection..ctor(Uri remoteEndpoint, SoapTcpTransportOptions options, ISoapFormatter formatter)
   at Microsoft.Web.Services3.Messaging.SoapTcpTransport.CreateConnection(Uri transportAddress)
   at Microsoft.Web.Services3.Messaging.SoapTcpTransport.GetConnection(Uri destination)
   at Microsoft.Web.Services3.Messaging.SoapTcpOutputChannel.Send(SoapEnvelope message)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg,Boolean bProxyCase)
   at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData)
   at Microsoft.Web.Services3.Messaging.SoapOutputChannel.SendDelegate.EndInvoke(IAsyncResult result)
   at Microsoft.Web.Services3.Messaging.SoapOutputChannel.EndSend(IAsyncResult result)
   at Microsoft.Web.Services3.WebServicesClientAsyncResult.OnSendComplete(IAsyncResult result)
   --- End of inner exception stack trace ---
   at Microsoft.Web.Services3.AsyncResult.End(IAsyncResult result)
   at Microsoft.Web.Services3.Xml.SoapEnvelopeReaderWrapper..ctor(SoapClientMessage message, String messageContentType)
   at Microsoft.Web.Services3.WebServicesClientProtocol.GetReaderForMessage(SoapClientMessage message, Int32 bufferSize)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at HelloService.HelloWorld() in D:\temp\ConsoleHostService\WSE30Consumer\HelloService.cs:line 43
   at WSE30Consumer.Program.Main(String[] args) in D:\temp\ConsoleHostService\WSE30Consumer\Program.cs:line 15

[오류 메시지 2]

Unhandled Exception: System.Web.Services.Protocols.SoapHeaderException: Destination Unreachable
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at HelloService.HelloWorld() in D:\temp\ConsoleHostService\WSE30Consumer\HelloService.cs:line 43
   at WSE30Consumer.Program.Main(String[] args) in D:\temp\ConsoleHostService\WSE30Consumer\Program.cs:line 22



[이 토픽에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]







[최초 등록일: ]
[최종 수정일: 10/18/2006]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




1  2  3  4  [5]  6  7  8  9  10  11  12  13  14  15  ...
NoWriterDateCnt.TitleFile(s)
13546정성태1/30/20242759Windows: 255. (디버거의 영향 등으로) 대상 프로세스가 멈추면 Socket KeepAlive로 연결이 끊길까요?
13545정성태1/30/20242582닷넷: 2212. ASP.NET Core - 우선순위에 따른 HTTP/HTTPS 호스트:포트 바인딩 방법
13544정성태1/30/20242676오류 유형: 894. Microsoft.Data.SqlClient - Could not load file or assembly 'System.Security.Permissions, ...'
13543정성태1/30/20242737Windows: 254. Windows - 기본 사용 중인 5357 포트 비활성화는 방법
13542정성태1/30/20242626오류 유형: 893. Visual Studio - Web Application을 실행하지 못하는 IISExpress - 두 번째 이야기
13541정성태1/29/20242847VS.NET IDE: 188. launchSettings.json의 useSSL 옵션
13540정성태1/29/20243024Linux: 69. 리눅스 - "Docker Desktop for Windows" Container 환경에서 IPv6 Loopback Address 바인딩 오류
13539정성태1/26/20242943개발 환경 구성: 703. Visual Studio - launchSettings.json을 이용한 HTTP/HTTPS 포트 바인딩
13538정성태1/25/20243313닷넷: 2211. C# - NonGC(FOH) 영역에 .NET 개체를 생성파일 다운로드1
13537정성태1/24/20243389닷넷: 2210. C# - Native 메모리에 .NET 개체를 생성파일 다운로드1
13536정성태1/23/20243366닷넷: 2209. .NET 8 - NonGC Heap / FOH (Frozen Object Heap) [1]
13535정성태1/22/20243328닷넷: 2208. C# - GCHandle 구조체의 메모리 분석
13534정성태1/21/20243089닷넷: 2207. C# - SQL Server DB를 bacpac으로 Export/Import파일 다운로드1
13533정성태1/18/20243122닷넷: 2206. C# - TCP KeepAlive의 서버 측 구현파일 다운로드1
13532정성태1/17/20243127닷넷: 2205. C# - SuperSimpleTcp 사용 시 주의할 점파일 다운로드1
13531정성태1/16/20243153닷넷: 2204. C# - TCP KeepAlive에 새로 추가된 Retry 옵션파일 다운로드1
13530정성태1/15/20242770닷넷: 2203. C# - Python과의 AES 암호화 연동파일 다운로드1
13529정성태1/15/20242811닷넷: 2202. C# - PublishAot의 glibc에 대한 정적 링킹하는 방법
13528정성태1/14/20242974Linux: 68. busybox 컨테이너에서 실행 가능한 C++, Go 프로그램 빌드
13527정성태1/14/20242900오류 유형: 892. Visual Studio - Failed to launch debug adapter. Additional information may be available in the output window.
13526정성태1/14/20243020닷넷: 2201. C# - Facebook 연동 / 사용자 탈퇴 처리 방법
13525정성태1/13/20242792오류 유형: 891. Visual Studio - Web Application을 실행하지 못하는 IISExpress
13524정성태1/12/20242881오류 유형: 890. 한국투자증권 KIS Developers OpenAPI - GW라우팅 중 오류가 발생했습니다.
13523정성태1/12/20242613오류 유형: 889. Visual Studio - error : A project with that name is already opened in the solution.
13522정성태1/11/20242959닷넷: 2200. C# - HttpClient.PostAsJsonAsync 호출 시 "Transfer-Encoding: chunked" 대신 "Content-Length" 헤더 처리
13521정성태1/11/20243099닷넷: 2199. C# - 한국투자증권 KIS Developers OpenAPI의 WebSocket Ping, Pong 처리
1  2  3  4  [5]  6  7  8  9  10  11  12  13  14  15  ...