Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Changing data in Sharepointlist via LWP/JSON - OData.ODataContentTypeException :(

by Anonymous Monk
on May 12, 2014 at 20:35 UTC ( [id://1085833]=note: print w/replies, xml ) Need Help??


in reply to Changing data in Sharepointlist via LWP/JSON - OData.ODataContentTypeException :(

hah, if you ask a bartender for Pepsi, and the bartender says we only have Cocacola, well, there is no way you'll get a Pepsi from that bartender -- stop asking "sharepoint" for Pepsi , it doesn't like it
  • Comment on Re: Changing data in Sharepointlist via LWP/JSON - OData.ODataContentTypeException :(

Replies are listed 'Best First'.
Re^2: Changing data in Sharepointlist via LWP/JSON - OData.ODataContentTypeException :(
by timb (Novice) on May 13, 2014 at 10:13 UTC
    I was hoping for a more professional reply. I have no intention to start a religious war. I don't really like Sharepoint either. But I have to work with it and I'm glad I can use perl.

      Have you looked at what your script sends in a traffic analyzer like Wireshark LWP::Debug (as you're using HTTPS, it's likely easier to dump things at the source side)?

      The error message is highly unclear about whether the Sharepoint server received something with Content-Type: application/json, and could not handle it, or whether it wants ti send something with Content-Type: application/json and your client doesn't offer that in the appropriate way.

      I see that you're setting both, Accept and Content-Type headers, so the next thing would be to make really sure that they actually get sent over the wire.

      Maybe you can find out if the Sharepoint logs point out a better error cause.

      I was hoping for a more professional reply. I have no intention to start a religious war. I don't really like Sharepoint either. But I have to work with it and I'm glad I can use perl.

      Hmm,

      you're asking why some random website is saying its only getting "application/json" when the program you show is sending "application/json;odata=verbose" ...

      the bartending analogy seems apt :)

      Corion brings up a good point about looking outside of perl locally (using wireshark) for interlopers (firewalls), but odds are its a bartending problem

      https://metacpan.org/pod/XML::Compile::SOAP#Supported-servers says Both BEA and SharePoint servers produce illegal SOAP responses! It is a sad story. , who knows, maybe the same goes for sharepoint JSON support (wouldn't be surprised)

      So, my response doesn't seem unprofessional to me, or religious ...

      I didn't even try to roast your fowl for your included test password of sucKmYducK

        Oh yes... I know about those problems with products that don't comply to standards. I remember having a really hard time tying a .net-application to a cold-fusion-site via SOAP a couple of years ago.

        Fortunately Corion could solve my problem. It was no sharepoint-problem after all. Hmmm... but not a perlproblem either, since it was somehow obvious in retrospect.

        Lets settle for me being the bartender, that was too focused on the drinks than on himself ;)

        And for the testpassword: I always post a weird one and wait if someone picks it up. But I can asure you, that I'm aware that sucking ducks is nothing I would do in real live.

      I think the reason you will find very little help on Perlmonks (or you will get unkind responses - I fought back the urge to write one myself) for basically a Microsoft-based question is that you have not 'sold' us onto the idea that the problem you are facing is indeed a Perl problem.

      Over the years there have been thousands of posts that read like this, 'I was using Perl and I now it broke.' What elicits the bad response is not the post nor the problem -- it is the approach. I'm speaking from experience when I say that Microsoft's claim to fame is that they build tools that do everything for you. You don't really have to know how anything works -- their Knowledgebase has examples, sample code, and everything is essentially a black box. Here you are not just interfacing Perl with Sharepoint, you are trying to interface two completely different cultures.

      When I first started learning Perl I was a VB programmer. I was in shock that I actually had to read documentation and solve problems myself. When I started learning how to use Linux I was, again, in shock that everything wasn't clearly spelled out and all in one place. I had to seek out answers to problems from different people and it was important to contribute, even if it was just a bug report.

      You made a comment that the first responder to your post was unprofessional. That exemplifies my point. Why should you expect a professional response to anything on Perlmonks? Here we are, on our own time, providing answers to our peers and people new to the language. This environment is anything but professional. It is not anyone's job to help you with your problems. You have Perlmonks confused with the boys/girls at Redmond.

      I may get downvoted for saying this but I am just going to come out and say it -- unless you spend time trying to grasp what free software/open source is about stop using Perl. Don't use Linux. Give up now; buy Windows 8/9/whatever and reinstall it on that machine. Switch your client to something in .NET and when you run into trouble contact Microsoft support (http://support.microsoft.com/contactus/?ln=en-us).

      That is my professional response.

      Celebrate Intellectual Diversity

        I was under the impression that my question made it clear that I had no idea if the problem was perl- or sharepoint-related. Therefor my cause of action was to post it to perl- and sharepoint-professionals in the hope that someone has dealt with it before.

        Corion reviewed my code and found out that I was using LWP the wrong way - which has now solved my problem. This makes me believe, that I was right in bothering the monks with my question.

        But I have to admit, that I had no idea, that this platform is so much different than others.

        for example: If I post to Stackoverflow people are also answering questions in their free time and they don't see it as a burden to help others out. In addition their replies are polite and professional, which increases my feeling that I'm completely misunderstanding this platform.

        Funny fact: I also started coding Basic before I got to perl. Okay, it was Commodore 64 Basic at first, but later VB for the most time, so I kind of know what you are talking about.

        I'm real sorry, that you had such a hard time learning perl and linux. When I started all I got from my boss was a Camelbook and a Unix-Account. But those man-pages and the book made it much easier than I anticipated.

        Over the years I had to work with many different systems and programming languages - but if possible, I always tried to use my beloved perl in linux, altough this got less and less popular (at least in the company I was working for).

        I don't plan to stop using Windows, Linux, Perl, .net, etc. because I don't think I have to decide for either one. Those systems can coexist, they can interact and they all have their pros and cons. I even think there is a place for apple somewhere... altough I'm not yet sure of that ;)

      A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1085833]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-20 01:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found