[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 377
  • Last Modified:

someone have a a code to send an xml to a web service's

hi

i need to send a xml file to a company web services

it give me this url

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

and it is  the web service descrpition:

  <?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>



.................

i need to send my xml file with 2 parameters :

Intproveedor   integer 5
Strxml     string with xml complete


someone has a code to do this  with c# ?


thanks


0
tenriquez199
Asked:
tenriquez199
2 Solutions
 
Bob LearnedCommented:
What happens if you add a web reference (service reference), and look at the proxy class that gets generated?  It should generate a class that you can use to call the web method...
0
 
regevhaCommented:
The following C# code implements the Web Service call you asked help with:
            mx.gob.diconsa.www.PRVCargaCFD client = new WsClientExample.mx.gob.diconsa.www.PRVCargaCFD();
            int iProveedor = 1;
            String stXml = "<root><elem1>abcdefg</elem1></root>";
            sbyte sbResult;
            sbResult = client.Execute(iProveedor, stXml);

Open in new window

"mx.gob.diconsa.www" is the name of the WSDL "Web Reference"
Refer to the following post in order to define a Web Reference (not WCF Service Reference) - http://blog.stevienova.com/2010/10/01/visual-studio-2010-adding-a-web-reference/
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now