Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Web Service Method Call Fails

Web Service Method Call Fails

Scheduled Pinned Locked Moved WPF
csharpwcf
35 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Pete OHanlon

    Are your clientaccesspolicy.xml or crossdomain.xml files visible? Have a read of this[^].

    "WPF has many lovers. It's a veritable porn star!" - Josh Smith

    As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

    My blog | My articles | MoXAML PowerToys | Onyx

    R Online
    R Online
    realJSOP
    wrote on last edited by
    #20

    Visible? I have a ClientAccessPolicy.xml file in my web services's folder:

    <?xml version="1.0" encoding="utf-8" ?>
    <access-policy>
    <cross-domain-access>
    <policy>
    <allow-from http-request-headers="*">
    <domain uri ="*" />
    </allow-from>
    <grant-to>
    <resource path="/" include-subpaths="true"/>
    </grant-to>
    </policy>
    </cross-domain-access>
    </access-policy>

    I also have a CrossDomain.xml, but I'm not really sure where to put it, so I have it in a few places.

    <?xml version="1.0" encoding="utf-8" ?>
    <cross-domain-policy>
    <allow-http-request-headers-from domain="*" headers="*"/>
    <strong>
    <allow-http-request-headers-from domain="*" headers="SOAPAction" />
    </strong>
    <allow-https-request-headers-from domain="*" headers="*"/>
    <strong>
    <allow-https-request-headers-from domain="*" headers="SOAPAction" />
    </strong>
    </cross-domain-policy>

    Where *should* I put it?

    .45 ACP - because shooting twice is just silly
    -----
    "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
    -----
    "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

    P I 2 Replies Last reply
    0
    • R realJSOP

      Visible? I have a ClientAccessPolicy.xml file in my web services's folder:

      <?xml version="1.0" encoding="utf-8" ?>
      <access-policy>
      <cross-domain-access>
      <policy>
      <allow-from http-request-headers="*">
      <domain uri ="*" />
      </allow-from>
      <grant-to>
      <resource path="/" include-subpaths="true"/>
      </grant-to>
      </policy>
      </cross-domain-access>
      </access-policy>

      I also have a CrossDomain.xml, but I'm not really sure where to put it, so I have it in a few places.

      <?xml version="1.0" encoding="utf-8" ?>
      <cross-domain-policy>
      <allow-http-request-headers-from domain="*" headers="*"/>
      <strong>
      <allow-http-request-headers-from domain="*" headers="SOAPAction" />
      </strong>
      <allow-https-request-headers-from domain="*" headers="*"/>
      <strong>
      <allow-https-request-headers-from domain="*" headers="SOAPAction" />
      </strong>
      </cross-domain-policy>

      Where *should* I put it?

      .45 ACP - because shooting twice is just silly
      -----
      "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
      -----
      "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #21

      You only need the ClientAccessPolicy.xml file. I notice from the exception that you are using https - in the allow-from section, you need to add

      <domain uri=”http://*” />

      "WPF has many lovers. It's a veritable porn star!" - Josh Smith

      As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

      My blog | My articles | MoXAML PowerToys | Onyx

      R 1 Reply Last reply
      0
      • P Pete OHanlon

        You only need the ClientAccessPolicy.xml file. I notice from the exception that you are using https - in the allow-from section, you need to add

        <domain uri=”http://*” />

        "WPF has many lovers. It's a veritable porn star!" - Josh Smith

        As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

        My blog | My articles | MoXAML PowerToys | Onyx

        R Online
        R Online
        realJSOP
        wrote on last edited by
        #22

        doesn't this accomplish the same thing: <domain uri=”*” />

        .45 ACP - because shooting twice is just silly
        -----
        "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
        -----
        "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

        P 1 Reply Last reply
        0
        • R realJSOP

          doesn't this accomplish the same thing: <domain uri=”*” />

          .45 ACP - because shooting twice is just silly
          -----
          "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
          -----
          "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #23

          No.

          "WPF has many lovers. It's a veritable porn star!" - Josh Smith

          As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

          My blog | My articles | MoXAML PowerToys | Onyx

          R 1 Reply Last reply
          0
          • P Pete OHanlon

            No.

            "WPF has many lovers. It's a veritable porn star!" - Josh Smith

            As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

            My blog | My articles | MoXAML PowerToys | Onyx

            R Online
            R Online
            realJSOP
            wrote on last edited by
            #24

            Ok then, but wouldn't it be more correct to do this?

            <access-policy>
            <cross-domain-access>
            <policy>
            <allow-from http-request-headers="*">
            <domain uri ="http://*" />
            </allow-from>
            <grant-to>
            <resource path="/" include-subpaths="true"/>
            </grant-to>
            </policy>

                 <policy>
                     <allow-from https-request-headers="\*">
                         <domain uri ="https://\*" />
                     </allow-from>
                     <grant-to>
                         <resource path="/secure" include-subpaths="true"/>
                     </grant-to>
                 </policy>
            </cross-domain-access>
            

            </access-policy>

            .45 ACP - because shooting twice is just silly
            -----
            "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
            -----
            "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

            P 1 Reply Last reply
            0
            • R realJSOP

              Ok then, but wouldn't it be more correct to do this?

              <access-policy>
              <cross-domain-access>
              <policy>
              <allow-from http-request-headers="*">
              <domain uri ="http://*" />
              </allow-from>
              <grant-to>
              <resource path="/" include-subpaths="true"/>
              </grant-to>
              </policy>

                   <policy>
                       <allow-from https-request-headers="\*">
                           <domain uri ="https://\*" />
                       </allow-from>
                       <grant-to>
                           <resource path="/secure" include-subpaths="true"/>
                       </grant-to>
                   </policy>
              </cross-domain-access>
              

              </access-policy>

              .45 ACP - because shooting twice is just silly
              -----
              "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
              -----
              "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #25

              If this is the way your site is set up, then yes. Alternatively, you could put both the https://* and http://* in the first allow-from if you don't have to worry about the secure path. The reason you have to add the https://* is because SL requires that you explicitly opt-in to secure services.

              "WPF has many lovers. It's a veritable porn star!" - Josh Smith

              As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

              My blog | My articles | MoXAML PowerToys | Onyx

              R 1 Reply Last reply
              0
              • P Pete OHanlon

                If this is the way your site is set up, then yes. Alternatively, you could put both the https://* and http://* in the first allow-from if you don't have to worry about the secure path. The reason you have to add the https://* is because SL requires that you explicitly opt-in to secure services.

                "WPF has many lovers. It's a veritable porn star!" - Josh Smith

                As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

                My blog | My articles | MoXAML PowerToys | Onyx

                R Online
                R Online
                realJSOP
                wrote on last edited by
                #26

                Well, I went ahead and made that change, and it still gives me the same exception. :/

                .45 ACP - because shooting twice is just silly
                -----
                "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
                -----
                "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

                P 1 Reply Last reply
                0
                • R realJSOP

                  Visible? I have a ClientAccessPolicy.xml file in my web services's folder:

                  <?xml version="1.0" encoding="utf-8" ?>
                  <access-policy>
                  <cross-domain-access>
                  <policy>
                  <allow-from http-request-headers="*">
                  <domain uri ="*" />
                  </allow-from>
                  <grant-to>
                  <resource path="/" include-subpaths="true"/>
                  </grant-to>
                  </policy>
                  </cross-domain-access>
                  </access-policy>

                  I also have a CrossDomain.xml, but I'm not really sure where to put it, so I have it in a few places.

                  <?xml version="1.0" encoding="utf-8" ?>
                  <cross-domain-policy>
                  <allow-http-request-headers-from domain="*" headers="*"/>
                  <strong>
                  <allow-http-request-headers-from domain="*" headers="SOAPAction" />
                  </strong>
                  <allow-https-request-headers-from domain="*" headers="*"/>
                  <strong>
                  <allow-https-request-headers-from domain="*" headers="SOAPAction" />
                  </strong>
                  </cross-domain-policy>

                  Where *should* I put it?

                  .45 ACP - because shooting twice is just silly
                  -----
                  "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
                  -----
                  "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

                  I Offline
                  I Offline
                  Ian McCaul
                  wrote on last edited by
                  #27

                  I thought the crossdomain xml files had to be at the root of the site?

                  R 1 Reply Last reply
                  0
                  • I Ian McCaul

                    I thought the crossdomain xml files had to be at the root of the site?

                    R Online
                    R Online
                    realJSOP
                    wrote on last edited by
                    #28

                    I had it there, and in the silverlight app's folder (just in case). It didn't seem to make a difference.

                    .45 ACP - because shooting twice is just silly
                    -----
                    "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
                    -----
                    "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

                    1 Reply Last reply
                    0
                    • R realJSOP

                      Well, I went ahead and made that change, and it still gives me the same exception. :/

                      .45 ACP - because shooting twice is just silly
                      -----
                      "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
                      -----
                      "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

                      P Offline
                      P Offline
                      Pete OHanlon
                      wrote on last edited by
                      #29

                      I'd offer to test it for you but I'm running SL4 now.

                      "WPF has many lovers. It's a veritable porn star!" - Josh Smith

                      As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

                      My blog | My articles | MoXAML PowerToys | Onyx

                      R 1 Reply Last reply
                      0
                      • P Pete OHanlon

                        I'd offer to test it for you but I'm running SL4 now.

                        "WPF has many lovers. It's a veritable porn star!" - Josh Smith

                        As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

                        My blog | My articles | MoXAML PowerToys | Onyx

                        R Online
                        R Online
                        realJSOP
                        wrote on last edited by
                        #30

                        I saw a comment on the web that stated moving to SL4 fixes this problem. I don't have that option. I'm going to try putting the SL app on the same server as the service and seeing if that will fix it. EDIT ======== Nope. In fact in some ways, it made it worse...

                        .45 ACP - because shooting twice is just silly
                        -----
                        "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
                        -----
                        "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

                        modified on Wednesday, June 9, 2010 2:59 PM

                        P 1 Reply Last reply
                        0
                        • R realJSOP

                          I saw a comment on the web that stated moving to SL4 fixes this problem. I don't have that option. I'm going to try putting the SL app on the same server as the service and seeing if that will fix it. EDIT ======== Nope. In fact in some ways, it made it worse...

                          .45 ACP - because shooting twice is just silly
                          -----
                          "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
                          -----
                          "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

                          modified on Wednesday, June 9, 2010 2:59 PM

                          P Offline
                          P Offline
                          Pete OHanlon
                          wrote on last edited by
                          #31

                          What happens if you drop it out of https into http?

                          "WPF has many lovers. It's a veritable porn star!" - Josh Smith

                          As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

                          My blog | My articles | MoXAML PowerToys | Onyx

                          R 1 Reply Last reply
                          0
                          • P Pete OHanlon

                            What happens if you drop it out of https into http?

                            "WPF has many lovers. It's a veritable porn star!" - Josh Smith

                            As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

                            My blog | My articles | MoXAML PowerToys | Onyx

                            R Online
                            R Online
                            realJSOP
                            wrote on last edited by
                            #32

                            I can't. It all has to stay https (DoD network).

                            .45 ACP - because shooting twice is just silly
                            -----
                            "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
                            -----
                            "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

                            P 1 Reply Last reply
                            0
                            • R realJSOP

                              I can't. It all has to stay https (DoD network).

                              .45 ACP - because shooting twice is just silly
                              -----
                              "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
                              -----
                              "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

                              P Offline
                              P Offline
                              Pete OHanlon
                              wrote on last edited by
                              #33

                              Even for testing? Is there not an internal test rig that could be used for this?

                              "WPF has many lovers. It's a veritable porn star!" - Josh Smith

                              As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

                              My blog | My articles | MoXAML PowerToys | Onyx

                              R 1 Reply Last reply
                              0
                              • P Pete OHanlon

                                Even for testing? Is there not an internal test rig that could be used for this?

                                "WPF has many lovers. It's a veritable porn star!" - Josh Smith

                                As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

                                My blog | My articles | MoXAML PowerToys | Onyx

                                R Online
                                R Online
                                realJSOP
                                wrote on last edited by
                                #34

                                Unfortunately no. I do know for a fact that the app/web service work fine on my dev box. However, we haven't been able to get it to work when deployed. Because we're on a DoD network, it all has to be through https.

                                .45 ACP - because shooting twice is just silly
                                -----
                                "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
                                -----
                                "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

                                1 Reply Last reply
                                0
                                • R realJSOP

                                  When I call a method in a WCF web service from a silverlight app, I get this: An exception occurred during the operation, making the result invalid. Check InnerException for exception details. at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary() at FMDashboard2.FMDashSvc3Ref.GetMetricDataCompletedEventArgs.get_Result() at FMDashboard2.Objects.DataRetrieval.service_GetMetricDataCompleted(Object sender, GetMetricDataCompletedEventArgs e)
                                  Calling webService.OpenAsync() succeeds, but I can't call a method (which happens to be the one and only method in the service).

                                  .45 ACP - because shooting twice is just silly
                                  -----
                                  "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
                                  -----
                                  "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

                                  D Offline
                                  D Offline
                                  dan sh
                                  wrote on last edited by
                                  #35

                                  Were you able to resolve the problem? How do you solved it?

                                  1 Reply Last reply
                                  0
                                  Reply
                                  • Reply as topic
                                  Log in to reply
                                  • Oldest to Newest
                                  • Newest to Oldest
                                  • Most Votes


                                  • Login

                                  • Don't have an account? Register

                                  • Login or register to search.
                                  • First post
                                    Last post
                                  0
                                  • Categories
                                  • Recent
                                  • Tags
                                  • Popular
                                  • World
                                  • Users
                                  • Groups