Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

AXL wsdl and wsdl.exe in .NET: Help!

Hi all!

I'm trying to get a VB proxy class to access AXL soap in CCM 4.1(3)sr1. I knew there were a lot problems with this, but I saw that there's people that could reach this goal.

My first step was to put all four files in the same wsdl file, in order to avoid import errors that appears when trying to pass wsdl parser. After that, I modified some variables declarations to make the new file "deterministic" (Microsoft parser doesn't support non-deterministic" declarations). At the end, the new file contains only two namespaces: the root xsd and the "custom declarations" namespace, called tns. In order to achieve the best performance, I followed the wsdl file for webdialer soap as an example. So I defined the "declaration", "messages", "operations", etc tags in a new namespace called "wsdl". But, if I put these definitions into the wsdl namespace and the schema into the tns namespace, the "compiler" throws an error: the compiler cannot derivate the elements defined in the tns namespace to the wsdl namespace. Why? I have no idea! But, my next stage was to define all elements and definitions, messages, operations and so on into the same namespace. I solved the problem with derivation but:

a) If tis common namespace is tns, then the compiler don't recognize wsdl tags (operations, messages and so on) and throws an error about "unable to get wsdl optional tags";

b) if the common namespace is WSDL or nothing, then the compiler don't find the operations and it generates a vb file but with no methods in it.

I surrender. I don't know how to go on. If one of you is an XML WSDL expert and knows how to solve this problem, I attach the wsdl file if someone wants to make more tests. But, please, if someone reach the solution, just tell us!

Thanks a lot.

66 REPLIES

Re: AXL wsdl and wsdl.exe in .NET: Help!

Can I count on you to bring this up with your cisco rep? The more people complain about this deplorable situation, the better our chances that Cisco finally steps up to the plate and does something. Other PBX manufacturers have gotten this right on the first try and AXL is not exactly new anymore.

New Member

Re: AXL wsdl and wsdl.exe in .NET: Help!

Of course you can.

I claim for a solution every time I meet with any kind of Cisco representatives.

I've heard that CCM 5 has AXL soap too, but does anybody knows if yhis new version of the file has the same problem? Maybe now, in beta - phase, we have any opportunity to change that.

Regards.

New Member

Re: AXL wsdl and wsdl.exe in .NET: Help!

Try this one, I'm using it with a vb.net version of the pushtophone app

New Member

Re: AXL wsdl and wsdl.exe in .NET: Help!

I think the axlsoap_mod.xsd file you posted was truncated. Did you merge the axl.xsd into your axlsoap_mod.xsd as well, or did you keep it separate since it is a different namespace.

I've managed to condense it to the wsdl, axlsoap.xsd, and axl.xsd files. They all check out in xmlspy, stylus, and oxygen, but I can't get vb.net 2003 or 2005 to load the wsdl as a web service reference. I think it has something to do w/ the way the schema is expected in the .net wsdl.exe. If you change the addphone element to just include the element itself and put the type in a complex type sequence entry below it, the wsdl.exe process will move forward one more entry and then complain about the translation pattern conflicting with the dialplan entry. Anyway, I'm about fed up with this. I'll be in San Jose for the partner voice conference in two weeks and they'll be hearing about this for sure.

New Member

Re: AXL wsdl and wsdl.exe in .NET: Help!

I merged them into the same namespace.

Your correct, the axlsoap_mod.xsd was truncated.

I'm giving it a new try...

New Member

Re: AXL wsdl and wsdl.exe in .NET: Help!

At first sight, it works!

I will test it in a program and will post news.

Thank you very much.

New Member

Re: AXL wsdl and wsdl.exe in .NET: Help!

I would appreciate some feedback, thanks.

Worked with the bastard for 3 weeks before I got it to play along

New Member

Re: AXL wsdl and wsdl.exe in .NET: Help!

I was more suprised you don't have like 100 points on this :)

New Member

Re: AXL wsdl and wsdl.exe in .NET: Help!

axlsoap_mod.xsd

New Member

Re: AXL wsdl and wsdl.exe in .NET: Help!

What's this latest post?

New Member

Re: AXL wsdl and wsdl.exe in .NET: Help!

Dear All.

I'm beginner.

I downloaded the 2 modified files and i parked them in Call Manager. Now i'm able to create proxy class in my VS .net 2005.

Well.. now i'd like to know how to use these classes..

I see many clases have no costructor... So how can i instance them?

For Example.. i'd like to retrive information about a single Phone. How can i build the request (GetPhoneReq) and get the response?

Thank you all!

Marco

New Member

Re: AXL wsdl and wsdl.exe in .NET: Help!

you instantiate the AXLAPIService class, and invoke the getPhone method on it (pass in the getPhoneReq object, or whatever it is that it takes)

New Member

Re: AXL wsdl and wsdl.exe in .NET: Help!

Thank you very much!

I was able to do what you wrote me! But.. i still have troubles.

Just a question: The only things i have to do is to copy the 2 modified files in directory c:\CiscoWebs\API\AXL\V1 of my CallManager?

No other steps ?

Thank you very much

Marco

New Member

Re: AXL wsdl and wsdl.exe in .NET: Help!

You shouldn't have to modify anything on your CallManager.

You should make the web request from your client machine... you will need to provide network credentials, and override the Url of the AXLAPIService class.

So for example,

string url = "http://10.10.10.10/CCMApi/AXL/V1/SOAPISAPI.dll";

string username = "Administrator";

string password = "Cisco";

AXLAPIService service = new AXLAPIService(url, username, password);

Then, in the AXLAPIService class, you will need to modify it directly to take those 3 string arguments

and modify this. to take the new info:

this.Url = url;

this.service.Credentials = new NetworkCredentials(username, password);

New Member

Re: AXL wsdl and wsdl.exe in .NET: Help!

Thank you very much!

I wrote thies code but i still have problems:

----------------

XLAPIccm.AXLAPIService Service = new AXLAPIService();

Service.UseDefaultCredentials = false;

Service.Credentials = new System.Net.NetworkCredential(this.txIDuser.Text, this.txPwdUser.Text);

AXLAPIccm.GetPhoneReq PhReq = new GetPhoneReq();

PhReq.ItemElementName = ItemChoiceType8.phoneName;

PhReq.Item = "SEP000xxxxxxxxx";

AXLAPIccm.GetPhoneRes PhRes;

AXLAPIccm.GetPhoneResReturn RetPhone = null;

PhRes = Service.getPhone(PhReq);

RetPhone = PhRes.@return;

-------------------------

Well.. when this code run, it get Exception when uses the method "Service.getPhone" and says this message:

---

Unable to automatically step into the server. Connecting to the server machine 'xx.xx.xx.xx' failed. Windows file sharing has been configured so that you will connect to remote computer using a different user name. This is incompatible whit remote debugging. Please see Help for assistance.

---

I really don't know what's wrong.

Please help me if you can.

Thanks

New Member

Re: AXL wsdl and wsdl.exe in .NET: Help!

Well.. i get this error because the CCM doesn't allow me to debug step by step the method.. so this could be normal.

The problem is that the method .getPhone(PhReq) returns NULL!!! And the Name of phone (SEP000...) i'm sure it really exists!

NB. If i swithc the propriety ItemElementName in phoneId instead of phoneName i get the Exception who says that the entered Id is not a GUID.

SO i realize that the service is running (i sniffed data packets with Etherial and i saw that the complete response about the phone i asked) but i cant understand why the method returns null!

Any hints?

Thanks

New Member

Re: AXL wsdl and wsdl.exe in .NET: Help!

There is a bit of a disjoint between the returned namespace and the namespace .NET is expecting.

Run ethereal and use phoneName, and take notice the namespace on the response object XML (assuming you are getting good getPhoneResponse XML back)

Then open your generated WSDL code--and notice the namespace defined for the getPhoneResponse class--if it's different, then this is the cause of the problem. .NET is expecting something different in terms of returned namespace, and so isn't deserializing anything, so u get null.

You can fix it by changing the namespace on that getPhoneResponse class.

(this is all from memory so ...)

New Member

Re: AXL wsdl and wsdl.exe in .NET: Help!

Thank you very much!

This is a big help for me..

I'm reading captured packets from Etherial.. and i see the GetPhone Response... but i really don't know where i can find the correct namespace.....

Maybe is it in the SOAP Envelope?

Thank you very very much

New Member

Re: AXL wsdl and wsdl.exe in .NET: Help!

There is a namespace in your ethereal trace that looks very similiar to

http://www.cisco.com/AXL/API/1.0

or

http://www.cisco.com/AXL/1.0

Once you locate it,

compare the namespace located on this classes in your code:

getPhoneResponse

GetPhoneRes

GetPhoneResReturn

XIPPhone (I think this is the problem one--it might say http://www.cisco.com/AXL/1.0 in code, but should say http://www.cisco.com/AXL/API/1.0... change it and rebuild and rerun)

New Member

Re: AXL wsdl and wsdl.exe in .NET: Help!

Excuse me.. maybe i'm stupid.. but where i should compare the "namespace located in my code"?

Maybe i should not call my web reference "XLAPIccm"??

Another note:

If i try to get a NOT EXISTING PhoneName (Ex: SEP123456789 and this doesn't exists in my CCM) the service notifies me that the entered Hostname is not correct ("Item not valid: The specified phone was not found").

So i think that the system is ok.. but it can't deserialize only the right response.

I'm desperate...

Thanks

New Member

Re: AXL wsdl and wsdl.exe in .NET: Help!

Open up the code generated by wsdl.exe.

Find the 4 class definitions I mentioned in the previous post, and look at the [] attribute decorated on the top of each class.

Each class has a namespace defined in the attribute.

New Member

Re: AXL wsdl and wsdl.exe in .NET: Help!

I did what you say... changing the namespace form

http://www.cisco.com/AXL/1.0

to

http://www.cisco.com/AXL/API/1.0

but the objesct is still null.

I tried this code too (using method listDeviceByNameAndClass):

------------------------

AXLccm.AXLAPIService Service = new AXLAPIService();

Service.UseDefaultCredentials = false;

Service.Credentials = new System.Net.NetworkCredential(

this.txIDuser.Text,

this.txPwdUser.Text);

AXLccm.ListDeviceByNameAndClassReq LstReq = new ListDeviceByNameAndClassReq();

LstReq.@class = XClass.Phone;

LstReq.searchString = this.txPhoneHOSTNAME.Text;

AXLccm.ListDeviceRes LstRes = new ListDeviceRes();

LstRes = Service.listDeviceByNameAndClass(LstReq);

AXLccm.ListDeviceResDevice[] LstDvcRes;

LstDvcRes = LstRes.@return;

------------------------

If i try to search with this my phone (Passing SEPxxxxxxx) IT WORKS!!!! So the deserializer is ok!

This should ensure me the namespace is not wrong?

Maybe the 2 modified files (.wsdl and .xsd) are not correct for my VS.net 2005?

Still desperate...

Thanks

Marco

New Member

Re: AXL wsdl and wsdl.exe in .NET: Help!

Can you post your generated code?

New Member

Re: AXL wsdl and wsdl.exe in .NET: Help!

This should work...

AXLAPIService axl = new AXLAPIService();

axl.Credentials = new NetworkCredential(callManagerUserId, callManagerPassword);

axl.Url = "http://" + callManAddress + "/CCMApi/AXL/V1/SOAPISAPI.dll";

ListDeviceByNameAndClassReq phoneByName =new ListDeviceByNameAndClassReq();

phoneByName.searchString = "SEP%";

ListDeviceResDevice[] phones= axl.listDeviceByNameAndClass(phoneByName).@return;

foreach (ListDeviceResDevice phone in phones)

{

System.Diagnostics.Debug.WriteLine(phone.product);

System.Diagnostics.Debug.WriteLine(phone.uuid);

System.Diagnostics.Debug.WriteLine(phone.model);

System.Diagnostics.Debug.WriteLine(phone.name);

}

New Member

Re: AXL wsdl and wsdl.exe in .NET: Help!

YES!

This really works!

Thank you very much!!

But the problem now is in getPhone Method again.

This is my code:

-----------

AXLccm.AXLAPIService Service = new AXLAPIService();

Service.Credentials = new System.Net.NetworkCredential(IDuser, PwdUser);

AXLccm.GetPhoneReq PhReq = new GetPhoneReq();

PhReq.ItemElementName = ItemChoiceType8.phoneName;

PhReq.Item = theNameOfMyPhone;

AXLccm.GetPhoneResReturn RetPhone = Service.getPhone(PhReq).@return;

-----------

Well.. i get a nullException in the proprierty "Service.getPhone(PhReq).@return" even if i see with Etherial that the SOAP rensponse flow to my IP address.

Can you help me?

Thanks

New Member

Re: AXL wsdl and wsdl.exe in .NET: Help!

Yepp, I can help you...

AXLAPIService Service = new AXLAPIService();

Service.Credentials = new System.Net.NetworkCredential(callManagerUserId, callManagerPassword);

GetPhoneReq PhReq = new GetPhoneReq();

PhReq.ItemElementName = ItemChoiceType35.phoneName;

PhReq.Item = "SEP000AF408A28B";

GetPhoneResReturn RetPhone = Service.getPhone(PhReq).@return;

Re: AXL wsdl and wsdl.exe in .NET: Help!

I think what xmlequals meant to say is that you need to have a look into the stubs that visual studio generates for you. If you look at the deserialization code, and compare what your code is looking for with what you're effectively getting, you should be able to locate the cause of your problem. I know that this kind of hacking is normally not required, but keep in mind that Cisco doesn't deliver a working WSDL, which is the root cause of this mess.

New Member

Re: AXL wsdl and wsdl.exe in .NET: Help!

Thank you very much ciscomummiez, but the difference in the code you posted is only in ItemChoiceType35 instead of my ItemChoiceType8.

Well if i substitute ItemChoiceType8 with ItemChoiceType35 the code gets compile error because is not right type..

I think there is something wrong.. do you agree?

New Member

Re: AXL wsdl and wsdl.exe in .NET: Help!

Its working fine here..

Did you do any changes to axlapi_mod.wsdl or axlsoap_mod.xsd ?

Cause according to the definition and codehint from VS the ItemElementName should be ItemChoiceType35.

Could you try the wdsl and xsd I'm attaching for this code.

1371
Views
25
Helpful
66
Replies