2010-09-24 25 views
10

'dan geçersiz yöntemler oluşturur Bu, ilk kez WCF'yi kullanmaya çalıştığım için hatalı bir şey yaptığımı tahmin ediyorum. http://confluence.atlassian.com/rpc/soap-axis/confluenceservice-v1?wsdl adresinde WSDL tarafından tanımlanan bir soap hizmetine erişmeye çalışıyorum VS2010 kullanıyorum ve projeme bir Hizmet Referansı ekledim ve URL'ye oraya yönlendirdim (veya bunun yerine intranet yüklememizi) Hizmeti görüntülemek için Nesne Tarayıcısını kullandığımda, arabirimdeki işlemler parametresiz TÜM geçersiz yöntemlerdir. WCF, tip bilgisini doğru okuyor gibi görünüyor. Bu hataları vermez, ancak aşağıdaki gibi uyarılar ton veriyor:WCF hizmet başvurusu, WSDL

UYARI 1 Özel aracı uyarı: alınamaz operasyon getPermissions içinde adlı InvalidSessionException Arıza. Desteklenmeyen WSDL, hata mesaj parçası, bir elemanına başvurmalıdır. Bu hata mesajı referansı değildir. WSDL belgesine erişimini düzenlediyseniz, öğesini 'element' özniteliğini kullanarak bir şema öğesine başvuruda bulunarak sorunu düzeltebilirsiniz. Z: \ TestLibrary \ Servis Confluence \ Reference.svcmap 1 1 TestLibrary

Uyarı 2 Özel aracı uyarı \ Referanslar: opsiyonel WSDL uzatma elemanı 'beden' ad gelen 'http://schemas.xmlsoap.org/wsdl/soap/' işlenmedi. XPath: // wsdl: define [@ targetNamespace = 'http://confluence.atlassian.com/rpc/soap-axis/confluenceservice-v1']/wsdl: ciltleme [@ name = 'confluenceservice-v1SoapBinding']/wsdl: işlem [@ name = 'getPermissions']/wsdl: girdi [@ ad = 'getPermissionsRequest'] Z: \ TestLibrary \ Servis yanlış yapıyorum 1 1 TestLibrary

Kavşak \ Reference.svcmap \ Kaynaklar? Hizmetin konfigürasyonunu seçenekler kombinasyonlarıyla değiştirmeyi denedim, ancak WSDL'den doğru şekilde asla çekemedim. WCF'nin servis arayüzüyle birlikte tip sınıflarını otomatik olarak oluşturacağını varsayıyorum. WSDL'de hangi türlerin kullanıldığını bulmam ve sınıfları ve veri sözleşmelerini kendim oluşturmam mı gerekiyor yoksa başka bir şey mi?

cevap

5

HHMM ... ilginç - Ben verdiğiniz adresten karşı komut satırından svcutil.exe yapıyorduk, ben WSDL sorunları hakkında uyarılar bir ton alırken, ben de bazı kod alabilirim - gibi bir şey:

//------------------------------------------------------------------------------ 
// <auto-generated> 
//  This code was generated by a tool. 
//  Runtime Version:2.0.50727.4952 
// 
//  Changes to this file may cause incorrect behavior and will be lost if 
//  the code is regenerated. 
// </auto-generated> 
//------------------------------------------------------------------------------ 

[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")] 
[System.ServiceModel.ServiceContractAttribute(Namespace="http://confluence.atlassian.com/rpc/soap-axis/confluenceservice-v1", ConfigurationName="ConfluenceSoapService")] 
public interface ConfluenceSoapService 
{ 
    // CODEGEN: Generating message contract since the wrapper namespace (http://soap.rpc.confluence.atlassian.com) of message getPermissionsRequest does not match the default value (http://confluence.atlassian.com/rpc/soap-axis/confluenceservice-v1) 
    [System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")] 
    [System.ServiceModel.XmlSerializerFormatAttribute(Style=System.ServiceModel.OperationFormatStyle.Rpc, Use=System.ServiceModel.OperationFormatUse.Encoded)] 
    getPermissionsResponse getPermissions(getPermissionsRequest request); 

    // CODEGEN: Generating message contract since the wrapper namespace (http://soap.rpc.confluence.atlassian.com) of message searchRequest does not match the default value (http://confluence.atlassian.com/rpc/soap-axis/confluenceservice-v1) 
    [System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")] 
    [System.ServiceModel.XmlSerializerFormatAttribute(Style=System.ServiceModel.OperationFormatStyle.Rpc, Use=System.ServiceModel.OperationFormatUse.Encoded)] 
    [System.ServiceModel.ServiceKnownTypeAttribute(typeof(RemoteException))] 
    [System.ServiceModel.ServiceKnownTypeAttribute(typeof(Vector))] 
    [System.ServiceModel.ServiceKnownTypeAttribute(typeof(RemotePermission))] 
    [System.ServiceModel.ServiceKnownTypeAttribute(typeof(RemoteNodeStatus))] 
    [System.ServiceModel.ServiceKnownTypeAttribute(typeof(RemotePageHistory))] 
    [System.ServiceModel.ServiceKnownTypeAttribute(typeof(RemoteContentPermission))] 
    [System.ServiceModel.ServiceKnownTypeAttribute(typeof(AbstractRemotePageSummary))] 
    [System.ServiceModel.ServiceKnownTypeAttribute(typeof(RemoteSpaceSummary))] 
    [System.ServiceModel.ServiceKnownTypeAttribute(typeof(RemoteSearchResult))] 
    searchResponse search(searchRequest request); 

ConfluenceSoapService.cs dosyanızı oluşturmak için komut satırından svcutil.exe dosyasını kullanmayı denerim ve daha sonra bunu Confluence hizmetinizle konuşmak için kullanırdım.

+1

+1. – Bernard

+0

Hmm ... svcutil.exe ile çalışıyor görünmektedir. Bu gerçekten garip. Yine de teşekkürler. – StarKat99

+0

Ayrıca benim için çalıştı, Visual Studio Başlat menüsü altında giderseniz, svcutil kolay erişim sağlayan VS komut istemi için bir shortctu, sonra: 'svcutil.exe http: // somedomain.com/someapi.wsdl' – AaronLS

0

JIRA 4.4'te bu sorunla karşılaştım ve bir Hizmet Başvurusu yerine eski Web Başvurusu'nu kullanırsanız, DOES çalışır. Bu işlemle ilgili talimatlar için

, bkz:

Bu Web Reference vs. Service Reference benim için en basit çözüm oldu, ben JIRA (uzak SOAP) DİNLENME doğru hareket ediyor ve ben sadece hızlı bir şekilde almaya çalışırken ve çalıştırıyorum bildiğimiz için. Svcutil.exe önerisi için

İlgili konular