Jump to content

Connecting to a .NET Web Service with Axis

- - - - -

  • Please log in to reply
2 replies to this topic

#1
sam_coder

sam_coder

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 372 posts
Hey Guys,

Some of you may know me as a .NET guy. I'm a little confused as to how I can properly connect to a .NET ASMX (web method) service, using Axis.

I used the designer in Eclipse, to create the proxy code. (By this I mean that I added a Web Service Client to the project, and in the designer, I set the service definition to http://address/to/service.asmx?wsdl)

A prompt came up with my username and password, which I entered. And it generated all the proxy code for me.

So....

When I try calling the service, for example:

Vod.Oss.TV2.Microsoft.OssVodBranchWSSoap service = new Vod.Oss.TV2.Microsoft.OssVodBranchWSSoapProxy();


try {

	AssetInfo[] assets = service.getAllAssetsDeployed();

	for ( AssetInfo info : assets ) {

		System.out.println(info.getAssetName());

	}

} catch (RemoteException e) {

	e.printStackTrace();

}


So when the serviec is called, i get a 401 exception. The user credentials are not being handed out as I wold have expected.

Anyone know how to make that happen?

Thanks!

#2
ZekeDragon

ZekeDragon

    Writes binary right handed and hex left handed

  • Moderators
  • 2,103 posts
I've never heard of the OssVodBranchWSSoap object and neither has Google, nor the AssetInfo object. None of these are in the Axis Docs. I can't tell you what went wrong or how to go about making what you want to happen happen without relevant source of these objects (such as the getAllAssetsDeployed method). I cannot render any assistance until I know a little bit more about what you're trying to do and a bit more of the relevant code you've written to try and do it.
Wow I changed my sig!

#3
sam_coder

sam_coder

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 372 posts
Ah, yes, that's because these methods were generated by AXIS when I handed it the WSDL. So the definitions for them are actually in the WSDL.

The whole point of course, is to use AXIS to bind to the Mediaroom web services mentioned here.

I do appreciate your feedback though.

What if I asked the question a different way. If you had a SOAP service that you wanted to talk to, with AXIS, how would you approach it? I don't need specific examples that compile or anything, but I am very new to java, so I may just be approaching this wrong.

Like would I be better off just creating a web request, and generating the Soap Request, and PUTing it to the service endpoint? Then using something like SAX to parse the Soap response?

I was just trying to make my life as easy as possible. =)


Anyways, thanks again




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users