Import wsdl file into C# WCF project, and expose wsdl contracts












0















I have a wsdl file provided by third-party, and i need to use it as-is and expose the contracts in this wsdl to be consumed.



My problem is that my project has its own namespace, and this wsdl comes with a different namespace, and i have no idea how to get the job done.



Appreciate any help



EDIT



The third-party (gov) expect to call the service with their namespace



Example:
I have a WCF Service Application with namespace: local.namespace



WSDL:



<wsdl:definitions xmlns:ns0="http://com.gov.update.ws" targetNamespace="http://com.gov.update.ws">
<wsdl:message name="updateStatus">
<wsdl:part name="parameters" element="xsns:updateStatus" xmlns:xsns="http://com.gov.update.ws"/>
</wsdl:message>
</wsdl:definitions>


Received SOAP:



<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<ctx:clientContext xmlns:ctx="http://ClientContext">
<ctx:clientUserId>123456</ctx:clientUserId>
</ctx:clientContext>
</soapenv:Header>
<soapenv:Body>
<p820:updateStatus xmlns:p820="http://com.gov.update.ws">
<transactionId>123456</transactionId>
<status>Accepted</status>
</p820:updateStatus>
</soapenv:Body>
</soapenv:Envelope>









share|improve this question

























  • are you using svcutil or wsdl.exe to extract the contracts?

    – Popo
    Nov 12 '18 at 20:34











  • I'm not even sure which one to use! I used the svcutil, which produced an ugly file containing all [XML] decorations for (interfaces, namespace, and methods). Although I don't like the generated file, i still don't know how to use it as-is for the third-party to consume it

    – Roshdy
    Nov 13 '18 at 5:58
















0















I have a wsdl file provided by third-party, and i need to use it as-is and expose the contracts in this wsdl to be consumed.



My problem is that my project has its own namespace, and this wsdl comes with a different namespace, and i have no idea how to get the job done.



Appreciate any help



EDIT



The third-party (gov) expect to call the service with their namespace



Example:
I have a WCF Service Application with namespace: local.namespace



WSDL:



<wsdl:definitions xmlns:ns0="http://com.gov.update.ws" targetNamespace="http://com.gov.update.ws">
<wsdl:message name="updateStatus">
<wsdl:part name="parameters" element="xsns:updateStatus" xmlns:xsns="http://com.gov.update.ws"/>
</wsdl:message>
</wsdl:definitions>


Received SOAP:



<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<ctx:clientContext xmlns:ctx="http://ClientContext">
<ctx:clientUserId>123456</ctx:clientUserId>
</ctx:clientContext>
</soapenv:Header>
<soapenv:Body>
<p820:updateStatus xmlns:p820="http://com.gov.update.ws">
<transactionId>123456</transactionId>
<status>Accepted</status>
</p820:updateStatus>
</soapenv:Body>
</soapenv:Envelope>









share|improve this question

























  • are you using svcutil or wsdl.exe to extract the contracts?

    – Popo
    Nov 12 '18 at 20:34











  • I'm not even sure which one to use! I used the svcutil, which produced an ugly file containing all [XML] decorations for (interfaces, namespace, and methods). Although I don't like the generated file, i still don't know how to use it as-is for the third-party to consume it

    – Roshdy
    Nov 13 '18 at 5:58














0












0








0








I have a wsdl file provided by third-party, and i need to use it as-is and expose the contracts in this wsdl to be consumed.



My problem is that my project has its own namespace, and this wsdl comes with a different namespace, and i have no idea how to get the job done.



Appreciate any help



EDIT



The third-party (gov) expect to call the service with their namespace



Example:
I have a WCF Service Application with namespace: local.namespace



WSDL:



<wsdl:definitions xmlns:ns0="http://com.gov.update.ws" targetNamespace="http://com.gov.update.ws">
<wsdl:message name="updateStatus">
<wsdl:part name="parameters" element="xsns:updateStatus" xmlns:xsns="http://com.gov.update.ws"/>
</wsdl:message>
</wsdl:definitions>


Received SOAP:



<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<ctx:clientContext xmlns:ctx="http://ClientContext">
<ctx:clientUserId>123456</ctx:clientUserId>
</ctx:clientContext>
</soapenv:Header>
<soapenv:Body>
<p820:updateStatus xmlns:p820="http://com.gov.update.ws">
<transactionId>123456</transactionId>
<status>Accepted</status>
</p820:updateStatus>
</soapenv:Body>
</soapenv:Envelope>









share|improve this question
















I have a wsdl file provided by third-party, and i need to use it as-is and expose the contracts in this wsdl to be consumed.



My problem is that my project has its own namespace, and this wsdl comes with a different namespace, and i have no idea how to get the job done.



Appreciate any help



EDIT



The third-party (gov) expect to call the service with their namespace



Example:
I have a WCF Service Application with namespace: local.namespace



WSDL:



<wsdl:definitions xmlns:ns0="http://com.gov.update.ws" targetNamespace="http://com.gov.update.ws">
<wsdl:message name="updateStatus">
<wsdl:part name="parameters" element="xsns:updateStatus" xmlns:xsns="http://com.gov.update.ws"/>
</wsdl:message>
</wsdl:definitions>


Received SOAP:



<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<ctx:clientContext xmlns:ctx="http://ClientContext">
<ctx:clientUserId>123456</ctx:clientUserId>
</ctx:clientContext>
</soapenv:Header>
<soapenv:Body>
<p820:updateStatus xmlns:p820="http://com.gov.update.ws">
<transactionId>123456</transactionId>
<status>Accepted</status>
</p820:updateStatus>
</soapenv:Body>
</soapenv:Envelope>






c# wcf soap wsdl






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 13 '18 at 10:48







Roshdy

















asked Nov 12 '18 at 18:05









RoshdyRoshdy

58931125




58931125













  • are you using svcutil or wsdl.exe to extract the contracts?

    – Popo
    Nov 12 '18 at 20:34











  • I'm not even sure which one to use! I used the svcutil, which produced an ugly file containing all [XML] decorations for (interfaces, namespace, and methods). Although I don't like the generated file, i still don't know how to use it as-is for the third-party to consume it

    – Roshdy
    Nov 13 '18 at 5:58



















  • are you using svcutil or wsdl.exe to extract the contracts?

    – Popo
    Nov 12 '18 at 20:34











  • I'm not even sure which one to use! I used the svcutil, which produced an ugly file containing all [XML] decorations for (interfaces, namespace, and methods). Although I don't like the generated file, i still don't know how to use it as-is for the third-party to consume it

    – Roshdy
    Nov 13 '18 at 5:58

















are you using svcutil or wsdl.exe to extract the contracts?

– Popo
Nov 12 '18 at 20:34





are you using svcutil or wsdl.exe to extract the contracts?

– Popo
Nov 12 '18 at 20:34













I'm not even sure which one to use! I used the svcutil, which produced an ugly file containing all [XML] decorations for (interfaces, namespace, and methods). Although I don't like the generated file, i still don't know how to use it as-is for the third-party to consume it

– Roshdy
Nov 13 '18 at 5:58





I'm not even sure which one to use! I used the svcutil, which produced an ugly file containing all [XML] decorations for (interfaces, namespace, and methods). Although I don't like the generated file, i still don't know how to use it as-is for the third-party to consume it

– Roshdy
Nov 13 '18 at 5:58












1 Answer
1






active

oldest

votes


















0














In general, it is relatively common that we use the client proxy class to call the web service by adding service reference. As follows.
https://docs.microsoft.com/en-us/dotnet/framework/wcf/accessing-services-using-a-wcf-client

You could also generate the client proxy class by SVCUtil tool.
https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-3.5/aa347733(v=vs.90)

I have made a simple demo, wish it is useful to you.
Server:



namespace Server8
{
class Program
{
static void Main(string args)
{
Uri uri = new Uri("http://localhost:1900");
BasicHttpBinding binding = new BasicHttpBinding();
using (ServiceHost sh=new ServiceHost(typeof(MyService),uri))
{
sh.AddServiceEndpoint(typeof(IService), binding, "");
ServiceMetadataBehavior smb;
smb = sh.Description.Behaviors.Find<ServiceMetadataBehavior>();
if (smb==null)
{
smb = new ServiceMetadataBehavior()
{
HttpGetEnabled = true
};
sh.Description.Behaviors.Add(smb);
}
Binding binding1 = MetadataExchangeBindings.CreateMexHttpBinding();
sh.AddServiceEndpoint(typeof(IMetadataExchange), binding1, "mex");
sh.Open();
Console.WriteLine("Service is ready...");

Console.ReadLine();
sh.Close();
}

}
}
[ServiceContract(Namespace ="mydomain")]
public interface IService
{
[OperationContract(Name ="AddInt")]
int Add(int x, int y);

}
public class MyService : IService
{
public int Add(int x, int y)
{
return x + y;
}
}
}


So the WSDL address is,



Http://localhost:1900?wsdl


Svctutil Tool.



Svcutil http://localhost:1900?wsdl /directory:D: /namespace:”mydomain”,”LocalProjectNamespace”


This command would generate a client proxy class in local D partition and replace the web service's namespace with "LocalProjectNamespace", it also generates a client configuration file(xml),which describes the service's binding and endpoint information.
enter image description here

And then we call the web service via client proxy class.



static void Main(string args)
{
ServiceClient client = new ServiceClient();
try
{
var result = client.AddInt(23, 55);
Console.WriteLine(result);
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}


Feel free to let me know if there is anything I can help with.






share|improve this answer


























  • My main problem is with the local namespace. The scenario is: i'm dealing with gov service. They provided me a wsdl file, and they have a standard soap envelop which doens't care which "company" they are calling. That been said, they expect to call exactly the wsdl they provided me!

    – Roshdy
    Nov 13 '18 at 8:21











  • ex: their namespace targetNamespace="http://com.xxx.update.ws" and their soap body that they produce and expect me to handle looks like: <soapenv:body><p820:methodName xmlns:p820="http://com.xxx.update.ws">. Does that make it any easier to make my point :)?

    – Roshdy
    Nov 13 '18 at 8:27













  • sorry for my poor English. Is svcutil /Namespace parameter your want? it allows us to send the soap message with the server's namespace(we could check it in the soap message)

    – Abraham Qian
    Nov 13 '18 at 8:52











  • i just updated the question, i hope it makes it clearer

    – Roshdy
    Nov 13 '18 at 8:57













Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53267738%2fimport-wsdl-file-into-c-sharp-wcf-project-and-expose-wsdl-contracts%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














In general, it is relatively common that we use the client proxy class to call the web service by adding service reference. As follows.
https://docs.microsoft.com/en-us/dotnet/framework/wcf/accessing-services-using-a-wcf-client

You could also generate the client proxy class by SVCUtil tool.
https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-3.5/aa347733(v=vs.90)

I have made a simple demo, wish it is useful to you.
Server:



namespace Server8
{
class Program
{
static void Main(string args)
{
Uri uri = new Uri("http://localhost:1900");
BasicHttpBinding binding = new BasicHttpBinding();
using (ServiceHost sh=new ServiceHost(typeof(MyService),uri))
{
sh.AddServiceEndpoint(typeof(IService), binding, "");
ServiceMetadataBehavior smb;
smb = sh.Description.Behaviors.Find<ServiceMetadataBehavior>();
if (smb==null)
{
smb = new ServiceMetadataBehavior()
{
HttpGetEnabled = true
};
sh.Description.Behaviors.Add(smb);
}
Binding binding1 = MetadataExchangeBindings.CreateMexHttpBinding();
sh.AddServiceEndpoint(typeof(IMetadataExchange), binding1, "mex");
sh.Open();
Console.WriteLine("Service is ready...");

Console.ReadLine();
sh.Close();
}

}
}
[ServiceContract(Namespace ="mydomain")]
public interface IService
{
[OperationContract(Name ="AddInt")]
int Add(int x, int y);

}
public class MyService : IService
{
public int Add(int x, int y)
{
return x + y;
}
}
}


So the WSDL address is,



Http://localhost:1900?wsdl


Svctutil Tool.



Svcutil http://localhost:1900?wsdl /directory:D: /namespace:”mydomain”,”LocalProjectNamespace”


This command would generate a client proxy class in local D partition and replace the web service's namespace with "LocalProjectNamespace", it also generates a client configuration file(xml),which describes the service's binding and endpoint information.
enter image description here

And then we call the web service via client proxy class.



static void Main(string args)
{
ServiceClient client = new ServiceClient();
try
{
var result = client.AddInt(23, 55);
Console.WriteLine(result);
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}


Feel free to let me know if there is anything I can help with.






share|improve this answer


























  • My main problem is with the local namespace. The scenario is: i'm dealing with gov service. They provided me a wsdl file, and they have a standard soap envelop which doens't care which "company" they are calling. That been said, they expect to call exactly the wsdl they provided me!

    – Roshdy
    Nov 13 '18 at 8:21











  • ex: their namespace targetNamespace="http://com.xxx.update.ws" and their soap body that they produce and expect me to handle looks like: <soapenv:body><p820:methodName xmlns:p820="http://com.xxx.update.ws">. Does that make it any easier to make my point :)?

    – Roshdy
    Nov 13 '18 at 8:27













  • sorry for my poor English. Is svcutil /Namespace parameter your want? it allows us to send the soap message with the server's namespace(we could check it in the soap message)

    – Abraham Qian
    Nov 13 '18 at 8:52











  • i just updated the question, i hope it makes it clearer

    – Roshdy
    Nov 13 '18 at 8:57


















0














In general, it is relatively common that we use the client proxy class to call the web service by adding service reference. As follows.
https://docs.microsoft.com/en-us/dotnet/framework/wcf/accessing-services-using-a-wcf-client

You could also generate the client proxy class by SVCUtil tool.
https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-3.5/aa347733(v=vs.90)

I have made a simple demo, wish it is useful to you.
Server:



namespace Server8
{
class Program
{
static void Main(string args)
{
Uri uri = new Uri("http://localhost:1900");
BasicHttpBinding binding = new BasicHttpBinding();
using (ServiceHost sh=new ServiceHost(typeof(MyService),uri))
{
sh.AddServiceEndpoint(typeof(IService), binding, "");
ServiceMetadataBehavior smb;
smb = sh.Description.Behaviors.Find<ServiceMetadataBehavior>();
if (smb==null)
{
smb = new ServiceMetadataBehavior()
{
HttpGetEnabled = true
};
sh.Description.Behaviors.Add(smb);
}
Binding binding1 = MetadataExchangeBindings.CreateMexHttpBinding();
sh.AddServiceEndpoint(typeof(IMetadataExchange), binding1, "mex");
sh.Open();
Console.WriteLine("Service is ready...");

Console.ReadLine();
sh.Close();
}

}
}
[ServiceContract(Namespace ="mydomain")]
public interface IService
{
[OperationContract(Name ="AddInt")]
int Add(int x, int y);

}
public class MyService : IService
{
public int Add(int x, int y)
{
return x + y;
}
}
}


So the WSDL address is,



Http://localhost:1900?wsdl


Svctutil Tool.



Svcutil http://localhost:1900?wsdl /directory:D: /namespace:”mydomain”,”LocalProjectNamespace”


This command would generate a client proxy class in local D partition and replace the web service's namespace with "LocalProjectNamespace", it also generates a client configuration file(xml),which describes the service's binding and endpoint information.
enter image description here

And then we call the web service via client proxy class.



static void Main(string args)
{
ServiceClient client = new ServiceClient();
try
{
var result = client.AddInt(23, 55);
Console.WriteLine(result);
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}


Feel free to let me know if there is anything I can help with.






share|improve this answer


























  • My main problem is with the local namespace. The scenario is: i'm dealing with gov service. They provided me a wsdl file, and they have a standard soap envelop which doens't care which "company" they are calling. That been said, they expect to call exactly the wsdl they provided me!

    – Roshdy
    Nov 13 '18 at 8:21











  • ex: their namespace targetNamespace="http://com.xxx.update.ws" and their soap body that they produce and expect me to handle looks like: <soapenv:body><p820:methodName xmlns:p820="http://com.xxx.update.ws">. Does that make it any easier to make my point :)?

    – Roshdy
    Nov 13 '18 at 8:27













  • sorry for my poor English. Is svcutil /Namespace parameter your want? it allows us to send the soap message with the server's namespace(we could check it in the soap message)

    – Abraham Qian
    Nov 13 '18 at 8:52











  • i just updated the question, i hope it makes it clearer

    – Roshdy
    Nov 13 '18 at 8:57
















0












0








0







In general, it is relatively common that we use the client proxy class to call the web service by adding service reference. As follows.
https://docs.microsoft.com/en-us/dotnet/framework/wcf/accessing-services-using-a-wcf-client

You could also generate the client proxy class by SVCUtil tool.
https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-3.5/aa347733(v=vs.90)

I have made a simple demo, wish it is useful to you.
Server:



namespace Server8
{
class Program
{
static void Main(string args)
{
Uri uri = new Uri("http://localhost:1900");
BasicHttpBinding binding = new BasicHttpBinding();
using (ServiceHost sh=new ServiceHost(typeof(MyService),uri))
{
sh.AddServiceEndpoint(typeof(IService), binding, "");
ServiceMetadataBehavior smb;
smb = sh.Description.Behaviors.Find<ServiceMetadataBehavior>();
if (smb==null)
{
smb = new ServiceMetadataBehavior()
{
HttpGetEnabled = true
};
sh.Description.Behaviors.Add(smb);
}
Binding binding1 = MetadataExchangeBindings.CreateMexHttpBinding();
sh.AddServiceEndpoint(typeof(IMetadataExchange), binding1, "mex");
sh.Open();
Console.WriteLine("Service is ready...");

Console.ReadLine();
sh.Close();
}

}
}
[ServiceContract(Namespace ="mydomain")]
public interface IService
{
[OperationContract(Name ="AddInt")]
int Add(int x, int y);

}
public class MyService : IService
{
public int Add(int x, int y)
{
return x + y;
}
}
}


So the WSDL address is,



Http://localhost:1900?wsdl


Svctutil Tool.



Svcutil http://localhost:1900?wsdl /directory:D: /namespace:”mydomain”,”LocalProjectNamespace”


This command would generate a client proxy class in local D partition and replace the web service's namespace with "LocalProjectNamespace", it also generates a client configuration file(xml),which describes the service's binding and endpoint information.
enter image description here

And then we call the web service via client proxy class.



static void Main(string args)
{
ServiceClient client = new ServiceClient();
try
{
var result = client.AddInt(23, 55);
Console.WriteLine(result);
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}


Feel free to let me know if there is anything I can help with.






share|improve this answer















In general, it is relatively common that we use the client proxy class to call the web service by adding service reference. As follows.
https://docs.microsoft.com/en-us/dotnet/framework/wcf/accessing-services-using-a-wcf-client

You could also generate the client proxy class by SVCUtil tool.
https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-3.5/aa347733(v=vs.90)

I have made a simple demo, wish it is useful to you.
Server:



namespace Server8
{
class Program
{
static void Main(string args)
{
Uri uri = new Uri("http://localhost:1900");
BasicHttpBinding binding = new BasicHttpBinding();
using (ServiceHost sh=new ServiceHost(typeof(MyService),uri))
{
sh.AddServiceEndpoint(typeof(IService), binding, "");
ServiceMetadataBehavior smb;
smb = sh.Description.Behaviors.Find<ServiceMetadataBehavior>();
if (smb==null)
{
smb = new ServiceMetadataBehavior()
{
HttpGetEnabled = true
};
sh.Description.Behaviors.Add(smb);
}
Binding binding1 = MetadataExchangeBindings.CreateMexHttpBinding();
sh.AddServiceEndpoint(typeof(IMetadataExchange), binding1, "mex");
sh.Open();
Console.WriteLine("Service is ready...");

Console.ReadLine();
sh.Close();
}

}
}
[ServiceContract(Namespace ="mydomain")]
public interface IService
{
[OperationContract(Name ="AddInt")]
int Add(int x, int y);

}
public class MyService : IService
{
public int Add(int x, int y)
{
return x + y;
}
}
}


So the WSDL address is,



Http://localhost:1900?wsdl


Svctutil Tool.



Svcutil http://localhost:1900?wsdl /directory:D: /namespace:”mydomain”,”LocalProjectNamespace”


This command would generate a client proxy class in local D partition and replace the web service's namespace with "LocalProjectNamespace", it also generates a client configuration file(xml),which describes the service's binding and endpoint information.
enter image description here

And then we call the web service via client proxy class.



static void Main(string args)
{
ServiceClient client = new ServiceClient();
try
{
var result = client.AddInt(23, 55);
Console.WriteLine(result);
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}


Feel free to let me know if there is anything I can help with.







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 13 '18 at 8:17

























answered Nov 13 '18 at 8:04









Abraham QianAbraham Qian

69616




69616













  • My main problem is with the local namespace. The scenario is: i'm dealing with gov service. They provided me a wsdl file, and they have a standard soap envelop which doens't care which "company" they are calling. That been said, they expect to call exactly the wsdl they provided me!

    – Roshdy
    Nov 13 '18 at 8:21











  • ex: their namespace targetNamespace="http://com.xxx.update.ws" and their soap body that they produce and expect me to handle looks like: <soapenv:body><p820:methodName xmlns:p820="http://com.xxx.update.ws">. Does that make it any easier to make my point :)?

    – Roshdy
    Nov 13 '18 at 8:27













  • sorry for my poor English. Is svcutil /Namespace parameter your want? it allows us to send the soap message with the server's namespace(we could check it in the soap message)

    – Abraham Qian
    Nov 13 '18 at 8:52











  • i just updated the question, i hope it makes it clearer

    – Roshdy
    Nov 13 '18 at 8:57





















  • My main problem is with the local namespace. The scenario is: i'm dealing with gov service. They provided me a wsdl file, and they have a standard soap envelop which doens't care which "company" they are calling. That been said, they expect to call exactly the wsdl they provided me!

    – Roshdy
    Nov 13 '18 at 8:21











  • ex: their namespace targetNamespace="http://com.xxx.update.ws" and their soap body that they produce and expect me to handle looks like: <soapenv:body><p820:methodName xmlns:p820="http://com.xxx.update.ws">. Does that make it any easier to make my point :)?

    – Roshdy
    Nov 13 '18 at 8:27













  • sorry for my poor English. Is svcutil /Namespace parameter your want? it allows us to send the soap message with the server's namespace(we could check it in the soap message)

    – Abraham Qian
    Nov 13 '18 at 8:52











  • i just updated the question, i hope it makes it clearer

    – Roshdy
    Nov 13 '18 at 8:57



















My main problem is with the local namespace. The scenario is: i'm dealing with gov service. They provided me a wsdl file, and they have a standard soap envelop which doens't care which "company" they are calling. That been said, they expect to call exactly the wsdl they provided me!

– Roshdy
Nov 13 '18 at 8:21





My main problem is with the local namespace. The scenario is: i'm dealing with gov service. They provided me a wsdl file, and they have a standard soap envelop which doens't care which "company" they are calling. That been said, they expect to call exactly the wsdl they provided me!

– Roshdy
Nov 13 '18 at 8:21













ex: their namespace targetNamespace="http://com.xxx.update.ws" and their soap body that they produce and expect me to handle looks like: <soapenv:body><p820:methodName xmlns:p820="http://com.xxx.update.ws">. Does that make it any easier to make my point :)?

– Roshdy
Nov 13 '18 at 8:27







ex: their namespace targetNamespace="http://com.xxx.update.ws" and their soap body that they produce and expect me to handle looks like: <soapenv:body><p820:methodName xmlns:p820="http://com.xxx.update.ws">. Does that make it any easier to make my point :)?

– Roshdy
Nov 13 '18 at 8:27















sorry for my poor English. Is svcutil /Namespace parameter your want? it allows us to send the soap message with the server's namespace(we could check it in the soap message)

– Abraham Qian
Nov 13 '18 at 8:52





sorry for my poor English. Is svcutil /Namespace parameter your want? it allows us to send the soap message with the server's namespace(we could check it in the soap message)

– Abraham Qian
Nov 13 '18 at 8:52













i just updated the question, i hope it makes it clearer

– Roshdy
Nov 13 '18 at 8:57







i just updated the question, i hope it makes it clearer

– Roshdy
Nov 13 '18 at 8:57




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53267738%2fimport-wsdl-file-into-c-sharp-wcf-project-and-expose-wsdl-contracts%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Full-time equivalent

Bicuculline

さくらももこ