5
I have a webservice developed in java working perfectly, only that I need to send the namespace xmlns:xsi
and xmlns:xsd
as shown in the example below:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" > </soap:Envelope>'
The answer I am sending is as follows::
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
</soap:Envelope>
If I don’t send the namespace my client gets the answer null
.
I’ve tried to Annotation and setting up my jboss and nothing solved. I’m new in Webservice SOAP.
I’m using Jboss Wildfly and Jbossws with CXF.
My interface:
@WebService(targetNamespace = "http://tempuri.org/", name = "NOTFISSoap")
public interface NOTFISSoap {
@WebMethod(action = "http://tempuri.org/receberNotasFiscais")
@WebResult(name = "receberNotasFiscaisResult", targetNamespace = "http://tempuri.org/")
public ReceberNotasFiscaisResult receberNotasFiscais(
@WebParam(name = "paramNotaFiscal", targetNamespace = "http://tempuri.org/")
ArrayOfDestinatarioMercadoriaV2 paramNotaFiscal,
@WebParam(name = "classAuthenticationNotFis_v2", targetNamespace = "http://tempuri.org/", header=true)
ClassAuthenticationNotFisV2 authentication
);
}
My implementation:
@WebService(serviceName = "NOTFIS", endpointInterface = "br.com.ws.soap.service.NOTFISSoap", targetNamespace = "http://tempuri.org/")
@BindingType(javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING)
public class NOTFISSoapImpl implements NOTFISSoap {
@Override
public ReceberNotasFiscaisResult receberNotasFiscais(
ArrayOfDestinatarioMercadoriaV2 paramNotaFiscal, ClassAuthenticationNotFisV2 authentication) {
// Código
}
}
Using Soapui, I can consume the service without any problems. Only the client my client can’t get why he waits for these namespaces (xmlns:xsi
and xmlns:xsd
) in response.
Hugs
Can you give more details about the API and the code you are using? After all, there are several technologies that work with XML and SOAP in Java, and each one does it in a different way. This is also important to prevent someone from posting potentially useless answers such as "just replace the string that represents SOAP before sending".
– Victor Stafusa
I improved the question with more information.
– Ricardo Fernando
That has to do with NF-e?
– Victor Stafusa
In parts... my client will consume my webservice (that part is ok) by sending some information, I process that information and return a response to it... that part is the problem.
– Ricardo Fernando
The data has to do with NF-e... but only the data... I receive data from recipients and tax notes (his business rule).
– Ricardo Fernando