Java + Soap

Newsgator Forums
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        


Java + Soap Expand / Collapse
Author
Message
Posted 10/26/2008 7:09:06 AM
Forum Member

Forum Member

Group: Forum Members
Last Login: 10/26/2008 12:05:37 PM
Posts: 1, Visits: 6
Hello.

I'm very new to webservices programming and i've just started to play with your SOAP api.

I found on this forum the following simple piece of code for retrieving the locations list of a user:


LocationWebServiceLocator locator = new LocationWebServiceLocator();
try{

LocationWebServiceSoapStub service = (LocationWebServiceSoapStub) locator.getLocationWebServiceSoap();
service.setUsername("***");
service.setPassword("***");
SOAPHeaderElement NGToken = new SOAPHeaderElement(new PrefixedQName("http://services.newsgator.com/svc/Location.asmx", "NGAPIToken", ""));
MessageElement Token = new MessageElement("","Token");

try {
Token.setObjectValue("****");
NGToken.addChild(Token);
}
catch (java.lang.Throwable t)
{
throw new org.apache.axis.AxisFault ("Caught exception, while adding Token header.", t);
}

service.setHeader(NGToken);

Location[] myLocs = service.getLocations();
for (int i=0; i {
System.out.println((String)myLocs[i].getName() + ": " + (int)myLocs[i].getId());
}

}


Running this i get an error regarding the api product key:

AxisFault
faultCode: {http://www.w3.org/2003/05/soap-envelope}Sender
faultSubcode:
faultString: Value cannot be null.
Parameter name: API Product Key Not Specified
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:Value cannot be null.
Parameter name: API Product Key Not Specified




Does anybody have an idea of what's wrong??

Thanks.
Post #43783
Posted 10/31/2008 10:57:01 AM


NewsGator

NewsGator

Group: NewsGator Staff
Last Login: 6/18/2009 12:37:48 PM
Posts: 24, Visits: 121
Swanz,

I have someone looking at the syntax of your code, but in the mean time, can you email support@newsgator.com and include:   your username, a reference to this thread, and simple "forward to rob" in the message. 

I will double check that your APIToken is setup correctly.

Thanks,

Rob

Post #43905
Posted 5/21/2009 1:38:54 AM
Forum Member

Forum Member

Group: Forum Members
Last Login: 5/21/2009 1:32:07 AM
Posts: 1, Visits: 1
I'm sure your question has long been answered by now but I was just wondering what was the cause of the problem. I find there isn't much better way to learn than to learn from mistakes before or problems. I make plenty of my own but I'm always on the look out for tough situations like this as well.

Cheers,

-Jim

--------------------------------------------------------------------------------------------------------------------------------------
How to Deal with Depression
Post #48720
« Prev Topic | Next Topic »

All times are GMT -7:00, Time now is 10:48pm

Powered By InstantForum.NET v4.1.4 © 2009
Execution: 0.063. 7 queries. Compression Disabled.

NewsGator.com | Support | Developers | Partners | Press | Company
© Copyright 2003-2009  NewsGator Technologies, Inc. All Rights Reserved.
Copyright Information | Privacy Policy | Terms of Service
Microsoft Gold Certified Partner