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!