Search the web
Sign In
New User? Sign Up
ydn-auth · Yahoo! Authenticated Web Services
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Fw: HTTP Transport error : '411' - 'Length Required'; nested excepti   Message List  
Reply | Forward Message #717 of 729 |
 
Hi All,

I'm facing below error during getUserData via axis transport ws.

HTTP Transport error : '411' - 'Length Required'; nested exception is:

this is little snippet of code being error:

// Instantiate the SOAP proxy. Override the default endpoint so the application ID and the WSSID
        // can be added to the URL.
        YmwsStub stub = new YmwsStub("http://mail.yahooapis.com/ws/mail/v1.1/soap?appid=" +
                URLEncoder.encode(appid, "UTF-8") + "&wssid=" + URLEncoder.encode(authManager.getWssid(), "UTF-8"));
        logger.debug("stub: " + stub);

        // Axis2 requires you to jump through some hoops to set a cookie on the SOAP proxy. This is the
        // only way I have found to get this working. Set up a handler that will take care of injecting
        // the cookie into the request.
        HandlerDescription description = new HandlerDescription("CookieHandler");
        description.setHandler(new CookieHandler(authManager.getCookie()));
        PhaseRule rule = new PhaseRule("Security");
        description.setRules(rule);

        // Add the handler description to the outflow module.
        AxisModule module = new AxisModule(new QName("OutFlow"));
        module.setOutFlow(new Flow());
        module.getOutFlow().addHandler(description);

        // Add the outflow module to the Axis configuration.
        stub._getServiceClient().getServiceContext().getConfigurationContext().getAxisConfiguration().addModule(module);
        stub._getServiceClient().getServiceContext().getConfigurationContext().getAxisConfiguration().engageModule(
                new QName("OutFlow"));

        // Axis2 throws Exceptions whenever the server returns a SOAP fault. So wrap your
        // calls in a try/catch block.
        try {
            // GetUserData, pulls user preferences and account settings.
            logger.debug("start retrieving user data ");
            YmwsStub.GetUserData9 getUserData = new YmwsStub.GetUserData9();
            getUserData.setGetUserData(new YmwsStub.GetUserData());
            YmwsStub.GetUserDataResponse userData = stub.GetUserData(getUserData, null).getGetUserDataResponse();
            logger.debug("are you an premium user? " + userData.getData().getUserFeaturePref().getIsPremium());
            System.out.println(String.format("Loaded user data for %1$s",
                    userData.getData().getUserSendPref().getDefaultFromName()));
} catch (AxisFault e) {
            // A SOAP fault was thrown by the service.
            logger.debug("e.getMessage() = " + e.getMessage());
            logger.debug("e " + e.getCause().getMessage());
        }

some body could advice me, what does code tobe made the error?

thanks alot.





Tue Jun 9, 2009 4:47 am

hira.sirojud...
Offline Offline
Send Email Send Email

Forward
Message #717 of 729 |
Expand Messages Author Sort by Date

Hi All, I'm facing below error during getUserData via axis transport ws. HTTP Transport error : '411' - 'Length Required'; nested exception is: this is little...
Hira Sirojudin
hira.sirojud...
Offline Send Email
Jun 15, 2009
9:05 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help