asmx interop

Hello trying to get a asmx Web Service client talking to a WCF self hosted service( or windows service) but when i run wsdl i get

C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin>wsdl http://localhost:22
223/NotificationManager wsdl
Microsoft (R) Web Services Description Language Utility
[Microsoft (R) .NET Framework, Version 2.0.50727.42]
Copyright (C) Microsoft Corporation. All rights reserved.
Error: There was an error processing 'http://localhost:22223/NotificationManager
wsdl'.
- There was an error downloading 'http://localhost:22223/NotificationManager w
sdl'.
- The request failed with an empty response.

and a different simple service

C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin>wsdl http://vmware-xp1:8
001/SimpleHttp wsdl
Microsoft (R) Web Services Description Language Utility
[Microsoft (R) .NET Framework, Version 2.0.50727.42]
Copyright (C) Microsoft Corporation. All rights reserved.
Error: There was an error processing 'http://vmware-xp1:8001/SimpleHttp wsdl'.
- There was an error downloading 'http://vmware-xp1:8001/SimpleHttp wsdl'.
- The request failed with an empty response.

I had a look at the sample which apeared to work but it is web hosted .

There apears to be an exception in the message the server sends back listed below

Any ideas

Regards,

Ben


<<<<< SendReply
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/
addressing/none">http://schemas.microsoft.com/net/2005/12/windowscommunicationfo
undation/dispatcher/fault</Action>
</s:Header>
<s:Body>
<s:Fault>
<faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommun
icationfoundation/dispatcher">a:InternalServiceFault</faultcode>
<faultstring xml:lang="en-US">The body reader is in ReadState 'EndOfFile'
and cannot be consumed.</faultstring>
<detail>
<ExceptionDetail xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xml
ns="http://schemas.datacontract.org/2004/07/System.ServiceModel">
<HelpLink i:nil="true" />
<InnerException i:nil="true" />
<Message>The body reader is in ReadState 'EndOfFile' and cannot be con
sumed.</Message>
<StackTrace> at System.ServiceModel.Channels.ReceivedMessage.OnWrite
BodyContents(XmlDictionaryWriter writer)
at System.ServiceModel.Channels.Message.OnWriteMessage(XmlDictionaryWriter wr
iter)
at System.ServiceModel.Channels.Message.OnCreateBufferedCopy(Int32 maxBufferS
ize, XmlDictionaryReaderQuotas quotas)
at System.ServiceModel.Channels.StreamedMessage.OnCreateBufferedCopy(Int32 ma
xBufferSize)
at System.ServiceModel.Channels.Message.CreateBufferedCopy(Int32 maxBufferSiz
e)
at RKiss.WSEventing.NotificationManagerService`1.FireSubscription(Message mes
sage) in C:\dev\Visual Studio Projects\Services\Tools\WSEventing_src\WSEventing\
WSEventing\NotificationManagerService.cs:line 100
at SyncInvokeFireSubscription(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.InvokeDelegate.Invoke(Object target, Object
[] inputs, Object[] outputs)
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, O
bject[] inputs, Object[]&amp; outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(Messag
eRpc&amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(Me
ssageRpc&amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(Me
ssageRpc&amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(Me
ssageRpc&amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(Me
ssageRpc&amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(Me
ssageRpc&amp; rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationConte
xtSet)</StackTrace>
<Type>System.InvalidOperationException</Type>
</ExceptionDetail>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>



Answer this question

asmx interop

  • anukirthi

    Solved

    Sorry i have resolved my problem , the problem was i was viewing the wsdl and service via the end point in the binding as i think this was the behaviour in an earlier ctp. In fact i should have been using the default/base address.

    Regards,

    Ben


  • SParker

    if you have complete repro,please send it to me,my email id is madhup@microsoft.com



  • Lance77035

    hello Mahdu ,

    Use the self host sample service and change the config as below , i first though it was that the httpGetEnabled="true" wasnt set ( the wsHttpBinding gave me a http page with the error) , i enabled this got the page and wdsl up with wsHttpbinding but basicHttp still gives me the same no action fault.

    I even steped through an action = * op method and it received the request , i forced a return in the code ( action was null not empty ) ,but the fault is generated after this handle is processed . Does this mean basicHttp is broken Is there a work around or is it just the iE / wsdl generation as it should have a valid action otherwise

    Regards,

    Ben

    Addendum: in an action = * message handler changing the action to string.Empty , prevents the fault but it looks like the server closed the connection before replying Ok .

    Ie

    C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin>wsdl http://localhost:22 223/NotificationManager wsdl Microsoft (R) Web Services Description Language Utility [Microsoft (R) .NET Framework, Version 2.0.50727.42] Copyright (C) Microsoft Corporation. All rights reserved.

    Error: There was an error processing 'http://localhost:22223/NotificationManager

    wsdl'.

    - There was an error downloading 'http://localhost:22223/NotificationManager w

    sdl'.

    - The underlying connection was closed: An unexpected error occurred on a rece ive.

    - Unable to read data from the transport connection: An existing connection wa s forcibly closed by the remote host.

    - An existing connection was forcibly closed by the remote host

    < xml version="1.0" encoding="utf-8" >

    <configuration>

    <appSettings>

    <!-- use appSetting to configure base address provided by host -->

    <add key="baseAddress" value="http://localhost:8000/servicemodelsamples/service" />

    </appSettings>

    <system.serviceModel>

    <services>

    <service

    name="Microsoft.ServiceModel.Samples.CalculatorService" behaviorConfiguration ="MyServiceTypeBehaviors">

    <!-- use base address provided by host -->

    <endpoint address=""

    binding="wsHttpBinding"

    contract="Microsoft.ServiceModel.Samples.ICalculator" />

    <endpoint address="http://localhost:8001/servicemodelsamples/service"

    binding="basicHttpBinding"

    contract="Microsoft.ServiceModel.Samples.ICalculator" />

    </service>

    </services>

    <!--For debugging purposes set the returnUnknownExceptionsAsFaults attribute to true-->

    <behaviors>

    <serviceBehaviors>

    <behavior name="MyServiceTypeBehaviors" >

    <!-- Add the following element to your service behavior configuration. -->

    <serviceMetadata httpGetEnabled="true" />

    </behavior>

    <behavior

    name="CalculatorServiceBehavior"

    returnUnknownExceptionsAsFaults="False" >

    <serviceMetadata httpGetEnabled="true" />

    </behavior>

    </serviceBehaviors>

    </behaviors>

    </system.serviceModel>

    </configuration>


  • n0n4m3

    Thanks for responding

    ie returns this page ( as does the wsdl)

    - <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    - <s:Body>
    - <s:Fault>
    <faultcode xmlns:a="http://schemas.microsoft.com/ws/2005/05/addressing/none">a:ActionNotSupported</faultcode>
    <faultstring xml:lang="en-US">The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).</faultstring>
    </s:Fault>
    </s:Body>
    </s:Envelope>
    Config file

    <system.serviceModel>

    <services>

    <service name="RKiss.WSEventing.SubscriptionManagerService" behaviorConfiguration="EventingManagerExtention">

    <endpoint

    address="net.tcp://localhost:11111/SubscriptionManager"

    binding="netTcpBinding"

    contract="RKiss.WSEventing.IWSEventing"/>

    <endpoint

    address="http://localhost:11112/SubscriptionManager"

    binding="basicHttpBinding"

    contract="RKiss.WSEventing.IWSEventing"/>

    </service>

    <service name="RKiss.WSEventing.NotificationManagerService" behaviorConfiguration="EventingManagerExtention">

    <endpoint

    address="net.tcp://localhost:22222/NotificationManager"

    binding="customBinding"

    bindingConfiguration="binding1"

    contract="RKiss.WSEventing.INotificationManager"/>

    <endpoint

    address="http://localhost:22223/NotificationManager"

    binding="basicHttpBinding"

    contract="RKiss.WSEventing.INotificationManager"/>

    </service>

    </services>

    and

    <bindings>

    <customBinding>

    <binding name="binding1">

    <tcpTransport/>

    </binding>

    </customBinding>

    </bindings>

    I suspect its the contract here is its current incarnation ( as you can see by what im commenting out )

    [ServiceContract(Namespace = WSEventing.NamespaceUri)]

    [XmlSerializerFormat(Style = OperationFormatStyle.Document)]

    public interface IWSEventing : IWSEventingFactory, IWSEventingOperation

    {

    }

    [ServiceContract(Namespace = WSEventing.NamespaceUri)]

    [XmlSerializerFormat(Style = OperationFormatStyle.Document)]

    public interface IWSEventingFactory

    {

    /* [OperationContract(Action = WSEventing.SubscribeAction, ReplyAction = WSEventing.SubscribeResponseAction)]

    [FaultContract(typeof(SupportedDeliveryMode))]

    [FaultContract(typeof(SupportedDialect))]

    [TransactionFlow(TransactionFlowOption.Allowed)] */

    [OperationContract()]

    SubscribeResponse Subscribe(SubscribeRequest request);

    }

    [ServiceContract(Namespace = WSEventing.NamespaceUri)]

    [XmlSerializerFormat(Style = OperationFormatStyle.Document)]

    public interface IWSEventingOperation

    {

    // [OperationContract(Action = WSEventing.GetStatusAction, ReplyAction = WSEventing.GetStatusResponseAction)]

    //[TransactionFlow(TransactionFlowOption.Allowed)]

    [OperationContract()]

    GetStatusResponse GetStatus(GetStatusRequest request);

    // [OperationContract(Action = WSEventing.RenewAction, ReplyAction = WSEventing.RenewResponseAction)]

    // [TransactionFlow(TransactionFlowOption.Allowed)]

    [OperationContract()]

    RenewResponse Renew(RenewRequest request);

    // [OperationContract(Action = WSEventing.UnsubscribeAction, ReplyAction = WSEventing.UnsubscribeResponseAction)]

    //[TransactionFlow(TransactionFlowOption.Allowed)]

    [OperationContract()]

    UnsubscribeResponse Unsubscribe(UnsubscribeRequest request);

    }

    Regards,

    Ben


  • nub340


    Are you able to browse your service url in IE ,can you please post your service config file also

    http://localhost:22223/NotificationManager

    http://localhost:22223/NotificationManager wsdl



  • asmx interop