C # Consume Webservice

1

Recently I made a utility to send invoices to the SII system of the hacienda using the hacienda webservice.

In visual studio create a reference to the web service link

In this way, I conveniently access the methods and I can send the desired data.

in the app.config file I have added these lines

<client>
      <!--Facturas emitidas-->
          <!--Entorno Real -->
          <endpoint address="https://www1.agenciatributaria.gob.es/wlpl/SSII-FACT/ws/fe/SiiFactFEV1SOAP"
                binding="basicHttpBinding" bindingConfiguration="siiBinding2"
                contract="WsSiiFraEmi.siiSOAP" name="SuministroFactEmitidas" />
    </client>

Now it happens that those of the Basque country do the same but the url of the web service is different. is the next link

the methods and functionalities are the same only that it changes the address of the webservice and its endpoint.

my question is, do I have to create a new reference to the new web service or can I take advantage of the already established web reference and change only the endpoint address ??

I hope you have explained me well.

Thanks

    
asked by IcuScc 07.02.2018 в 17:39
source

1 answer

2

to change between the real environment and the test environment, it is possible to do it without modifying the references. It can also be done for the SII of Navarra, but with the Basques, when using different namespaces in the schemes, it will not work. We, in addition to modifying the address, have added an EndpointBehavior to make a "replace" of the namespaces. See link . Good luck.

    
answered by 08.02.2018 / 19:45
source