locked
Response is not well formed XML error RRS feed

  • Question

  • I've created a web proxy class in C# for the PStores.asp web service methods.

     

    When I try to use one of the methods, ClearCache for example, I get the error "Response is not well-formed XML" within the proxy class.


    Here is the code I am using to call the method:

    Code Block

    string result;

    PStore myPStore = new PStore();

    myPStore.Credentials = System.Net.CredentialCache.DefaultCredentials;

    result = myPStore.ClearCache();

     

     

    Am I setting this up correctly?

    Wednesday, November 21, 2007 8:09 PM

Answers

  •  

    Hi Kory.

     

    Sorry to be the bearer of bad news, but your code worked flawlessly on my machine.  Just opened the project, hit the Run button and everything worked.  Got the little pop up box that said, 'SUCCESS'.

     

    To me it looks like all of your settings are correct.  The first thing I would do is make sure that when you navigate to the following URL:

     

    http://localhost/pas/pstore.asp?WSDL

     

    You get all of the definitions for the methods in the web service.  I can put that directly into my IE browser and get the whole thing.  If you don't, then there may be a problem with how your website is set up.  I'll try to look into it a bit more, but I can't seem to find anything out of the ordinary when I run it on my machine.

     

    TJ Nelson

    Tuesday, November 27, 2007 9:43 PM

All replies

  • Hi Kory.

     

    I believe that some changes were made to this file for our 6.3 release from 6.2.  However, I have not had a chance to test it and see if I can reproduce your behavior.  Give me some time to test it out and I will let you know the results.  Thanks.

     

    TJ Nelson

     

    Monday, November 26, 2007 4:57 PM
  • Thanks TJ. I look forward to seeing what you discover.


    -Kory

    Monday, November 26, 2007 6:09 PM
  • TJ-

     

    I've also tried the COM libraries in .NET using the interops.

    Code Block
     

     

                 PClient2 MyClient = new PClient2();
                 MyClient.Login("localhost/pas", "INT\\skistadk", "xxxxxx");

     

     

    When I run this code, I get the error on the login "XML document must have a top level element".  Could this be related to the previous error with the web service?  I have applied the hotfix 2209 on the server, which doesn't seem to fix anything.

     

    Also, I see a method called "SecurityLogin" but no reference of it in the SDK documentation.  Is the documentation complete?

     

    Thanks

     

    -Kory

    Tuesday, November 27, 2007 5:30 PM
  • Hi Kory.

     

    I was finally able to get this working in a C# Windows Application using your original code and some help from one of our internal developers.  I created a Web Reference to the PStore WSDL and added a button to a form.  I just put your ClearCache code in the onclick for the button.  Now initially I was running into all kinds of URI errors and such.  Once I got past those I kept getting bad SOAP errors.  There seems to be a problem when the Web Reference is created that it doesn't put in everything that is needed.

     

    I had to go into the Project Properties and then click on the 'Settings' tab.  There I found my Web Reference and in the 'Value' field all that was there was 'PStore.asp'.  I had to change this to 'http://localhost/pas/pstore.asp'.  Once I made that change and saved the settings, everything started working great. I got back the 'SUCCESS' that I expected from the ClearCache method and everything.

     

    I would recommend starting from here, getting it working, and then working towards your Web Proxy.  I will note that I did this on a machine with PAS hotfix 6.3.2213.  That hotfix is crucial to have installed on your system because of some important fixes that were made.  I would recommend installing that and then doing your testing.  You can find it at Microsoft Downloads and searching for 'ProClarity'.

     

    hth

     

    TJ Nelson

     

    Tuesday, November 27, 2007 5:42 PM
  • I've applied hotfix 2213 and tried your suggestion, with no luck.  Can I e-mail you my sample project (just a winform with a single button) so you see if it works for you?

    Tuesday, November 27, 2007 6:34 PM
  • Sure.  Go ahead and sent it to this email address:

     

    tj_nelson_40@hotmail.com_NOSPAM

     

    Just remove the _NOSPAM at the end.  That's my spam address, but I'll check it for your project.

     

    TJ Nelson

    Tuesday, November 27, 2007 6:42 PM
  • Great.  I've sent you the sample project.  I hate to say this, but I hope it breaks for you too Smile

    Tuesday, November 27, 2007 7:19 PM
  •  

    Hi Kory.

     

    Sorry to be the bearer of bad news, but your code worked flawlessly on my machine.  Just opened the project, hit the Run button and everything worked.  Got the little pop up box that said, 'SUCCESS'.

     

    To me it looks like all of your settings are correct.  The first thing I would do is make sure that when you navigate to the following URL:

     

    http://localhost/pas/pstore.asp?WSDL

     

    You get all of the definitions for the methods in the web service.  I can put that directly into my IE browser and get the whole thing.  If you don't, then there may be a problem with how your website is set up.  I'll try to look into it a bit more, but I can't seem to find anything out of the ordinary when I run it on my machine.

     

    TJ Nelson

    Tuesday, November 27, 2007 9:43 PM
  •  KoryS wrote:

    I've created a web proxy class in C# for the PStores.asp web service methods.

     

    When I try to use one of the methods, ClearCache for example, I get the error "Response is not well-formed XML" within the proxy class.


    Here is the code I am using to call the method:

    Code Block

    string result;

    PStore myPStore = new PStore();

    myPStore.Credentials = System.Net.CredentialCache.DefaultCredentials;

    result = myPStore.ClearCache();

     

     

    Am I setting this up correctly?

     

    I'm sure you have found a way around this problem, but I will post this anyway: I recently received this error error when attempting to use a .NET proxy to consume a web service. It turned out that the web service I was attempting to access was using MTOM to send responses. MTOM SOAP messages are in xop format which cannot be read by the standard .NET SOAP client.

     

    The solution is to download Microsoft WSE 3.0 and create your soap clients using the Wse3Wsdl.exe executable. You will have to set the RequireMTOM property on your proxy class to true for your calls to these web services to work.

    You will also have to have your project reference the Microsoft.Web.Services3 assembly.
    Thursday, April 10, 2008 1:49 PM