Can't consume GlassFish generated WSDL from .NET

I am trying to add a web service reference to my C# application in Visual Studio. The web service is hosted on Sun's GlassFish server. Unfortunately Visual Studio produces the following warning when I try to add the service reference:

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>

Apparently it cannot understand policy assertions in the WSDL published by the GlassFish server. Here's an excerpt from the WSDL:

<?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>

If I remove all the policy elements from the WSDL, Visual Studio is able to consume the service without any problems (in fact earlier I used to write the WSDL by hand and never put the policy statements). So my questions are:

  1. Why is GlassFish insisting on adding the policies? Is there any way to suppress them?
  2. Why is Visual Studio not able to consume the WSDL with the policies?

Answers


ws-AT (Atomic Transactions) seems to be part of the SOAP specification which WCF does not know about. There is some information here - http://schemas.xmlsoap.org/ws/2004/10/wsat/

Update: Actually WCF is aware of the ws-AT spec, but doesn't support it fully (http://schemas.xmlsoap.org/ws/2004/10/wsat/). I suppose this is because WCF has alternatives which use OleTransactions.


Ok, I figured out why GlassFish is adding the ws-AT policies. My web service is being generated using an EJB (see below):

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

Since the default transaction attribute for a stateless EJB method is REQUIRED, GlassFish is making the web service method transactional too (see here for details). Not the behavior I want, but that's how it is!


Need Your Help

how to add a complete folder to a jar file by ant

ant jar

I'd like to create like a "fat" jar with ant where I have, not only the usual classes, manifest files, etc, but also my 'libs' folder too.

Iterating all items inside QListView using python

python pyqt4 qt-designer

I have a QlistView inside is which a checkboxes (created dynamically) with item name (QstandardItem). And below Qlistview is a checkbox named DatacheckercheckBox1. What I want is when this

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.