-1

My problem is that when I run my solution, I had no problems

Here is what service output looks like

enter image description here

And when I make the my link to like this

enter image description here

And it is correct

But when I deploy the solution, install it using setup from the installer i created

I can still access, but output goes like this

enter image description here

And I try to navigate it, it looks like this and it is not right because it has no output

enter image description here

How can I fix it? I thought it is already ok because when I run it in visual studio it gives me expected output but when i deploy it is not.

Service App.Config

    <?xml version="1.0"?>
<configuration>

  <configSections>
    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
      <section name="WcfServiceLibrary.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    </sectionGroup>
  </configSections>
  <system.web>
    <compilation debug="true"/>
  </system.web>

<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
  <system.serviceModel>
    <behaviors>
      <endpointBehaviors>
        <behavior name="NewBehavior0">
          <webHttp defaultOutgoingResponseFormat="Json" />
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <services>
      <service name="WcfServiceLibrary.Service">
        <endpoint address="" behaviorConfiguration="NewBehavior0" binding="webHttpBinding"
          bindingConfiguration="" name="Basic" contract="WcfServiceLibrary.IService" />
        <host>
          <baseAddresses>
            <add baseAddress="http://PHWS13:8080/service" />
          </baseAddresses>
        </host>
      </service>
    </services>
  </system.serviceModel>
</configuration>
SHINHAN
  • 685
  • 2
  • 12
  • 28
  • Can you please share your web.config for this service ? Becausse as per the message you need to add in your service behaviour tag. – Sandeep Kumar May 03 '13 at 06:45
  • May be you should try executing your winforms application in Administrator mode ? (right-click and run as administrator) – Harsh Baid May 03 '13 at 06:54
  • @HarshBaid, yes it's already in admin mode. im just confused why when i run it in visualStudio it is okay – SHINHAN May 03 '13 at 06:55

1 Answers1

1

In the <behaviors> section you need to add

        <serviceBehaviors>
            <behavior name="NewSVCBehavior0"> >
                <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
                <serviceDebug includeExceptionDetailInFaults="true" />
            </behavior>
            </serviceBehaviors>

And instead of

            <service name="WcfServiceLibrary.Service">

write

            <service name="WcfServiceLibrary.Service" behaviorConfiguration="NewSVCBehavior0">

and try after this change in config.

Sandeep Kumar
  • 783
  • 1
  • 5
  • 13
  • still the same, cant access when i deploy – SHINHAN May 03 '13 at 07:03
  • Now it might be the issue in right permission in IIS. Which version of IIS you are using ? In IIS 5.2 you have a option in Home Directory tab to set execute permission. And set execute permission to "Script and Executable" – Sandeep Kumar May 03 '13 at 07:10
  • For iis 7 You can check [here] [http://technet.microsoft.com/en-us/library/cc725855(v=ws.10).aspx] – Sandeep Kumar May 03 '13 at 07:15
  • I think im almost there but got this error "The message with To 'http://phws13:8080/service/1/1/12345/1/1' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and receiver's EndpointAddresses agree." – SHINHAN May 03 '13 at 07:55
  • 1
    for AddressFilter mismatch you need to add the following attribute in your service [ServiceBehavior(AddressFilterMode = AddressFilterMode.Any)] – Sandeep Kumar May 03 '13 at 08:02
  • oh its fixed it just need webhttp on both appconfig – SHINHAN May 03 '13 at 08:32