2010-08-18 6 views
1

2 개의 끝점 (mex 및 wsHttpBinding)이있는 WCF 웹 서비스를 실행하고 있습니다. 웹 서비스는 주소가 http://localhost:2412/Service1.svc이고 연락처의 이름이 "WcfService1.IService1"입니다.Excel에서 Service Moniker를 사용하여 WCF를 호출 할 때 오류가 발생했습니다.

Excel의 VBA에서이 서비스를 호출하고 싶습니다. 오류 '-2147221020 (800401e4)'

이 에게

아무도 알고 있나요 런타임 : 나는 내가 folowing 엑셀 오류 메시지를받을이 코드를 실행하려고하면

mexMonikerString = "service:mexAddress='http://localhost:2412/Service1.svc/mex'" 
mexMonikerString = mexMonikerString + ", address='http://localhost:2412/Service1.svc'" 
mexMonikerString = mexMonikerString + ", binding=WSHttpBinding_IService1" 
mexMonikerString = mexMonikerString + ", contract=IService1" 

Set service = GetObject(mexMonikerString) 

: 그에게, 나는 folowing 코드를 사용 이 오류의 원인은 무엇이며 어떻게 해결할 수 있습니까?

답변

1

Calling WCF Services from Excel VBA clients using the WCF Service Moniker을 살펴보십시오. 그것은 당신이 어떻게 실제 오류에 대한 설명을 얻는 수신하는 것과 같은 오류 코드를 보여줍니다 디버깅에 대한 섹션 (이 경우 '인터페이스를 찾을 수 없습니다')를 가지고있다. 아래의 형식을 사용

+0

링크 debuging에 기재된 방법을 이용하여 문제를 해결했다. WCF 인터페이스의 사양에 문제가있었습니다 – MuSTaNG

+0

Visual Studio 디버거 http://pieterderycke.wordpress.com을 사용하는 대안을 소개하는 (디버깅) WCF 서비스 및 VBA 코드에 대한 기사를 작성했습니다./2010/10/05/using-a-service-legacy-co-applications와 new-net-applications/ – MuSTaNG

0

IIS에서 WCF 서비스를 게시 할 수 있습니다.

1

시도 :

Dim addr As String 
addr = "service:mexAddress=""http://localhost:2412/Service1/mex""," 
addr = addr + "address=""http://localhost:2412/Service1.svc/""," 
addr = addr + "contract=""IService1"", contractNamespace=""http://tempuri.org/""," 
addr = addr + "binding=""WSHttpBinding_IService1"", bindingNamespace=""http://tempuri.org/""" 

Set service = GetObject(addr) 
+0

Tnx 사이의 통신을 모니 커하지만 이미 해결책을 찾았습니다 – MuSTaNG

관련 문제