[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

how can i consume a web service soap with c#

Posted on 2011-09-26
7
Medium Priority
?
1,090 Views
Last Modified: 2013-12-17
hi..

i need to sonsume a web service with c#.

it web service run at this url http://www.diconsa.gob.mx/SiCFDQA/servlet/aprvcargacfd

it show this :

  <?xml version="1.0" encoding="UTF-8" ?>
  <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />


the description is at : http://www.diconsa.gob.mx/SiCFD/servlet/aprvcargacfd?wsdl

and show it :

<?xml version="1.0" encoding="UTF-8" ?>
- <definitions name="PRVCargaCFD" targetNamespace="SiCFD" xmlns:tns="SiCFD" xmlns:wsdlns="SiCFD" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns1="SiCFD" xmlns:tns2="Genexus">
- <types>
- <schema targetNamespace="SiCFD" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" elementFormDefault="qualified">
  <import namespace="Genexus" />
- <element name="PRVCargaCFD.Execute">
- <complexType>
- <sequence>
  <element minOccurs="1" maxOccurs="1" name="Intproveedor" type="xsd:int" />
  <element minOccurs="1" maxOccurs="1" name="Strxml" type="xsd:string" />
  </sequence>
  </complexType>
  </element>
- <element name="PRVCargaCFD.ExecuteResponse">
- <complexType>
- <sequence>
  <element minOccurs="1" maxOccurs="1" name="Intrespuesta" type="xsd:byte" />
  </sequence>
  </complexType>
  </element>
  </schema>
  </types>
- <message name="PRVCargaCFD.ExecuteSoapIn">
  <part name="parameters" element="tns:PRVCargaCFD.Execute" />
  </message>
- <message name="PRVCargaCFD.ExecuteSoapOut">
  <part name="parameters" element="tns:PRVCargaCFD.ExecuteResponse" />
  </message>
- <portType name="PRVCargaCFDSoapPort">
- <operation name="Execute">
  <input message="wsdlns:PRVCargaCFD.ExecuteSoapIn" />
  <output message="wsdlns:PRVCargaCFD.ExecuteSoapOut" />
  </operation>
  </portType>
- <binding name="PRVCargaCFDSoapBinding" type="wsdlns:PRVCargaCFDSoapPort">
  <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
- <operation name="Execute">
  <soap:operation soapAction="SiCFDaction/APRVCARGACFD.Execute" />
- <input>
  <soap:body use="literal" />
  </input>
- <output>
  <soap:body use="literal" />
  </output>
  </operation>
  </binding>
- <service name="PRVCargaCFD">
- <port name="PRVCargaCFDSoapPort" binding="wsdlns:PRVCargaCFDSoapBinding">
  <soap:address location="http://www.diconsa.gob.mx/SiCFD/servlet/aprvcargacfd" />
  </port>
  </service>
  </definitions>



could help me to develope solution with c# web

some one could help me please

0
Comment
Question by:tenriquez199
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 18

Expert Comment

by:Gary Davis
ID: 36610388
You would start with adding a web reference and supply the address of the wsdl url.

Right click the project in solution explorer and choose Add Service Reference. Click Advanced on the bottom left and then click Add Web Reference.

Then in your code, you will be able to create an instance of the web service, set its properties and call its methods.

Gary Davis

0
 
LVL 1

Author Comment

by:tenriquez199
ID: 36619522
hi gardavis thanks

i did you tell me but  system give me a message

the file at URL http://www.diconsa.gob.mx/SiCFD/servlet/aprvcargacfd  cant recongnize as a know file.
the type files error message can you solve the problem
- the  'Esquema XML'  report is  'the root element is an W3 schema




you know how solve it?

thanks a lot


web-service-soap-error.JPG
0
 
LVL 18

Expert Comment

by:Gary Davis
ID: 36623275
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
LVL 17

Expert Comment

by:sonawanekiran
ID: 36707614
You need to
Add Service Reference >> Advance >> Add Web Reference and use below url

http://www.diconsa.gob.mx/SiCFD/servlet/aprvcargacfd?wsdl


See below screenshot



image001.png
0
 
LVL 1

Accepted Solution

by:
tenriquez199 earned 0 total points
ID: 36710356
thanks gardavis, sonawanekiran

i yet can assign the web service reference.

now when i run my application have an error... system tell me that:

Serever error at '/DICONSA' appplication.
You can not implement the method or operation
Description: An unhandled exception when running the current web request. Check the stack trace for more information about the error and where it originated in the code.
Detalles de la excepción: System.NotImplementedException: No se puede implementar el método o la operación.
Type text or a website address or translate a document.
Cancel
Spanish - detected to English translation
Exception Details: System.NotImplementedException: Unable to implement the method or operation.
Source Error:
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable it, do one of these steps and then reapply the URL:
1. Add a directive "Debug = true" at the top of the file that generated the error. example:
Stack Trace:

[NotImplementedException: No se puede implementar el método o la operación.]
   PRVCargaCFD.Execute(Int16 Intproveedor, String Strxml) +28
   WebApplication1_Default.Button1_Click(Object sender, EventArgs e) +79
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +118
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +112
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563




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

as you can see....some part of messages say me enable debug, ...but it is not posibble when my application need to consume a web service as it is
0
 
LVL 1

Author Comment

by:tenriquez199
ID: 37793642
i was testing wrong

i found that i dont have to run in a test mode when i consume a service

tanks a lot
0
 
LVL 1

Author Closing Comment

by:tenriquez199
ID: 37795195
thanks
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question