0

do you have any idea about this type of exception "System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> Data at the root level is invalid. Line 1, position 1."

I have receveided this exception when I tried to call the method "GetTermsets" using the web service "taxonomyclientservice.asmx"

Here is the portion of my code:

Dim ts As New TaxonomyService.Taxonomywebservice
    ts.UseDefaultCredentials = True
    ts.Url = SiteUrl + "/_vti_bin/taxonomyclientservice.asmx"
    Dim timestamp As String
    timestamp = String.Empty

    Try

        termsetXML = ts.GetTermSets(sspId, termSetId, 1033, DateTime.Now.ToUniversalTime().Ticks.ToString, 0, timestamp)
        Console.WriteLine("This is the XMLstring that contain all the temrs of the term set : {0}", termsetXML)

        Return termsetXML
    Catch ex As Exception
        Debug.WriteLine(ex)
    End Try

The values of sspId and termSetId are of String type and they get values from an other method that I tested and it is working so well.

Unfortunatally, there no programmer in my team to help in such situationI

Thanks so much!

1 Answer 1

1

You have probably found the solution by now, but just in case someone else has the same problem: You should include the tags with the parameters you send to the taxonomywebservice.GetTermSets function.

So, just add your own values for [YourTermStoreId] and [YourTermSetId] and it should do the job.

Here's a code sample:

Dim oldtimestamp As String = "<timeStamp>633992461437070000</timeStamp>"
Dim clientVersion As String = "<version>3</version>"
Dim termStoreIds As String = "<termStoreId>" & [YourTermStoreId] & "</termStoreId>"
Dim termSetIds As String = "<termSetId>" & [YourTermSetId] & "</termSetId>"
Dim timeStamp As String = Nothing

termsetXML = ts.GetTermSets(
                            termStoreIds,
                            termSetIds,
                            lcId,
                            oldtimestamp,
                            clientVersion,
                            timeStamp
                           )
1
  • The solution is I should wrap every parameter in my function with XML
    – imen
    Apr 12, 2012 at 19:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.