1
I received these guidelines to access and consume the list methodProducts of a Webservice:
Standard form of authentication of Java application webservices for entities and associates
The client must have an operator registered on the system, with "web-service" access permission and a specific password for the access medium; the authentication mechanism uses the HTTP basic Authentication standard.
Login data (operator and password) must be sent in the specific header (Authorization) encrypted in Base 64, for example:
The operator name (in the example, "wsteste") and the password (in the example, "wsteste333") must be concatenated: wsteste:wsteste333
Then they must be encrypted in Base 64: d3N0ZXN0ZTp3c3Rlc3RlMzMz
Requests must be sent containing the header, using the sequence encrypted: Authorization: Basic d3N0ZXN0ZTp3c3Rlc3RlMzMz
The login runs throughout the entire web-service operation; therefore, every request must have the header specified above; if the login does not occur successfully, the service returns "HTTP ERROR: 401";
Request example containing the header:
Cookie: $Version=0; JSESSIONID=48g39p406ezh_dev01; $Path=/spc
Authorization: Basic d3N0ZXN0ZTp3c3Rlc3RlMzMz
Host: localhost:8080
Content-Length: 1799
SOAPAction: ""
User-Agent: Jakarta Commons-HttpClient/3.0.1
Content-Type: text/xml;charset=UTF-8
Connection: close
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:web="http://webservice.consulta.xxxjava.spcbrasil.org/">
<soapenv:Header/>
<soapenv:Body>
...
</soapenv:Body>
</soapenv:Envelope>
I received Login and Password access and have some knowledge in consuming Webservice based on some articles:
ASP. NET 2008 - Creating Web Services II
VB. NET - Consuming Web Services with Windows Forms
The problem is that when adding the reference to the project and the screen appears requesting the login and password and after informing the Login and Password returns me the messages below and I’m not sure if I’m doing it right, or else there is some problem with this login and password provided by the Customer?
This is the WSDL:
<!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2.1-hudson-28-. -->
<!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2.1-hudson-28-. -->
<definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://webservice.consulta.spcjava.spcbrasil.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://webservice.consulta.spcjava.spcbrasil.org/" name="consultaWebService">
<types>...</types>
<message name="listarProdutos"/>
<message name="listarProdutosResponse">
<part name="produtos" element="tns:produtos"/>
</message>
<message name="consultar">...</message>
<message name="consultarResponse">...</message>
<message name="detalharProduto">...</message>
<message name="detalharProdutoResponse">...</message>
<message name="consultaComplementar">...</message>
<message name="consultaComplementarResponse">...</message>
<message name="consultaScore">...</message>
<message name="consultaScoreResponse">...</message>
<portType name="consultaWebService">...</portType>
<binding name="consultaWebServicePortBinding" type="tns:consultaWebService">...</binding>
<service name="consultaWebService">...</service>
</definitions>
Operation "list of products"
Description: Returns the products available for consultation.
Rules of use:
1. If no products are available to the operator, the operation does not return given.
Input Parameters: not applicable
I implemented the suggestion of Rovann Linhalis , but maybe I keep doing something wrong in the implementation because error occurs:
it seems to me not a web-service SOAP, search for consuming WS with HTTP Post and this authentication content, you send in the request header
– Rovann Linhalis