You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Jake Goulding <go...@vivisimo.com> on 2006/10/04 22:30:35 UTC

[axis2] lost when creating client

Hey all.

I am quite new to web services, and so I have a few questions. I am 
implementing a client to Microsoft Sharepoint. I just want to get some 
sample code to start with and play around. There is a very simple method 
listed in the Sharepoint WSDL (attached): GetListsCollection.

I use the WSDL2Java.sh tool provided with the nightlies:
WSDL2Java.sh -s -p com.vivisimo.connector.sharepoint -uri Lists-wsdl.xml

This creates the ListsStub.java file, which I can compile and JAR fine 
(sharepoint.jar).

Now I make a test program (attached), and call the function:

ListsStub.GetListCollectionResponse res =
            lists.GetListCollection(new ListsStub.GetListCollection());

But I am at a loss for what to do from here. This particular call 
returns a bunch of XML. If you look at the WSDL, Microsoft kinda was 
lazy with their WSDL, and so it can be any particular elements. All I 
want to do is get that XML and print it out. Any help would be 
appreciated!!!

Thanks!

-- 

JAKE GOULDING
Software Engineer
goulding@vivisimo.com

Viví­simo [Search Done Right™]
1710 Murray Avenue
Pittsburgh, PA 15217 USA
tel: +1.412.422.2499 x105
fax: +1.412.422.2495
vivisimo.com      clusty.com



Re: [axis2] lost when creating client

Posted by Jake Goulding <go...@vivisimo.com>.
I included the WSDL with the first email. It's on another computer or  
else I'd resend it...

I seem to be able to execute the service (at least the function call  
succeeds). I am using the nightlies because Sharepoint requires NTLM  
authentication.

I basically need to be able to get to the actual result returned from  
the call.

Thanks!

On Oct 4, 2006, at 8:12 PM, robert lazarski wrote:

> The code looks reasonable - try posting the wsdl since its a sample
> and maybe we could help you with the next step. Can you execute the
> service ? Are you using the nightlies until 1.1 comes out ?
>
> Robert
>
> On 10/4/06, Jake Goulding <go...@vivisimo.com> wrote:
>> Hey all.
>>
>> I am quite new to web services, and so I have a few questions. I am
>> implementing a client to Microsoft Sharepoint. I just want to get  
>> some
>> sample code to start with and play around. There is a very simple  
>> method
>> listed in the Sharepoint WSDL (attached): GetListsCollection.
>>
>> I use the WSDL2Java.sh tool provided with the nightlies:
>> WSDL2Java.sh -s -p com.vivisimo.connector.sharepoint -uri Lists- 
>> wsdl.xml
>>
>> This creates the ListsStub.java file, which I can compile and JAR  
>> fine
>> (sharepoint.jar).
>>
>> Now I make a test program (attached), and call the function:
>>
>> ListsStub.GetListCollectionResponse res =
>>             lists.GetListCollection(new ListsStub.GetListCollection 
>> ());
>>
>> But I am at a loss for what to do from here. This particular call
>> returns a bunch of XML. If you look at the WSDL, Microsoft kinda was
>> lazy with their WSDL, and so it can be any particular elements. All I
>> want to do is get that XML and print it out. Any help would be
>> appreciated!!!
>>
>> Thanks!
>>
>> --
>>
>> JAKE GOULDING
>> Software Engineer
>> goulding@vivisimo.com
>>
>> Viví simo [Search Done Right™]
>> 1710 Murray Avenue
>> Pittsburgh, PA 15217 USA
>> tel: +1.412.422.2499 x105
>> fax: +1.412.422.2495
>> vivisimo.com      clusty.com
>>
>>
>>
>>
>> import org.apache.axis2.client.*;
>> import org.apache.axis2.transport.http.*;
>> import com.vivisimo.connector.sharepoint.*;
>>
>> public class Test
>> {
>>     public static void main(String args[])
>>         throws Exception
>>     {
>>         ListsStub lists =
>>             new ListsStub("http://192.168.0.27:81/_vti_bin/ 
>> Lists.asmx");
>>         ServiceClient sc = lists._getServiceClient();
>>
>>         HttpTransportProperties.Authenticator authentication =
>>             new HttpTransportProperties.Authenticator();
>>
>>         authentication.setUsername("user");
>>         authentication.setPassword("pass");
>>         authentication.setDomain("domain");
>>         authentication.setHost("192.168.0.27");
>>
>>         sc.getOptions().setProperty(
>>                             HTTPConstants.AUTHENTICATE,
>>                             authentication
>>                         );
>>
>>         ListsStub.GetListCollectionResponse res =
>>             lists.GetListCollection(new ListsStub.GetListCollection 
>> ());
>>     }
>> }
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: [axis2] lost when creating client

Posted by robert lazarski <ro...@gmail.com>.
The code looks reasonable - try posting the wsdl since its a sample
and maybe we could help you with the next step. Can you execute the
service ? Are you using the nightlies until 1.1 comes out ?

Robert

On 10/4/06, Jake Goulding <go...@vivisimo.com> wrote:
> Hey all.
>
> I am quite new to web services, and so I have a few questions. I am
> implementing a client to Microsoft Sharepoint. I just want to get some
> sample code to start with and play around. There is a very simple method
> listed in the Sharepoint WSDL (attached): GetListsCollection.
>
> I use the WSDL2Java.sh tool provided with the nightlies:
> WSDL2Java.sh -s -p com.vivisimo.connector.sharepoint -uri Lists-wsdl.xml
>
> This creates the ListsStub.java file, which I can compile and JAR fine
> (sharepoint.jar).
>
> Now I make a test program (attached), and call the function:
>
> ListsStub.GetListCollectionResponse res =
>             lists.GetListCollection(new ListsStub.GetListCollection());
>
> But I am at a loss for what to do from here. This particular call
> returns a bunch of XML. If you look at the WSDL, Microsoft kinda was
> lazy with their WSDL, and so it can be any particular elements. All I
> want to do is get that XML and print it out. Any help would be
> appreciated!!!
>
> Thanks!
>
> --
>
> JAKE GOULDING
> Software Engineer
> goulding@vivisimo.com
>
> Viví­simo [Search Done Right™]
> 1710 Murray Avenue
> Pittsburgh, PA 15217 USA
> tel: +1.412.422.2499 x105
> fax: +1.412.422.2495
> vivisimo.com      clusty.com
>
>
>
>
> import org.apache.axis2.client.*;
> import org.apache.axis2.transport.http.*;
> import com.vivisimo.connector.sharepoint.*;
>
> public class Test
> {
>     public static void main(String args[])
>         throws Exception
>     {
>         ListsStub lists =
>             new ListsStub("http://192.168.0.27:81/_vti_bin/Lists.asmx");
>         ServiceClient sc = lists._getServiceClient();
>
>         HttpTransportProperties.Authenticator authentication =
>             new HttpTransportProperties.Authenticator();
>
>         authentication.setUsername("user");
>         authentication.setPassword("pass");
>         authentication.setDomain("domain");
>         authentication.setHost("192.168.0.27");
>
>         sc.getOptions().setProperty(
>                             HTTPConstants.AUTHENTICATE,
>                             authentication
>                         );
>
>         ListsStub.GetListCollectionResponse res =
>             lists.GetListCollection(new ListsStub.GetListCollection());
>     }
> }
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org