简体   繁体   中英

How do I translate a WSDl generated for Java Webservice into a C# client?

I am in .NET environment and I am supposed to reference and consume a java WebService with a WSDL.

I am not a wsdl master and neither have I done extensive work in WCF but normally WCF has two kind of binding which are BasicHTTP and WSHTTP but it sounds like I am not able to find any details on this looking at the WSDL. instead I do see something like following:

<wsdl:port name="SFAPI12" binding="tns:SFAPISoap12Binding">
  <wsdlsoap12:address location="https://api.successfactors.eu:443/sfapi/v1/soap12" /> 
  </wsdl:port>

followed by

<wsdl:binding name="SFAPISoapBinding" type="tns:SFAPI"><wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

I have no idea how to consume it in my C# application. Any ideas?

Right click the ServiceReference folder in your C# project, click on 'Add new service reference'. Give the java wsdl and enter an alias name for this service. Once this is done, then you can start using this alias for making client calls to the service.

You can use tool svcutil.exe. Run from command line:

svcutil *.wsdl

It generates ".cs" and ".config" files.

svcutil.exe usually placed in directory: c:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\Bin\\ or similar.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM