views:

88

answers:

3

HI,

My job was to create a webservice which acted as another webservice we have, so the client doesn't notice the difference. I created my entire webservice and it works fine as I use it and the outputs all are the same. The thing is, I created a clientapplication where I use the old webservice and if I change the url of the webreference to the new service and retry I get an error:

System.Web.Services.Protocols.SoapException: The server did not recognize the HTTP-header SOAPAction

If I look at the differences in the Reference.cs in my two webservices I notice there's a small difference in attributes which is I think the problem.

New service:

[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.3053")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Web.Services.WebServiceBindingAttribute(Name="SprWebServiceSoap", Namespace="http://ws.hl7.trispark.com/")]
    public partial class SprWebService : System.Web.Services.Protocols.SoapHttpClientProtocol {

Old service:

[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.3053")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Web.Services.WebServiceBindingAttribute(Name="SprWebServiceRemoteBinding", Namespace="http://ws.hl7.trispark.com/")]
    public partial class SprWebService : System.Web.Services.Protocols.SoapHttpClientProtocol {

And also the method which is used differs:

New:

[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://ws.hl7.trispark.com/invoke", RequestNamespace="http://ws.hl7.trispark.com/", ResponseNamespace="http://ws.hl7.trispark.com/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public invokeResponse invoke(invoke inv) {

Old:

[System.Web.Services.Protocols.SoapDocumentMethodAttribute("", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)]
        [return: System.Xml.Serialization.XmlElementAttribute("invokeResponse", Namespace="http://ws.hl7.trispark.com/types")]
        public invokeResponse invoke([System.Xml.Serialization.XmlElementAttribute("invoke", Namespace="http://ws.hl7.trispark.com/types")] invoke invoke1) {

First I thought the problem could be that my version was created in vs2008 and the old one in vs2005 so I recreated it in 2005, but that didn't change anything.

The thing is I don't have the code of the old one so I can't see what specific attributes is used.

Does anyone have any idea which attributes I have to set to get the same thing?

Thanks a lot!

+1  A: 

Do you have the DLL of the old service? If you have the DLL you could potentially use Reflector to reverse engineer it if it's a .net service.

Joshua Cauble
The other webservice was created in java, so that's a no go :(
WtFudgE
Have you looked at any Java Decompiler? That may be the only thing if you want to be 100% sure. Only other way would be to compare the xsd / wsdl's down to the nitty gritty to try and get them to match. Also another thing you might try would be a product like SOAPScope that allows you to actually see the full SOAP Packet going across the wire. Then you may be able to infer any changes you need from a SOAP perspective.
Joshua Cauble
A: 

My Guess would be to check the namespace used, I had a similar problem and it drilled down to be a difference in name space problem. Check for:

[WebService(Namespace = "http://tempuri.org/"]

This is default, which might be in your new webservice and your old webservice might be using some other namespace.

Nitin Midha
The namespaces are both: [WebService(Namespace = "http://ws.hl7.trispark.com/")]
WtFudgE
A: 

Try to compare the WSDL of both services - see if you can find any clue there.

To get it you add to the end of the URL ?WSDL see example at http://aspnet.15seconds.com/010430/SampleService.asmx and http://aspnet.15seconds.com/010430/SampleService.asmx?WSDL respectively.

EDIT:
I am not a WSDL guru and so can't tell you where the issue is.
Another option you may consider is to compare sniffs of the requests to the services - this could provide other clues.

Dror
I tried doing this already, I didn't see much difference but I'm not that brilliant in reading wsdl files. I'm not sure if I'm allowed to do this (so if not I'm sorry and I won't do it again), but these are the two wsdl's:http://users.telenet.be/i_dislike_mushrooms/tmp/old.txthttp://users.telenet.be/i_dislike_mushrooms/tmp/new.txt
WtFudgE