2010-12-03 7 views
0

Visual Studio의 C# 응용 프로그램에 웹 서비스 참조를 추가하려고합니다. 웹 서비스는 Sun의 GlassFish 서버에서 호스팅됩니다..NET에서 GlassFish 생성 WSDL을 사용할 수 없음

Custom tool warning: The following Policy Assertions were not Imported: 
    XPath://wsdl:definitions/wsdl:binding[@name='SecurityWebServicePortBinding']/wsdl:operation[@name='RegisterUser'] 
    Assertions: 
    <wsat:ATAlwaysCapability xmlns:wsat='http://schemas.xmlsoap.org/ws/2004/10/wsat'>..</wsat:ATAlwaysCapability> 

은 분명히 그것은 글래스 피쉬 서버에 의해 게시 된 WSDL의 정책 주장을 이해할 수 없다 : 나는 서비스 참조를 추가하려고하면 불행하게도 Visual Studio에서 다음과 같은 경고를 생성합니다.

<?xml version='1.0' encoding='UTF-8'?> 
<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://test/securityservice.wsdl" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    xmlns="http://schemas.xmlsoap.org/wsdl/" 
    targetNamespace="http://test/securityservice.wsdl" 
    name="SecurityService"> 

    <wsp:Policy xmlns:wsat="http://schemas.xmlsoap.org/ws/2004/10/wsat" wsu:Id="SecurityWebServicePortBinding_AuthenticateUser_WSAT_Policy"> 
     <wsat:ATAlwaysCapability /> 
     <wsat:ATAssertion xmlns:ns1="http://schemas.xmlsoap.org/ws/2002/12/policy" wsp:Optional="true" ns1:Optional="true" /> 
    </wsp:Policy> 

    <wsp:Policy xmlns:wsat="http://schemas.xmlsoap.org/ws/2004/10/wsat" wsu:Id="SecurityWebServicePortBinding_RegisterUser_WSAT_Policy"> 
     <wsat:ATAlwaysCapability /> 
     <wsat:ATAssertion xmlns:ns2="http://schemas.xmlsoap.org/ws/2002/12/policy" wsp:Optional="true" ns2:Optional="true" /> 
    </wsp:Policy> 

    ... 

    <binding name="SecurityWebServicePortBinding" type="tns:SecurityWebService"> 
     <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> 
     <operation name="RegisterUser"> 
      <wsp:PolicyReference URI="#SecurityWebServicePortBinding_RegisterUser_WSAT_Policy" /> 
      <soap:operation soapAction="RegisterUser" /> 
      <input> 
       <wsp:PolicyReference URI="#SecurityWebServicePortBinding_RegisterUser_WSAT_Policy" /> 
       <soap:body use="literal" /> 
      </input> 
      <output> 
       <wsp:PolicyReference URI="#SecurityWebServicePortBinding_RegisterUser_WSAT_Policy" /> 
       <soap:body use="literal" /> 
      </output> 
      <fault name="UsernameExistsException"> 
       <soap:fault name="UsernameExistsException" use="literal" /> 
      </fault> 
     </operation> 
    </binding> 

    ... 

</definitions> 

나는 WSDL에서 모든 정책 요소를 제거하면, 비주얼 스튜디오 (사실 이전에 내가 손으로 결코 WSDL을 작성하는 데 아무 문제없이 서비스를 소비 할 수있는 다음은 WSDL에서 발췌입니다 정책 진술서를 작성하십시오). 따라서 내 질문은 다음과 같습니다.

  1. 왜 GlassFish는 정책 추가를 주장합니까? 그들을 억압하는 어떤 방법이 있습니까?
  2. Visual Studio가 정책을 사용하여 WSDL을 소비 할 수없는 이유는 무엇입니까?
+0

WSDL을 어떻게 사용하고 있습니까? "서비스 참조 추가"? –

+0

예 - "서비스 참조 추가"및 WSDL의 URL을 가리 킵니다. – Naresh

답변

0

글쎄, GlassFish가 ws-AT 정책을 추가하는 이유를 알았습니다. 내 웹 서비스 (아래 참조) EJB를 사용하여 생성되는 : 무 상태 EJB 방법에 대한 기본 트랜잭션 속성이 필요하기 때문에

@Stateless 
@WebService 
public class SecurityWebService { 
    ... 
} 

, 글래스 피쉬는 웹 서비스 메서드 트랜잭션이 너무 (자세한 내용은 here 참조)하고있다. 내가 원하는 행동이 아니지만 그게 어떻게 된거 야!

0

ws-AT (Atomic Transactions)는 WCF가 알지 못하는 SOAP 사양의 일부인 것처럼 보입니다. 여기에 몇 가지 정보가있다 - http://schemas.xmlsoap.org/ws/2004/10/wsat/

업데이트 : (실제로 WCF는 WS-AT 사양을 알고 있지만 완전히를 지원하지 않는 http://schemas.xmlsoap.org/ws/2004/10/wsat /). WCF가 OleTransactions를 사용하는 대안을 가지고 있기 때문에 이것이라고 생각합니다.

+0

이것을 설명하는 링크를 제공해 주시겠습니까? – kevindaub

+0

감사합니다. 이제는 ws-AT가 문제를 일으킨다는 사실을 알게되었으므로 GlassFish가 ws-AT 정책을 실행하는 것을 막을 수있는 방법이 있습니까? – Naresh

관련 문제