none
Axis2 Rampart web service and WCF RRS feed

  • Question

  • Hi All

    I have a Rampart webservice configured with usernametoken aithetication with rampart. When i consume in .Net using WCF

    I am having a problem in acessing the webservice. The error it shows is

    "The request channel timed out while waiting for a reply after 00:00:59.7187536. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout."

    Code :

     public void WCFMethod()
            {

                WSHttpBinding myBinding = new WSHttpBinding();
                myBinding.Security.Mode = SecurityMode.TransportWithMessageCredential;
                myBinding.Security.Message.ClientCredentialType = MessageCredentialType.UserName;
                myBinding.Security.Message.EstablishSecurityContext = false;

                myBinding.Security.Message.NegotiateServiceCredential = false;

                BindingElementCollection elements = myBinding.CreateBindingElements();
                elements.Find<SecurityBindingElement>().IncludeTimestamp = false;

                elements.Find<TextMessageEncodingBindingElement>().MessageVersion = MessageVersion.Soap11;            
              CustomBinding newBinding = new CustomBinding(elements);            
               String address = "https://bchetana.ind.com:7033/axis2/services/SWAuthService";                     
               SWAuthServicePortTypeClient svc = new SWAuthServicePortTypeClient(newBinding, new EndpointAddress(address));
                svc.ClientCredentials.UserName.UserName = "wsuser";
                svc.ClientCredentials.UserName.Password = "wspwd";               
                svc.EFMAuthentication(new SWServiceAuthRequest());           
              
            }

           I even tryed incressing the time out in app.config file.... But no use...

    Please Help


    Chetana

    Saturday, May 19, 2012 9:20 AM

Answers

All replies

  • please publish a sample working soap request to the service

    http://webservices20.blogspot.com/
    WCF Security, Interoperability And Performance Blog

    Saturday, May 19, 2012 10:07 AM
  • Make sure the service is online by entering the IP address in a webbrowser

    "https://bchetana.ind.com:7033/axis2/services/SWAuthService";                     

    Often sites go down on Friday nights for backup.


    jdweng

    Saturday, May 19, 2012 10:40 AM
  • this my WSDl file

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ax28="http://SWAuthService.WebService.steelwedge.com/xsd" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:ns="http://SWAuthService.WebService.steelwedge.com" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://SWAuthService.WebService.steelwedge.com">
        <wsdl:documentation>Please Type your service description here</wsdl:documentation>
        <wsdl:types>
            <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://SWAuthService.WebService.steelwedge.com/xsd">
                <xs:complexType name="SWServiceAuthRequest">
                    <xs:sequence>
                        <xs:element minOccurs="0" name="URL" nillable="true" type="xs:string"/>
                        <xs:element minOccurs="0" name="authToken" nillable="true" type="xs:string"/>
                        <xs:element minOccurs="0" name="passWord" nillable="true" type="xs:string"/>
                        <xs:element minOccurs="0" name="requestType" nillable="true" type="xs:string"/>
                        <xs:element minOccurs="0" name="userName" nillable="true" type="xs:string"/>
                        <xs:element minOccurs="0" name="userSystenName" nillable="true" type="xs:string"/>
                        <xs:element minOccurs="0" name="userWindowsLoginName" nillable="true" type="xs:string"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="SWServiceAuthResponce">
                    <xs:sequence>
                        <xs:element minOccurs="0" name="accountName" nillable="true" type="xs:string"/>
                        <xs:element minOccurs="0" name="authToken" nillable="true" type="xs:string"/>
                        <xs:element minOccurs="0" name="errorCode" nillable="true" type="xs:string"/>
                        <xs:element minOccurs="0" name="errorMessage" nillable="true" type="xs:string"/>
                        <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
                        <xs:element minOccurs="0" name="requestType" nillable="true" type="xs:string"/>
                        <xs:element minOccurs="0" name="serviceName" nillable="true" type="xs:string"/>
                        <xs:element minOccurs="0" name="sessionId" nillable="true" type="xs:string"/>
                        <xs:element minOccurs="0" name="sessionName" nillable="true" type="xs:string"/>
                        <xs:element minOccurs="0" name="userAuthenticated" nillable="true" type="xs:boolean"/>
                        <xs:element minOccurs="0" name="userLogLevel" nillable="true" type="xs:string"/>
                        <xs:element minOccurs="0" name="userTemplateDestinationPath" nillable="true" type="xs:string"/>
                        <xs:element minOccurs="0" name="userTemplateSourcePath" nillable="true" type="xs:string"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:schema>
            <xs:schema xmlns:ax29="http://SWAuthService.WebService.steelwedge.com/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://SWAuthService.WebService.steelwedge.com">
                <xs:import namespace="http://SWAuthService.WebService.steelwedge.com/xsd"/>
                <xs:element name="EFMAuthentication">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element minOccurs="0" name="request" nillable="true" type="ax29:SWServiceAuthRequest"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <xs:element name="EFMAuthenticationResponse">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element minOccurs="0" name="return" nillable="true" type="ax29:SWServiceAuthResponce"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:schema>
        </wsdl:types>
        <wsdl:message name="EFMAuthenticationRequest">
            <wsdl:part element="ns:EFMAuthentication" name="parameters"/>
        </wsdl:message>
        <wsdl:message name="EFMAuthenticationResponse">
            <wsdl:part element="ns:EFMAuthenticationResponse" name="parameters"/>
        </wsdl:message>
        <wsdl:portType name="SWAuthServicePortType">
            <wsdl:operation name="EFMAuthentication">
                <wsdl:input message="ns:EFMAuthenticationRequest" wsaw:Action="urn:EFMAuthentication"/>
                <wsdl:output message="ns:EFMAuthenticationResponse" wsaw:Action="urn:EFMAuthenticationResponse"/>
            </wsdl:operation>
        </wsdl:portType>
        <wsdl:binding name="SWAuthServiceSoap11Binding" type="ns:SWAuthServicePortType">
            <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
            <wsdl:operation name="EFMAuthentication">
                <soap:operation soapAction="urn:EFMAuthentication" style="document"/>
                <wsdl:input>
                    <soap:body use="literal"/>
                </wsdl:input>
                <wsdl:output>
                    <soap:body use="literal"/>
                </wsdl:output>
            </wsdl:operation>
        </wsdl:binding>
        <wsdl:binding name="SWAuthServiceSoap12Binding" type="ns:SWAuthServicePortType">
            <soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
            <wsdl:operation name="EFMAuthentication">
                <soap12:operation soapAction="urn:EFMAuthentication" style="document"/>
                <wsdl:input>
                    <soap12:body use="literal"/>
                </wsdl:input>
                <wsdl:output>
                    <soap12:body use="literal"/>
                </wsdl:output>
            </wsdl:operation>
        </wsdl:binding>
        <wsdl:binding name="SWAuthServiceHttpBinding" type="ns:SWAuthServicePortType">
            <http:binding verb="POST"/>
            <wsdl:operation name="EFMAuthentication">
                <http:operation location="EFMAuthentication"/>
                <wsdl:input>
                    <mime:content part="parameters" type="text/xml"/>
                </wsdl:input>
                <wsdl:output>
                    <mime:content part="parameters" type="text/xml"/>
                </wsdl:output>
            </wsdl:operation>
        </wsdl:binding>
        <wsdl:service name="SWAuthService">
            <wsdl:port binding="ns:SWAuthServiceSoap11Binding" name="SWAuthServiceHttpSoap11Endpoint">
                <soap:address location="http://bchetana.ind.com:7033/axis2/services/SWAuthService.SWAuthServiceHttpSoap11Endpoint/"/>
            </wsdl:port>
            <wsdl:port binding="ns:SWAuthServiceSoap12Binding" name="SWAuthServiceHttpSoap12Endpoint">
                <soap12:address location="http://bchetana.ind.com:7033/axis2/services/SWAuthService.SWAuthServiceHttpSoap12Endpoint/"/>
            </wsdl:port>
            <wsdl:port binding="ns:SWAuthServiceHttpBinding" name="SWAuthServiceHttpEndpoint">
                <http:address location="http://bchetana.ind.com:7033/axis2/services/SWAuthService.SWAuthServiceHttpEndpoint/"/>
            </wsdl:port>
        </wsdl:service>
    </wsdl:definitions>


    Chetana

    Sunday, May 20, 2012 12:47 PM
  • this is the wsdl - you need to publish the working soap

    http://webservices20.blogspot.com/
    WCF Security, Interoperability And Performance Blog

    Sunday, May 20, 2012 5:56 PM
  • <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:swa="http://SWAuthService.WebService.steelwedge.com" xmlns:xsd="http://SWAuthService.WebService.steelwedge.com/xsd">
       <soap:Header>
          <wsse:Security soap:mustUnderstand="true" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
             <wsse:UsernameToken wsu:Id="UsernameToken-1">
                <wsse:Username>bob</wsse:Username>
                <wsse:Password Type="awF69Hej1ymEz/WCtkF7agcANzY=</wsse:Password">http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">awF69Hej1ymEz/WCtkF7agcANzY=</wsse:Password>
                <wsse:Nonce EncodingType="KV4a4U/k/ZtGcsP/p3yXpw==</wsse:Nonce">http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">KV4a4U/k/ZtGcsP/p3yXpw==</wsse:Nonce>
                <wsu:Created>2012-05-21T06:48:51.705Z</wsu:Created>
             </wsse:UsernameToken>
          </wsse:Security>
       </soap:Header>
       <soap:Body>
          <swa:EFMAuthentication>
             <!--Optional:-->
             <swa:request>
                <!--Optional:-->
                <xsd:URL>?</xsd:URL>
                <!--Optional:-->
                <xsd:authToken>?</xsd:authToken>
                <!--Optional:-->
                <xsd:passWord>?</xsd:passWord>
                <!--Optional:-->
                <xsd:requestType>?</xsd:requestType>
                <!--Optional:-->
                <xsd:userName>?</xsd:userName>
                <!--Optional:-->
                <xsd:userSystenName>?</xsd:userSystenName>
                <!--Optional:-->
                <xsd:userWindowsLoginName>?</xsd:userWindowsLoginName>
             </swa:request>
          </swa:EFMAuthentication>
       </soap:Body>
    </soap:Envelope>

    Chetana

    Monday, May 21, 2012 6:49 AM
    • Marked as answer by Chetana Rupa Wednesday, May 23, 2012 3:13 AM
    Monday, May 21, 2012 9:32 AM
  • Hi

    I tryed with usernametoken example, But still same error keeps comming up


    Chetana

    Monday, May 21, 2012 10:53 AM
  • please publish the request you send now so we can compare to the working one.

    http://webservices20.blogspot.com/
    WCF Security, Interoperability And Performance Blog

    Monday, May 21, 2012 11:21 AM
  • Hey

    It worked in win7 machine. I was commenting this part as i dont have hot fix for this in my machine. I tryed the same in win7 . It worked fine.

    transportSecurity.AllowInsecureTransport = true;

    How can i install Windows6.0-KB971831-x86.msu in my xp machine?

    I have auto updates. Even then i am not able to have this update.


    Chetana

    Monday, May 21, 2012 12:05 PM
  • Hi..

    Using the above code how can we connect to the same session. My axis2 webservice is in transportsession.


    Chetana

    Thursday, May 24, 2012 10:56 AM