Background
The webservice service is used for interface communication in the project. In the specific application, the caller does not access the service directly, but forwards the request through a proxy to achieve access.
Problem
The client code generated by using apache axis1.4 tool to invoke the service can be accessed normally; the client code generated by using apache cxf tool reports an error: 2 counts of InaccessibleWSDLException.
Reason
The client code of axis is written with service name, port type and other information fixed in the generated code, while the client code of cxf is parsed by GET to get the wsdl file and bind service name and port name and other information before calling the interface.
In the project, because the proxy redirection interface address is used, the wsdl file cannot be directly obtained through GET for parsing, so an error is reported.
Solution:
- a. Store the wsdl file locally, read the local wsdl file in the client, and fill in the address of the actual interface in the soap address label in the wsdl file
<service name="xxxService">
<port binding="xxxSOAPBinding" name="xxxSOAPPort">
<soap:address location="http://yourActualAddress/xxxService"/>
</port>
</service>
- b. Change the calling code to skip the step of getting the wsdl.
xxxService ss = new xxxService(null, SERVICE_NAME);
XXXServicePortType port = ss.getPort(xxxServicePortType.class);
BindingProvider bindingProvider = (BindingProvider) port;
bindingProvider.getRequestContext()
.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
"http://www.example.com/real_endpoint_url_goes_here");
Response res = port.yourMethods(...);
Read More:
- [Solved] @webservice Error: org.apache.cxf.common.i18n.UncheckedException: No operation was found with
- [Solved] webService Error: webservice Interface call error reported.
- [Solved] Error: failed to create deliver client: orderer client failed to connect to orderer.example.com:7050
- Kubernetes Error: Error in configuration: unable to read client-cert* unable to read client-key*
- [Solved] Fabric Start Network Error: Error: error getting endorser client for channel: endorser client failed to connect to
- [Solved] Chrome Error: The request client is not a secure context
- [Solved] Error: Could not open client transport with JDBC Uri
- [Solved] Feign Error: -‘oauth-client.FeignClientSpecification‘ could not be registered
- [Solved] rabbitMQ: factory.newConnection() Error: com.rabbitmq.client.ShutdownSignalException
- How to Solve Client-go Mod Error
- [Solved] Nginx Request 500 Error: CreateFile() “/temp/client_body_temp/0000000013” failed (5: Access is denied)
- [Solved] sqoop Error: jSQLException in nextKeyValue Caused by: ORA-24920:column size too large for client
- Spark ERROR client.TransportResponseHandler: Still have 1 requests outstanding when connection from
- How to Solve creating bean with name ‘mappingjackson2httpmessageconverter’ error when elasticsearch advanced client starts‘
- The authentication server Configurate NoClassDefFoundError Error (store client information in a JDBC-based database)
- Springcloud configuration center client 3355 startup Error: error on get request for“ http://localhost:8761/eureka/apps/ “: Connection
- Encapsulation SDK Call Error: runtime error [How to Solve]
- [Solved] Git Error: client_global_hostkeys_private_confirm: server gave bad signature for RSA key 0
- [Solved] ClientError.Security.Unauthorized: The client is unauthorized due to authentication failure.
- PIKA trouble02 — (error) ERR Syntax error, try CLIENT (LIST [order by [addr|idle]| KILL ip:port)